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

Contents of /net-wireless/wpa_supplicant/wpa_supplicant-0.7.3-r5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (show annotations) (download)
Sat Mar 2 23:13:01 2013 UTC (7 years, 5 months ago) by hwoarang
Branch: MAIN
Changes since 1.18: +4 -4 lines
Move Qt dependencies to the new category

(Portage version: 2.1.11.52/cvs/Linux x86_64, signed Manifest commit with key C2BA7F3C!)

1 # Copyright 1999-2013 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-0.7.3-r5.ebuild,v 1.18 2012/05/22 07:17:10 gurligebis Exp $
4
5 EAPI=4
6
7 inherit eutils toolchain-funcs qt4-r2 systemd multilib
8
9 DESCRIPTION="IEEE 802.1X/WPA supplicant for secure wireless transfers"
10 HOMEPAGE="http://hostap.epitest.fi/wpa_supplicant/"
11 SRC_URI="http://hostap.epitest.fi/releases/${P}.tar.gz"
12 LICENSE="|| ( GPL-2 BSD )"
13
14 SLOT="0"
15 KEYWORDS="amd64 arm ~mips ppc ppc64 x86 ~x86-fbsd"
16 IUSE="dbus debug gnutls eap-sim fasteap madwifi ps3 qt4 readline selinux ssl wimax wps kernel_linux kernel_FreeBSD"
17
18 RDEPEND="dbus? ( sys-apps/dbus )
19 kernel_linux? (
20 eap-sim? ( sys-apps/pcsc-lite )
21 madwifi? ( >net-wireless/madwifi-ng-tools-0.9.3 )
22 dev-libs/libnl:1.1
23 )
24 !kernel_linux? ( net-libs/libpcap )
25 qt4? (
26 dev-qt/qtgui:4
27 dev-qt/qtsvg:4
28 )
29 readline? (
30 sys-libs/ncurses
31 sys-libs/readline
32 )
33 ssl? ( dev-libs/openssl )
34 !ssl? ( gnutls? ( net-libs/gnutls ) )
35 !ssl? ( !gnutls? ( dev-libs/libtommath ) )
36 selinux? ( sec-policy/selinux-networkmanager )"
37 DEPEND="${RDEPEND}
38 virtual/pkgconfig"
39
40 S="${WORKDIR}/${P}/${PN}"
41
42 pkg_setup() {
43 if use fasteap && (use gnutls || use ssl) ; then
44 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"
45 fi
46
47 if use gnutls && use ssl ; then
48 einfo "You have both 'gnutls' and 'ssl' USE flags enabled: defaulting to USE=\"ssl\""
49 fi
50 }
51
52 src_prepare() {
53 # net/bpf.h needed for net-libs/libpcap on Gentoo/FreeBSD
54 sed -i \
55 -e "s:\(#include <pcap\.h>\):#include <net/bpf.h>\n\1:" \
56 ../src/l2_packet/l2_packet_freebsd.c || die
57
58 # People seem to take the example configuration file too literally (bug #102361)
59 sed -i \
60 -e "s:^\(opensc_engine_path\):#\1:" \
61 -e "s:^\(pkcs11_engine_path\):#\1:" \
62 -e "s:^\(pkcs11_module_path\):#\1:" \
63 wpa_supplicant.conf || die
64
65 # Change configuration to match Gentoo locations (bug #143750)
66 sed -i \
67 -e "s:/usr/lib/opensc:/usr/$(get_libdir):" \
68 -e "s:/usr/lib/pkcs11:/usr/$(get_libdir):" \
69 wpa_supplicant.conf || die
70
71 epatch "${FILESDIR}/${P}-dbus_path_fix.patch"
72
73 # systemd entries to D-Bus service files (bug #372877)
74 echo 'SystemdService=wpa_supplicant.service' \
75 | tee -a dbus/*.service >/dev/null || die
76
77 if use wimax; then
78 cd "${WORKDIR}/${P}"
79 epatch "${FILESDIR}/${P}-generate-libeap-peer.patch"
80
81 # multilib-strict fix (bug #373685)
82 sed -e "s/\/usr\/lib/\/usr\/$(get_libdir)/" -i src/eap_peer/Makefile
83 fi
84
85 # bug (320097)
86 epatch "${FILESDIR}/do-not-call-dbus-functions-with-NULL-path.patch"
87 # https://bugzilla.gnome.org/show_bug.cgi?id=644634
88 epatch "${FILESDIR}/${P}-dbus-api-changes.patch"
89 # bug (374089)
90 epatch "${FILESDIR}/${P}-dbus-WPAIE-fix.patch"
91 # bug (409285)
92 epatch "${FILESDIR}/wpa_supplicant-gcc470.patch"
93 }
94
95 src_configure() {
96 # Toolchain setup
97 tc-export CC
98
99 # Basic setup
100 echo "CONFIG_CTRL_IFACE=y" >> .config
101 echo "CONFIG_BACKEND=file" >> .config
102
103 # Basic authentication methods
104 # NOTE: we don't set GPSK or SAKE as they conflict
105 # with the below options
106 echo "CONFIG_EAP_GTC=y" >> .config
107 echo "CONFIG_EAP_MD5=y" >> .config
108 echo "CONFIG_EAP_OTP=y" >> .config
109 echo "CONFIG_EAP_PAX=y" >> .config
110 echo "CONFIG_EAP_PSK=y" >> .config
111 echo "CONFIG_EAP_TLV=y" >> .config
112 echo "CONFIG_IEEE8021X_EAPOL=y" >> .config
113 echo "CONFIG_PKCS12=y" >> .config
114 echo "CONFIG_PEERKEY=y" >> .config
115 echo "CONFIG_EAP_LEAP=y" >> .config
116 echo "CONFIG_EAP_MSCHAPV2=y" >> .config
117 echo "CONFIG_EAP_PEAP=y" >> .config
118 echo "CONFIG_EAP_TLS=y" >> .config
119 echo "CONFIG_EAP_TTLS=y" >> .config
120
121 if use dbus ; then
122 echo "CONFIG_CTRL_IFACE_DBUS=y" >> .config
123 echo "CONFIG_CTRL_IFACE_DBUS_NEW=y" >> .config
124 echo "CONFIG_CTRL_IFACE_DBUS_INTRO=y" >> .config
125 fi
126
127 if use debug ; then
128 echo "CONFIG_DEBUG_FILE=y" >> .config
129 fi
130
131 if use eap-sim ; then
132 # Smart card authentication
133 echo "CONFIG_EAP_SIM=y" >> .config
134 echo "CONFIG_EAP_AKA=y" >> .config
135 echo "CONFIG_EAP_AKA_PRIME=y" >> .config
136 echo "CONFIG_PCSC=y" >> .config
137 fi
138
139 if use fasteap ; then
140 echo "CONFIG_EAP_FAST=y" >> .config
141 fi
142
143 if use readline ; then
144 # readline/history support for wpa_cli
145 echo "CONFIG_READLINE=y" >> .config
146 fi
147
148 # SSL authentication methods
149 if use ssl ; then
150 echo "CONFIG_TLS=openssl" >> .config
151 echo "CONFIG_SMARTCARD=y" >> .config
152 elif use gnutls ; then
153 echo "CONFIG_TLS=gnutls" >> .config
154 echo "CONFIG_GNUTLS_EXTRA=y" >> .config
155 else
156 echo "CONFIG_TLS=internal" >> .config
157 fi
158
159 if use kernel_linux ; then
160 # Linux specific drivers
161 echo "CONFIG_DRIVER_ATMEL=y" >> .config
162 #echo "CONFIG_DRIVER_BROADCOM=y" >> .config
163 #echo "CONFIG_DRIVER_HERMES=y" >> .config
164 echo "CONFIG_DRIVER_HOSTAP=y" >> .config
165 echo "CONFIG_DRIVER_IPW=y" >> .config
166 echo "CONFIG_DRIVER_NDISWRAPPER=y" >> .config
167 echo "CONFIG_DRIVER_NL80211=y" >> .config
168 #echo "CONFIG_DRIVER_PRISM54=y" >> .config
169 echo "CONFIG_DRIVER_RALINK=y" >> .config
170 echo "CONFIG_DRIVER_WEXT=y" >> .config
171 echo "CONFIG_DRIVER_WIRED=y" >> .config
172
173 if use madwifi ; then
174 # Add include path for madwifi-driver headers
175 echo "CFLAGS += -I/usr/include/madwifi" >> .config
176 echo "CONFIG_DRIVER_MADWIFI=y" >> .config
177 fi
178
179 if use ps3 ; then
180 echo "CONFIG_DRIVER_PS3=y" >> .config
181 fi
182
183 elif use kernel_FreeBSD ; then
184 # FreeBSD specific driver
185 echo "CONFIG_DRIVER_BSD=y" >> .config
186 fi
187
188 # Wi-Fi Protected Setup (WPS)
189 if use wps ; then
190 echo "CONFIG_WPS=y" >> .config
191 fi
192
193 # Enable mitigation against certain attacks against TKIP
194 echo "CONFIG_DELAYED_MIC_ERROR_REPORT=y" >> .config
195
196 # If we are using libnl 2.0 and above, enable support for it
197 # Bug 382159
198 # Removed for now, since the 3.2 version is broken, and we don't
199 # support it.
200 #if has_version ">=dev-libs/libnl-2.0"; then
201 # echo "CONFIG_LIBNL20=y" >> .config
202 #fi
203
204 if use qt4 ; then
205 pushd "${S}"/wpa_gui-qt4 > /dev/null
206 eqmake4 wpa_gui.pro
207 popd > /dev/null
208 fi
209 }
210
211 src_compile() {
212 einfo "Building wpa_supplicant"
213 emake
214
215 if use wimax; then
216 emake -C ../src/eap_peer clean
217 emake -C ../src/eap_peer
218 fi
219
220 if use qt4 ; then
221 pushd "${S}"/wpa_gui-qt4 > /dev/null
222 einfo "Building wpa_gui"
223 emake
224 popd > /dev/null
225 fi
226 }
227
228 src_install() {
229 dosbin wpa_supplicant
230 dobin wpa_cli wpa_passphrase
231
232 # baselayout-1 compat
233 if has_version "<sys-apps/baselayout-2.0.0"; then
234 dodir /sbin
235 dosym /usr/sbin/wpa_supplicant /sbin/wpa_supplicant
236 dodir /bin
237 dosym /usr/bin/wpa_cli /bin/wpa_cli
238 fi
239
240 if has_version ">=sys-apps/openrc-0.5.0"; then
241 newinitd "${FILESDIR}/${PN}-init.d" wpa_supplicant
242 newconfd "${FILESDIR}/${PN}-conf.d" wpa_supplicant
243 fi
244
245 exeinto /etc/wpa_supplicant/
246 newexe "${FILESDIR}/wpa_cli.sh" wpa_cli.sh
247
248 dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
249 wpa_supplicant.conf
250
251 doman doc/docbook/*.{5,8}
252
253 if use qt4 ; then
254 into /usr
255 dobin wpa_gui-qt4/wpa_gui
256 doicon wpa_gui-qt4/icons/wpa_gui.svg
257 make_desktop_entry wpa_gui "WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
258 fi
259
260 use wimax && emake DESTDIR="${D}" -C ../src/eap_peer install
261
262 if use dbus ; then
263 pushd "${S}"/dbus > /dev/null
264 insinto /etc/dbus-1/system.d
265 newins dbus-wpa_supplicant.conf wpa_supplicant.conf
266 insinto /usr/share/dbus-1/system-services
267 doins fi.epitest.hostap.WPASupplicant.service fi.w1.wpa_supplicant1.service
268 keepdir /var/run/wpa_supplicant
269 popd > /dev/null
270 fi
271
272 # systemd stuff
273 systemd_dounit "${FILESDIR}"/wpa_supplicant.service
274 systemd_newunit "${FILESDIR}"/wpa_supplicant_at.service 'wpa_supplicant@.service'
275 }
276
277 pkg_postinst() {
278 einfo "If this is a clean installation of wpa_supplicant, you"
279 einfo "have to create a configuration file named"
280 einfo "/etc/wpa_supplicant/wpa_supplicant.conf"
281 einfo
282 einfo "An example configuration file is available for reference in"
283 einfo "/usr/share/doc/${PF}/"
284
285 if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
286 echo
287 ewarn "WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
288 ewarn "needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
289 fi
290
291 if use madwifi ; then
292 echo
293 einfo "This package compiles against the headers installed by"
294 einfo "madwifi-old, madwifi-ng or madwifi-ng-tools."
295 einfo "You should re-emerge ${PN} after upgrading these packages."
296 fi
297
298 # Mea culpa, feel free to remove that after some time --mgorny.
299 local fn
300 for fn in wpa_supplicant{,@wlan0}.service; do
301 if [[ -e "${ROOT}"/etc/systemd/system/network.target.wants/${fn} ]]
302 then
303 ebegin "Moving ${fn} to multi-user.target"
304 mv "${ROOT}"/etc/systemd/system/network.target.wants/${fn} \
305 "${ROOT}"/etc/systemd/system/multi-user.target.wants/
306 eend ${?} \
307 "Please try to re-enable ${fn}"
308 fi
309 done
310 }

  ViewVC Help
Powered by ViewVC 1.1.20