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

Contents of /net-wireless/wpa_supplicant/wpa_supplicant-2.3-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Feb 9 16:10:13 2015 UTC (5 years, 5 months ago) by zerochaos
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
readding keywords that were removed for review purposes of new ebuild style

(Portage version: 2.2.16/cvs/Linux x86_64, signed Manifest commit with key DD11F94A)

1 zerochaos 1.1 # Copyright 1999-2014 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 zerochaos 1.3 # $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/wpa_supplicant-2.3-r1.ebuild,v 1.2 2014/11/02 09:40:03 swift Exp $
4 zerochaos 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     #KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
16     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 swift 1.2 CDEPEND="dbus? ( sys-apps/dbus )
20 zerochaos 1.1 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
34     )
35     ssl? ( dev-libs/openssl )
36     !ssl? ( gnutls? ( net-libs/gnutls ) )
37     !ssl? ( !gnutls? ( dev-libs/libtommath ) )
38 swift 1.2 "
39     DEPEND="${CDEPEND}
40     virtual/pkgconfig
41     "
42     RDEPEND="${CDEPEND}
43     selinux? ( sec-policy/selinux-networkmanager )
44     "
45 zerochaos 1.1
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     epatch "${FILESDIR}/${P}-fix-undefined-reference-to-random_get_bytes.patch"
105    
106     # multilib-strict fix (bug #373685)
107     sed -e "s/\/usr\/lib/\/usr\/$(get_libdir)/" -i src/eap_peer/Makefile
108     fi
109    
110     # bug (320097)
111     epatch "${FILESDIR}/${P}-do-not-call-dbus-functions-with-NULL-path.patch"
112    
113     # TODO - NEED TESTING TO SEE IF STILL NEEDED, NOT COMPATIBLE WITH 1.0 OUT OF THE BOX,
114     # SO WOULD BE NICE TO JUST DROP IT, IF IT IS NOT NEEDED.
115     # bug (374089)
116     #epatch "${FILESDIR}/${P}-dbus-WPAIE-fix.patch"
117     }
118    
119     src_configure() {
120     # Toolchain setup
121     tc-export CC
122    
123     cp defconfig .config
124    
125     # Basic setup
126     Kconfig_style_config CTRL_IFACE
127     Kconfig_style_config BACKEND file
128     Kconfig_style_config IBSS_RSN
129     Kconfig_style_config IEEE80211W
130     Kconfig_style_config IEEE80211R
131    
132     # Basic authentication methods
133     # NOTE: we don't set GPSK or SAKE as they conflict
134     # with the below options
135     Kconfig_style_config EAP_GTC
136     Kconfig_style_config EAP_MD5
137     Kconfig_style_config EAP_OTP
138     Kconfig_style_config EAP_PAX
139     Kconfig_style_config EAP_PSK
140     Kconfig_style_config EAP_TLV
141     Kconfig_style_config EAP_EXE
142     Kconfig_style_config IEEE8021X_EAPOL
143     Kconfig_style_config PKCS12
144     Kconfig_style_config PEERKEY
145     Kconfig_style_config EAP_LEAP
146     Kconfig_style_config EAP_MSCHAPV2
147     Kconfig_style_config EAP_PEAP
148     Kconfig_style_config EAP_TLS
149     Kconfig_style_config EAP_TTLS
150    
151     # Enabling background scanning.
152     Kconfig_style_config BGSCAN_SIMPLE
153     Kconfig_style_config BGSCAN_LEARN
154    
155     if use dbus ; then
156     Kconfig_style_config CTRL_IFACE_DBUS
157     Kconfig_style_config CTRL_IFACE_DBUS_NEW
158     Kconfig_style_config CTRL_IFACE_DBUS_INTRO
159     fi
160    
161     # Enable support for writing debug info to a log file.
162     Kconfig_style_config DEBUG_FILE
163    
164     if use hs2.0 ; then
165     Kconfig_style_config INTERWORKING
166     Kconfig_style_config HS20
167     fi
168    
169     if use uncommon-eap-types; then
170     Kconfig_style_config EAP_GPSK
171     Kconfig_style_config EAP_SAKE
172     Kconfig_style_config EAP_GPSK_SHA256
173     Kconfig_style_config EAP_IKEV2
174     Kconfig_style_config EAP_EKE
175     fi
176    
177     if use eap-sim ; then
178     # Smart card authentication
179     Kconfig_style_config EAP_SIM
180     Kconfig_style_config EAP_AKA
181     Kconfig_style_config EAP_AKA_PRIME
182     Kconfig_style_config PCSC
183     fi
184    
185     if use fasteap ; then
186     Kconfig_style_config EAP_FAST
187     fi
188    
189     if use readline ; then
190     # readline/history support for wpa_cli
191     Kconfig_style_config READLINE
192     else
193     #internal line edit mode for wpa_cli
194     Kconfig_style_config WPA_CLI_EDIT
195     fi
196    
197     # SSL authentication methods
198     if use ssl ; then
199     Kconfig_style_config TLS openssl
200     elif use gnutls ; then
201     Kconfig_style_config TLS gnutls
202     Kconfig_style_config GNUTLS_EXTRA
203     else
204     Kconfig_style_config TLS internal
205     fi
206    
207     if use smartcard ; then
208     Kconfig_style_config SMARTCARD
209     fi
210    
211     if use tdls ; then
212     Kconfig_style_config TDLS
213     fi
214    
215     if use kernel_linux ; then
216     # Linux specific drivers
217     Kconfig_style_config DRIVER_ATMEL
218     Kconfig_style_config DRIVER_HOSTAP
219     Kconfig_style_config DRIVER_IPW
220     Kconfig_style_config DRIVER_NL80211
221     Kconfig_style_config DRIVER_RALINK
222     Kconfig_style_config DRIVER_WEXT
223     Kconfig_style_config DRIVER_WIRED
224    
225     if use ps3 ; then
226     Kconfig_style_config DRIVER_PS3
227     fi
228    
229     elif use kernel_FreeBSD ; then
230     # FreeBSD specific driver
231     Kconfig_style_config DRIVER_BSD
232     fi
233    
234     # Wi-Fi Protected Setup (WPS)
235     if use wps ; then
236     Kconfig_style_config WPS
237     Kconfig_style_config WPS2
238     # USB Flash Drive
239     Kconfig_style_config WPS_UFD
240     # External Registrar
241     Kconfig_style_config WPS_ER
242     # Universal Plug'n'Play
243     Kconfig_style_config WPS_UPNP
244     # Near Field Communication
245     Kconfig_style_config WPS_NFC
246     fi
247    
248     # Wi-Fi Direct (WiDi)
249     if use p2p ; then
250     Kconfig_style_config P2P
251     Kconfig_style_config WIFI_DISPLAY
252     fi
253    
254     # Access Point Mode
255     if use ap ; then
256     Kconfig_style_config AP
257     fi
258    
259     # Enable mitigation against certain attacks against TKIP
260     Kconfig_style_config DELAYED_MIC_ERROR_REPORT
261    
262     # If we are using libnl 2.0 and above, enable support for it
263     # Bug 382159
264     # Removed for now, since the 3.2 version is broken, and we don't
265     # support it.
266     if has_version ">=dev-libs/libnl-3.2"; then
267     Kconfig_style_config LIBNL32
268     fi
269    
270     if use qt4 ; then
271     pushd "${S}"/wpa_gui-qt4 > /dev/null
272     eqmake4 wpa_gui.pro
273     popd > /dev/null
274     fi
275     }
276    
277     src_compile() {
278     einfo "Building wpa_supplicant"
279     emake V=1 BINDIR=/usr/sbin
280    
281     if use wimax; then
282     emake -C ../src/eap_peer clean
283     emake -C ../src/eap_peer
284     fi
285    
286     if use qt4 ; then
287     pushd "${S}"/wpa_gui-qt4 > /dev/null
288     einfo "Building wpa_gui"
289     emake
290     popd > /dev/null
291     fi
292     }
293    
294     src_install() {
295     dosbin wpa_supplicant
296     dobin wpa_cli wpa_passphrase
297    
298     # baselayout-1 compat
299     if has_version "<sys-apps/baselayout-2.0.0"; then
300     dodir /sbin
301     dosym /usr/sbin/wpa_supplicant /sbin/wpa_supplicant
302     dodir /bin
303     dosym /usr/bin/wpa_cli /bin/wpa_cli
304     fi
305    
306     if has_version ">=sys-apps/openrc-0.5.0"; then
307     newinitd "${FILESDIR}/${PN}-init.d" wpa_supplicant
308     newconfd "${FILESDIR}/${PN}-conf.d" wpa_supplicant
309     fi
310    
311     exeinto /etc/wpa_supplicant/
312     newexe "${FILESDIR}/wpa_cli.sh" wpa_cli.sh
313    
314     dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
315     wpa_supplicant.conf
316    
317     newdoc .config build-config
318    
319     doman doc/docbook/*.{5,8}
320    
321     if use qt4 ; then
322     into /usr
323     dobin wpa_gui-qt4/wpa_gui
324     doicon wpa_gui-qt4/icons/wpa_gui.svg
325     make_desktop_entry wpa_gui "WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
326     fi
327    
328     use wimax && emake DESTDIR="${D}" -C ../src/eap_peer install
329    
330     if use dbus ; then
331     pushd "${S}"/dbus > /dev/null
332     insinto /etc/dbus-1/system.d
333     newins dbus-wpa_supplicant.conf wpa_supplicant.conf
334     insinto /usr/share/dbus-1/system-services
335     doins fi.epitest.hostap.WPASupplicant.service fi.w1.wpa_supplicant1.service
336     popd > /dev/null
337     fi
338    
339     # systemd stuff
340     systemd_dounit systemd/*.service
341     }
342    
343     pkg_postinst() {
344     elog "If this is a clean installation of wpa_supplicant, you"
345     elog "have to create a configuration file named"
346     elog "/etc/wpa_supplicant/wpa_supplicant.conf"
347     elog
348     elog "An example configuration file is available for reference in"
349     elog "/usr/share/doc/${PF}/"
350    
351     if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
352     echo
353     ewarn "WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
354     ewarn "needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
355     fi
356    
357     # Mea culpa, feel free to remove that after some time --mgorny.
358     local fn
359     for fn in wpa_supplicant{,@wlan0}.service; do
360     if [[ -e "${ROOT}"/etc/systemd/system/network.target.wants/${fn} ]]
361     then
362     ebegin "Moving ${fn} to multi-user.target"
363     mv "${ROOT}"/etc/systemd/system/network.target.wants/${fn} \
364     "${ROOT}"/etc/systemd/system/multi-user.target.wants/
365     eend ${?} \
366     "Please try to re-enable ${fn}"
367     fi
368     done
369     }

  ViewVC Help
Powered by ViewVC 1.1.20