/[gentoo-x86]/net-wireless/wpa_supplicant/wpa_supplicant-9999.ebuild
Gentoo

Contents of /net-wireless/wpa_supplicant/wpa_supplicant-9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Wed Sep 8 17:23:52 2010 UTC (9 years, 9 months ago) by gurligebis
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
Removing old version and broken live ebuild

(Portage version: 2.2_rc77/cvs/Linux i686)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/wpa_supplicant-9999.ebuild,v 1.5 2010/07/25 13:29:03 alexxy Exp $
4
5 EAPI="2"
6
7 inherit eutils toolchain-funcs qt4
8
9 if [[ ${PV} == "9999" ]] ; then
10 EGIT_REPO_URI="git://w1.fi/srv/git/hostap.git"
11 inherit git
12 SRC_URI=""
13 S="${WORKDIR}/${P}/${PN}/${PN}"
14 else
15 SRC_URI="http://hostap.epitest.fi/releases/${P}.tar.gz"
16 S="${WORKDIR}/${P}/${PN}"
17 fi
18
19 DESCRIPTION="IEEE 802.1X/WPA supplicant for secure wireless transfers"
20 HOMEPAGE="http://hostap.epitest.fi/wpa_supplicant/"
21
22 LICENSE="|| ( GPL-2 BSD )"
23
24 SLOT="0"
25 KEYWORDS=""
26 IUSE="dbus debug gnutls eap-sim fasteap madwifi ps3 qt4 readline ssl wps kernel_linux kernel_FreeBSD"
27
28 DEPEND="dev-libs/libnl
29 dbus? ( sys-apps/dbus )
30 kernel_linux? (
31 eap-sim? ( sys-apps/pcsc-lite )
32 madwifi? ( ||
33 ( >net-wireless/madwifi-ng-tools-0.9.3
34 net-wireless/madwifi-old )
35 )
36 )
37 !kernel_linux? ( net-libs/libpcap )
38 qt4? ( x11-libs/qt-gui:4 )
39 readline? ( sys-libs/ncurses sys-libs/readline )
40 ssl? ( dev-libs/openssl )
41 !ssl? ( gnutls? ( net-libs/gnutls ) )
42 !ssl? ( !gnutls? ( dev-libs/libtommath ) )"
43 RDEPEND="${DEPEND}"
44
45 S="${WORKDIR}/${P}/${PN}/${PN}"
46
47 src_unpack() {
48 einfo "src dir ${S}/"
49 if [[ ${PV} == "9999" ]] ; then
50 S="${WORKDIR}/${P}/${PN}"
51 git_src_unpack
52 S="${WORKDIR}/${P}/${PN}/${PN}"
53 else
54 unpack ${A}
55 fi
56 cd "${S}"
57 }
58
59 pkg_setup() {
60 if use fasteap && (use gnutls || use ssl) ; then
61 die "If you use fasteap, you must build with wpa_supplicant's internal TLS implementation. That is, both 'gnutls' and 'ssl' USE flags must be disabled"
62 fi
63
64 if use gnutls && use ssl ; then
65 einfo "You have both 'gnutls' and 'ssl' USE flags enabled: defaulting to USE=\"ssl\""
66 fi
67 }
68
69 src_prepare() {
70 einfo "src dir ${S}/"
71
72 # net/bpf.h needed for net-libs/libpcap on Gentoo/FreeBSD
73 sed -i \
74 -e "s:\(#include <pcap\.h>\):#include <net/bpf.h>\n\1:" \
75 ../src/l2_packet/l2_packet_freebsd.c || die
76
77 # People seem to take the example configuration file too literally (bug #102361)
78 sed -i \
79 -e "s:^\(opensc_engine_path\):#\1:" \
80 -e "s:^\(pkcs11_engine_path\):#\1:" \
81 -e "s:^\(pkcs11_module_path\):#\1:" \
82 wpa_supplicant.conf || die
83
84 # Change configuration to match Gentoo locations (bug #143750)
85 sed -i \
86 -e "s:/usr/lib/opensc:/usr/$(get_libdir):" \
87 -e "s:/usr/lib/pkcs11:/usr/$(get_libdir):" \
88 wpa_supplicant.conf || die
89
90 epatch "${FILESDIR}"/${P}-dbus_path_fix.patch
91 }
92
93 src_configure() {
94 # cd ${S}/${PN}
95 # Toolchain setup
96 echo "CC = $(tc-getCC)" > .config
97
98 # Basic setup
99 echo "CONFIG_CTRL_IFACE=y" >> .config
100 echo "CONFIG_BACKEND=file" >> .config
101
102 # Basic authentication methods
103 # NOTE: we don't set GPSK or SAKE as they conflict
104 # with the below options
105 echo "CONFIG_EAP_GTC=y" >> .config
106 echo "CONFIG_EAP_MD5=y" >> .config
107 echo "CONFIG_EAP_OTP=y" >> .config
108 echo "CONFIG_EAP_PAX=y" >> .config
109 echo "CONFIG_EAP_PSK=y" >> .config
110 echo "CONFIG_EAP_TLV=y" >> .config
111 echo "CONFIG_IEEE8021X_EAPOL=y" >> .config
112 echo "CONFIG_PKCS12=y" >> .config
113 echo "CONFIG_PEERKEY=y" >> .config
114 echo "CONFIG_EAP_LEAP=y" >> .config
115 echo "CONFIG_EAP_MSCHAPV2=y" >> .config
116 echo "CONFIG_EAP_PEAP=y" >> .config
117 echo "CONFIG_EAP_TLS=y" >> .config
118 echo "CONFIG_EAP_TTLS=y" >> .config
119
120 if use dbus ; then
121 echo "CONFIG_CTRL_IFACE_DBUS=y" >> .config
122 fi
123
124 if use debug ; then
125 echo "CONFIG_DEBUG_FILE=y" >> .config
126 fi
127
128 if use eap-sim ; then
129 # Smart card authentication
130 echo "CONFIG_EAP_SIM=y" >> .config
131 echo "CONFIG_EAP_AKA=y" >> .config
132 echo "CONFIG_EAP_AKA_PRIME=y" >> .config
133 echo "CONFIG_PCSC=y" >> .config
134 fi
135
136 if use fasteap ; then
137 echo "CONFIG_EAP_FAST=y" >> .config
138 fi
139
140 if use readline ; then
141 # readline/history support for wpa_cli
142 echo "CONFIG_READLINE=y" >> .config
143 fi
144
145 # SSL authentication methods
146 if use ssl ; then
147 echo "CONFIG_TLS=openssl" >> .config
148 echo "CONFIG_SMARTCARD=y" >> .config
149 elif use gnutls ; then
150 echo "CONFIG_TLS=gnutls" >> .config
151 echo "CONFIG_GNUTLS_EXTRA=y" >> .config
152 else
153 echo "CONFIG_TLS=internal" >> .config
154 fi
155
156 if use kernel_linux ; then
157 # Linux specific drivers
158 echo "CONFIG_DRIVER_ATMEL=y" >> .config
159 #echo "CONFIG_DRIVER_BROADCOM=y" >> .config
160 #echo "CONFIG_DRIVER_HERMES=y" >> .config
161 echo "CONFIG_DRIVER_HOSTAP=y" >> .config
162 echo "CONFIG_DRIVER_IPW=y" >> .config
163 echo "CONFIG_DRIVER_NDISWRAPPER=y" >> .config
164 echo "CONFIG_DRIVER_NL80211=y" >> .config
165 #echo "CONFIG_DRIVER_PRISM54=y" >> .config
166 echo "CONFIG_DRIVER_RALINK=y" >> .config
167 echo "CONFIG_DRIVER_WEXT=y" >> .config
168 echo "CONFIG_DRIVER_WIRED=y" >> .config
169
170 if use madwifi ; then
171 # Add include path for madwifi-driver headers
172 echo "CFLAGS += -I/usr/include/madwifi" >> .config
173 echo "CONFIG_DRIVER_MADWIFI=y" >> .config
174 fi
175
176 if use ps3 ; then
177 echo "CONFIG_DRIVER_PS3=y" >> .config
178 fi
179
180 elif use kernel_FreeBSD ; then
181 # FreeBSD specific driver
182 echo "CONFIG_DRIVER_BSD=y" >> .config
183 fi
184
185 # Wi-Fi Protected Setup (WPS)
186 if use wps ; then
187 echo "CONFIG_WPS=y" >> .config
188 fi
189
190 # Enable mitigation against certain attacks against TKIP
191 echo "CONFIG_DELAYED_MIC_ERROR_REPORT=y" >> .config
192 }
193
194 src_compile() {
195 # cd ${S}/${PN}
196 emake || die "emake failed"
197
198 if use qt4 ; then
199 cd "${S}"/wpa_gui-qt4
200 eqmake4 wpa_gui.pro
201 emake || die "Qt4 wpa_gui compilation failed"
202 fi
203 }
204
205 src_install() {
206
207 # cd ${S}/${PN}
208
209 dosbin wpa_supplicant || die
210 dobin wpa_cli wpa_passphrase || die
211
212 # baselayout-1 compat
213 if has_version "<sys-apps/baselayout-2.0.0"; then
214 dodir /sbin
215 dosym /usr/sbin/wpa_supplicant /sbin/wpa_supplicant || die
216 dodir /bin
217 dosym /usr/bin/wpa_cli /bin/wpa_cli || die
218 fi
219
220 exeinto /etc/wpa_supplicant/
221 newexe "${FILESDIR}"/wpa_cli.sh wpa_cli.sh
222
223 dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
224 wpa_supplicant.conf || die "dodoc failed"
225
226 if use qt4 ; then
227 into /usr
228 dobin wpa_gui-qt4/wpa_gui || die
229 fi
230
231 if use qt4 ; then
232 doicon wpa_gui-qt4/icons/wpa_gui.svg || die "Icon not found"
233 make_desktop_entry wpa_gui "WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
234 fi
235
236 if use dbus ; then
237 insinto /etc/dbus-1/system.d
238 newins dbus-wpa_supplicant.conf wpa_supplicant.conf || die
239 insinto /usr/share/dbus-1/system-services
240 newins dbus-wpa_supplicant.service 'fi.epitest.hostap.WPASupplicant.service' || die
241 keepdir /var/run/wpa_supplicant
242 fi
243 }
244
245 pkg_postinst() {
246 einfo "If this is a clean installation of wpa_supplicant, you"
247 einfo "have to create a configuration file named"
248 einfo "/etc/wpa_supplicant/wpa_supplicant.conf"
249 einfo
250 einfo "An example configuration file is available for reference in"
251 einfo "/usr/share/doc/${PF}/"
252
253 if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
254 echo
255 ewarn "WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
256 ewarn "needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
257 fi
258
259 if use madwifi ; then
260 echo
261 einfo "This package compiles against the headers installed by"
262 einfo "madwifi-old, madwifi-ng or madwifi-ng-tools."
263 einfo "You should re-emerge ${PN} after upgrading these packages."
264 fi
265 }
266
267 pkg_postinst() {
268 ewarn "You are installing a live ebuild of wpa_supplicant"
269 ewarn "Since this is a moving target, bug reports must be"
270 ewarn "reported on a regular ebuild instead."
271 }

  ViewVC Help
Powered by ViewVC 1.1.20