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

Contents of /net-wireless/wpa_supplicant/wpa_supplicant-2.4-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Thu May 28 08:10:04 2015 UTC (5 years, 2 months ago) by gurligebis
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +2 -2 lines
x86 stable wrt bug #548742, and removing old version

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 15AE484C)

1 gurligebis 1.1 # Copyright 1999-2015 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 gurligebis 1.6 # $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/wpa_supplicant-2.4-r3.ebuild,v 1.5 2015/05/27 12:31:56 zlogene Exp $
4 gurligebis 1.1
5     EAPI=5
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 gurligebis 1.6 KEYWORDS="~alpha amd64 arm ~arm64 ~ia64 ~mips ppc ppc64 ~sparc x86 ~x86-fbsd"
16 gurligebis 1.1 IUSE="ap dbus gnutls eap-sim fasteap +hs2-0 p2p ps3 qt4 readline selinux smartcard ssl tdls uncommon-eap-types wimax wps kernel_linux kernel_FreeBSD"
17     REQUIRED_USE="fasteap? ( !gnutls !ssl ) smartcard? ( ssl )"
18    
19     CDEPEND="dbus? ( sys-apps/dbus )
20     kernel_linux? (
21     eap-sim? ( sys-apps/pcsc-lite )
22     dev-libs/libnl:3
23     net-wireless/crda
24     )
25     !kernel_linux? ( net-libs/libpcap )
26     qt4? (
27     dev-qt/qtcore:4
28     dev-qt/qtgui:4
29     dev-qt/qtsvg:4
30     )
31     readline? (
32     sys-libs/ncurses
33     sys-libs/readline:0
34     )
35     ssl? ( dev-libs/openssl:0 )
36     !ssl? ( gnutls? ( net-libs/gnutls ) )
37     !ssl? ( !gnutls? ( dev-libs/libtommath ) )
38     "
39     DEPEND="${CDEPEND}
40     virtual/pkgconfig
41     "
42     RDEPEND="${CDEPEND}
43     selinux? ( sec-policy/selinux-networkmanager )
44     "
45    
46     S="${WORKDIR}/${P}/${PN}"
47    
48     Kconfig_style_config() {
49     #param 1 is CONFIG_* item
50     #param 2 is what to set it = to, defaulting in y
51     CONFIG_PARAM="${CONFIG_HEADER:-CONFIG_}$1"
52     setting="${2:-y}"
53    
54     if [ ! $setting = n ]; then
55     #first remove any leading "# " if $2 is not n
56     sed -i "/^# *$CONFIG_PARAM=/s/^# *//" .config || echo "Kconfig_style_config error uncommenting $CONFIG_PARAM"
57     #set item = $setting (defaulting to y)
58     sed -i "/^$CONFIG_PARAM/s/=.*/=$setting/" .config || echo "Kconfig_style_config error setting $CONFIG_PARAM=$setting"
59     else
60     #ensure item commented out
61     sed -i "/^$CONFIG_PARAM/s/$CONFIG_PARAM/# $CONFIG_PARAM/" .config || echo "Kconfig_style_config error commenting $CONFIG_PARAM"
62     fi
63     }
64    
65     pkg_setup() {
66     if use gnutls && use ssl ; then
67     elog "You have both 'gnutls' and 'ssl' USE flags enabled: defaulting to USE=\"ssl\""
68     fi
69     }
70    
71     src_prepare() {
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     if use dbus; then
91     epatch "${FILESDIR}/${P}-dbus-path-fix.patch"
92     fi
93    
94     # systemd entries to D-Bus service files (bug #372877)
95     echo 'SystemdService=wpa_supplicant.service' \
96     | tee -a dbus/*.service >/dev/null || die
97    
98     cd "${WORKDIR}/${P}"
99    
100     if use wimax; then
101     # generate-libeap-peer.patch comes before
102     # fix-undefined-reference-to-random_get_bytes.patch
103     epatch "${FILESDIR}/${P}-generate-libeap-peer.patch"
104    
105     # multilib-strict fix (bug #373685)
106     sed -e "s/\/usr\/lib/\/usr\/$(get_libdir)/" -i src/eap_peer/Makefile
107     fi
108    
109     # bug (548742)
110     epatch "${FILESDIR}/2015-1/0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch"
111     epatch "${FILESDIR}/2015-2/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch"
112     epatch "${FILESDIR}/2015-3/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch"
113     epatch "${FILESDIR}/2015-4/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch"
114     epatch "${FILESDIR}/2015-4/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch"
115     epatch "${FILESDIR}/2015-4/0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch"
116     epatch "${FILESDIR}/2015-4/0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch"
117     epatch "${FILESDIR}/2015-4/0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch"
118    
119     # bug (320097)
120     epatch "${FILESDIR}/${P}-do-not-call-dbus-functions-with-NULL-path.patch"
121    
122     # TODO - NEED TESTING TO SEE IF STILL NEEDED, NOT COMPATIBLE WITH 1.0 OUT OF THE BOX,
123     # SO WOULD BE NICE TO JUST DROP IT, IF IT IS NOT NEEDED.
124     # bug (374089)
125     #epatch "${FILESDIR}/${P}-dbus-WPAIE-fix.patch"
126     }
127    
128     src_configure() {
129     # Toolchain setup
130     tc-export CC
131    
132     cp defconfig .config
133    
134     # Basic setup
135     Kconfig_style_config CTRL_IFACE
136     Kconfig_style_config BACKEND file
137     Kconfig_style_config IBSS_RSN
138     Kconfig_style_config IEEE80211W
139     Kconfig_style_config IEEE80211R
140    
141     # Basic authentication methods
142     # NOTE: we don't set GPSK or SAKE as they conflict
143     # with the below options
144     Kconfig_style_config EAP_GTC
145     Kconfig_style_config EAP_MD5
146     Kconfig_style_config EAP_OTP
147     Kconfig_style_config EAP_PAX
148     Kconfig_style_config EAP_PSK
149     Kconfig_style_config EAP_TLV
150     Kconfig_style_config EAP_EXE
151     Kconfig_style_config IEEE8021X_EAPOL
152     Kconfig_style_config PKCS12
153     Kconfig_style_config PEERKEY
154     Kconfig_style_config EAP_LEAP
155     Kconfig_style_config EAP_MSCHAPV2
156     Kconfig_style_config EAP_PEAP
157     Kconfig_style_config EAP_TLS
158     Kconfig_style_config EAP_TTLS
159    
160     # Enabling background scanning.
161     Kconfig_style_config BGSCAN_SIMPLE
162     Kconfig_style_config BGSCAN_LEARN
163    
164     if use dbus ; then
165     Kconfig_style_config CTRL_IFACE_DBUS
166     Kconfig_style_config CTRL_IFACE_DBUS_NEW
167     Kconfig_style_config CTRL_IFACE_DBUS_INTRO
168     fi
169    
170     # Enable support for writing debug info to a log file and syslog.
171     Kconfig_style_config DEBUG_FILE
172     Kconfig_style_config DEBUG_SYSLOG
173    
174     if use hs2-0 ; then
175     Kconfig_style_config INTERWORKING
176     Kconfig_style_config HS20
177     fi
178    
179     if use uncommon-eap-types; then
180     Kconfig_style_config EAP_GPSK
181     Kconfig_style_config EAP_SAKE
182     Kconfig_style_config EAP_GPSK_SHA256
183     Kconfig_style_config EAP_IKEV2
184     Kconfig_style_config EAP_EKE
185     fi
186    
187     if use eap-sim ; then
188     # Smart card authentication
189     Kconfig_style_config EAP_SIM
190     Kconfig_style_config EAP_AKA
191     Kconfig_style_config EAP_AKA_PRIME
192     Kconfig_style_config PCSC
193     fi
194    
195     if use fasteap ; then
196     Kconfig_style_config EAP_FAST
197     fi
198    
199     if use readline ; then
200     # readline/history support for wpa_cli
201     Kconfig_style_config READLINE
202     else
203     #internal line edit mode for wpa_cli
204     Kconfig_style_config WPA_CLI_EDIT
205     fi
206    
207     # SSL authentication methods
208     if use ssl ; then
209     Kconfig_style_config TLS openssl
210     elif use gnutls ; then
211     Kconfig_style_config TLS gnutls
212     Kconfig_style_config GNUTLS_EXTRA
213     else
214     Kconfig_style_config TLS internal
215     fi
216    
217     if use smartcard ; then
218     Kconfig_style_config SMARTCARD
219     fi
220    
221     if use tdls ; then
222     Kconfig_style_config TDLS
223     fi
224    
225     if use kernel_linux ; then
226     # Linux specific drivers
227     Kconfig_style_config DRIVER_ATMEL
228     Kconfig_style_config DRIVER_HOSTAP
229     Kconfig_style_config DRIVER_IPW
230     Kconfig_style_config DRIVER_NL80211
231     Kconfig_style_config DRIVER_RALINK
232     Kconfig_style_config DRIVER_WEXT
233     Kconfig_style_config DRIVER_WIRED
234    
235     if use ps3 ; then
236     Kconfig_style_config DRIVER_PS3
237     fi
238    
239     elif use kernel_FreeBSD ; then
240     # FreeBSD specific driver
241     Kconfig_style_config DRIVER_BSD
242     fi
243    
244     # Wi-Fi Protected Setup (WPS)
245     if use wps ; then
246     Kconfig_style_config WPS
247     Kconfig_style_config WPS2
248     # USB Flash Drive
249     Kconfig_style_config WPS_UFD
250     # External Registrar
251     Kconfig_style_config WPS_ER
252     # Universal Plug'n'Play
253     Kconfig_style_config WPS_UPNP
254     # Near Field Communication
255     Kconfig_style_config WPS_NFC
256     fi
257    
258     # Wi-Fi Direct (WiDi)
259     if use p2p ; then
260     Kconfig_style_config P2P
261     Kconfig_style_config WIFI_DISPLAY
262     fi
263    
264     # Access Point Mode
265     if use ap ; then
266     Kconfig_style_config AP
267     fi
268    
269     # Enable mitigation against certain attacks against TKIP
270     Kconfig_style_config DELAYED_MIC_ERROR_REPORT
271    
272     # If we are using libnl 2.0 and above, enable support for it
273     # Bug 382159
274     # Removed for now, since the 3.2 version is broken, and we don't
275     # support it.
276     if has_version ">=dev-libs/libnl-3.2"; then
277     Kconfig_style_config LIBNL32
278     fi
279    
280     if use qt4 ; then
281     pushd "${S}"/wpa_gui-qt4 > /dev/null
282     eqmake4 wpa_gui.pro
283     popd > /dev/null
284     fi
285     }
286    
287     src_compile() {
288     einfo "Building wpa_supplicant"
289     emake V=1 BINDIR=/usr/sbin
290    
291     if use wimax; then
292     emake -C ../src/eap_peer clean
293     emake -C ../src/eap_peer
294     fi
295    
296     if use qt4 ; then
297     pushd "${S}"/wpa_gui-qt4 > /dev/null
298     einfo "Building wpa_gui"
299     emake
300     popd > /dev/null
301     fi
302     }
303    
304     src_install() {
305     dosbin wpa_supplicant
306     dobin wpa_cli wpa_passphrase
307    
308     # baselayout-1 compat
309     if has_version "<sys-apps/baselayout-2.0.0"; then
310     dodir /sbin
311     dosym /usr/sbin/wpa_supplicant /sbin/wpa_supplicant
312     dodir /bin
313     dosym /usr/bin/wpa_cli /bin/wpa_cli
314     fi
315    
316     if has_version ">=sys-apps/openrc-0.5.0"; then
317     newinitd "${FILESDIR}/${PN}-init.d" wpa_supplicant
318     newconfd "${FILESDIR}/${PN}-conf.d" wpa_supplicant
319     fi
320    
321     exeinto /etc/wpa_supplicant/
322     newexe "${FILESDIR}/wpa_cli.sh" wpa_cli.sh
323    
324     dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
325     wpa_supplicant.conf
326    
327     newdoc .config build-config
328    
329     doman doc/docbook/*.{5,8}
330    
331     if use qt4 ; then
332     into /usr
333     dobin wpa_gui-qt4/wpa_gui
334     doicon wpa_gui-qt4/icons/wpa_gui.svg
335     make_desktop_entry wpa_gui "WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
336     fi
337    
338     use wimax && emake DESTDIR="${D}" -C ../src/eap_peer install
339    
340     if use dbus ; then
341     pushd "${S}"/dbus > /dev/null
342     insinto /etc/dbus-1/system.d
343     newins dbus-wpa_supplicant.conf wpa_supplicant.conf
344     insinto /usr/share/dbus-1/system-services
345     doins fi.epitest.hostap.WPASupplicant.service fi.w1.wpa_supplicant1.service
346     popd > /dev/null
347    
348     # This unit relies on dbus support, bug 538600.
349     systemd_dounit systemd/wpa_supplicant.service
350     fi
351    
352     systemd_dounit "systemd/wpa_supplicant@.service"
353     systemd_dounit "systemd/wpa_supplicant-nl80211@.service"
354     systemd_dounit "systemd/wpa_supplicant-wired@.service"
355     }
356    
357     pkg_postinst() {
358     elog "If this is a clean installation of wpa_supplicant, you"
359     elog "have to create a configuration file named"
360     elog "/etc/wpa_supplicant/wpa_supplicant.conf"
361     elog
362     elog "An example configuration file is available for reference in"
363     elog "/usr/share/doc/${PF}/"
364    
365     if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
366     echo
367     ewarn "WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
368     ewarn "needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
369     fi
370    
371     # Mea culpa, feel free to remove that after some time --mgorny.
372     local fn
373     for fn in wpa_supplicant{,@wlan0}.service; do
374     if [[ -e "${ROOT}"/etc/systemd/system/network.target.wants/${fn} ]]
375     then
376     ebegin "Moving ${fn} to multi-user.target"
377     mv "${ROOT}"/etc/systemd/system/network.target.wants/${fn} \
378     "${ROOT}"/etc/systemd/system/multi-user.target.wants/
379     eend ${?} \
380     "Please try to re-enable ${fn}"
381     fi
382     done
383     }

  ViewVC Help
Powered by ViewVC 1.1.20