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

Contents of /net-wireless/wpa_supplicant/wpa_supplicant-2.0-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Tue Apr 28 08:06:27 2015 UTC (5 years, 3 months ago) by zlogene
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Drop unsecure versions

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 0xC42EB5D6)

1 gurligebis 1.1 # Copyright 1999-2013 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 zlogene 1.7 # $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/wpa_supplicant-2.0-r2.ebuild,v 1.6 2013/12/22 12:03:58 ago Exp $
4 gurligebis 1.1
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 ago 1.6 KEYWORDS="~alpha amd64 arm ~ia64 ~mips ppc ppc64 ~sparc x86 ~x86-fbsd"
16 gurligebis 1.1 IUSE="ap dbus gnutls eap-sim fasteap p2p ps3 qt4 readline selinux smartcard ssl wimax wps kernel_linux kernel_FreeBSD"
17     REQUIRED_USE="fasteap? ( !gnutls !ssl ) smartcard? ( ssl )"
18    
19     RDEPEND="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/qtgui:4
28     dev-qt/qtsvg:4
29     )
30     readline? (
31     sys-libs/ncurses
32     sys-libs/readline
33     )
34     ssl? ( dev-libs/openssl )
35     !ssl? ( gnutls? ( net-libs/gnutls ) )
36     !ssl? ( !gnutls? ( dev-libs/libtommath ) )
37     selinux? ( sec-policy/selinux-networkmanager )"
38     DEPEND="${RDEPEND}
39     virtual/pkgconfig"
40    
41     S="${WORKDIR}/${P}/${PN}"
42    
43     pkg_setup() {
44     if use gnutls && use ssl ; then
45     elog "You have both 'gnutls' and 'ssl' USE flags enabled: defaulting to USE=\"ssl\""
46     fi
47     }
48    
49     src_prepare() {
50     # net/bpf.h needed for net-libs/libpcap on Gentoo/FreeBSD
51     sed -i \
52     -e "s:\(#include <pcap\.h>\):#include <net/bpf.h>\n\1:" \
53     ../src/l2_packet/l2_packet_freebsd.c || die
54    
55     # People seem to take the example configuration file too literally (bug #102361)
56     sed -i \
57     -e "s:^\(opensc_engine_path\):#\1:" \
58     -e "s:^\(pkcs11_engine_path\):#\1:" \
59     -e "s:^\(pkcs11_module_path\):#\1:" \
60     wpa_supplicant.conf || die
61    
62     # Change configuration to match Gentoo locations (bug #143750)
63     sed -i \
64     -e "s:/usr/lib/opensc:/usr/$(get_libdir):" \
65     -e "s:/usr/lib/pkcs11:/usr/$(get_libdir):" \
66     wpa_supplicant.conf || die
67    
68     if use dbus; then
69     epatch "${FILESDIR}/${P}-dbus-path-fix.patch"
70     fi
71    
72     # systemd entries to D-Bus service files (bug #372877)
73     echo 'SystemdService=wpa_supplicant.service' \
74     | tee -a dbus/*.service >/dev/null || die
75    
76     cd "${WORKDIR}/${P}"
77    
78     if use wimax; then
79     # generate-libeap-peer.patch comes before
80     # fix-undefined-reference-to-random_get_bytes.patch
81     epatch "${FILESDIR}/${P}-generate-libeap-peer.patch"
82     epatch "${FILESDIR}/${P}-fix-undefined-reference-to-random_get_bytes.patch"
83    
84     # multilib-strict fix (bug #373685)
85     sed -e "s/\/usr\/lib/\/usr\/$(get_libdir)/" -i src/eap_peer/Makefile
86     fi
87    
88     # bug (320097)
89     epatch "${FILESDIR}/${P}-do-not-call-dbus-functions-with-NULL-path.patch"
90    
91     # TODO - NEED TESTING TO SEE IF STILL NEEDED, NOT COMPATIBLE WITH 1.0 OUT OF THE BOX,
92     # SO WOULD BE NICE TO JUST DROP IT, IF IT IS NOT NEEDED.
93     # bug (374089)
94     #epatch "${FILESDIR}/${P}-dbus-WPAIE-fix.patch"
95     }
96    
97     src_configure() {
98     # Toolchain setup
99     tc-export CC
100    
101     # Basic setup
102     echo "CONFIG_CTRL_IFACE=y" >> .config
103     echo "CONFIG_BACKEND=file" >> .config
104    
105     # Basic authentication methods
106     # NOTE: we don't set GPSK or SAKE as they conflict
107     # with the below options
108     echo "CONFIG_EAP_GTC=y" >> .config
109     echo "CONFIG_EAP_MD5=y" >> .config
110     echo "CONFIG_EAP_OTP=y" >> .config
111     echo "CONFIG_EAP_PAX=y" >> .config
112     echo "CONFIG_EAP_PSK=y" >> .config
113     echo "CONFIG_EAP_TLV=y" >> .config
114     echo "CONFIG_IEEE8021X_EAPOL=y" >> .config
115     echo "CONFIG_PKCS12=y" >> .config
116     echo "CONFIG_PEERKEY=y" >> .config
117     echo "CONFIG_EAP_LEAP=y" >> .config
118     echo "CONFIG_EAP_MSCHAPV2=y" >> .config
119     echo "CONFIG_EAP_PEAP=y" >> .config
120     echo "CONFIG_EAP_TLS=y" >> .config
121     echo "CONFIG_EAP_TTLS=y" >> .config
122    
123     if use dbus ; then
124     echo "CONFIG_CTRL_IFACE_DBUS=y" >> .config
125     echo "CONFIG_CTRL_IFACE_DBUS_NEW=y" >> .config
126     echo "CONFIG_CTRL_IFACE_DBUS_INTRO=y" >> .config
127     fi
128    
129     # Enable support for writing debug info to a log file.
130     echo "CONFIG_DEBUG_FILE=y" >> .config
131    
132     if use eap-sim ; then
133     # Smart card authentication
134     echo "CONFIG_EAP_SIM=y" >> .config
135     echo "CONFIG_EAP_AKA=y" >> .config
136     echo "CONFIG_EAP_AKA_PRIME=y" >> .config
137     echo "CONFIG_PCSC=y" >> .config
138     fi
139    
140     if use fasteap ; then
141     echo "CONFIG_EAP_FAST=y" >> .config
142     fi
143    
144     if use readline ; then
145     # readline/history support for wpa_cli
146     echo "CONFIG_READLINE=y" >> .config
147     fi
148    
149     # SSL authentication methods
150     if use ssl ; then
151     echo "CONFIG_TLS=openssl" >> .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 smartcard ; then
160     echo "CONFIG_SMARTCARD=y" >> .config
161     fi
162    
163     if use kernel_linux ; then
164     # Linux specific drivers
165     echo "CONFIG_DRIVER_ATMEL=y" >> .config
166     #echo "CONFIG_DRIVER_BROADCOM=y" >> .config
167     #echo "CONFIG_DRIVER_HERMES=y" >> .config
168     echo "CONFIG_DRIVER_HOSTAP=y" >> .config
169     echo "CONFIG_DRIVER_IPW=y" >> .config
170     echo "CONFIG_DRIVER_NDISWRAPPER=y" >> .config
171     echo "CONFIG_DRIVER_NL80211=y" >> .config
172     #echo "CONFIG_DRIVER_PRISM54=y" >> .config
173     echo "CONFIG_DRIVER_RALINK=y" >> .config
174     echo "CONFIG_DRIVER_WEXT=y" >> .config
175     echo "CONFIG_DRIVER_WIRED=y" >> .config
176    
177     if use ps3 ; then
178     echo "CONFIG_DRIVER_PS3=y" >> .config
179     fi
180    
181     elif use kernel_FreeBSD ; then
182     # FreeBSD specific driver
183     echo "CONFIG_DRIVER_BSD=y" >> .config
184     fi
185    
186     # Wi-Fi Protected Setup (WPS)
187     if use wps ; then
188     echo "CONFIG_WPS=y" >> .config
189     echo "CONFIG_WPS2=y" >> .config
190     # USB Flash Drive
191     echo "CONFIG_WPS_UFD=y" >> .config
192     # External Registrar
193     echo "CONFIG_WPS_ER=y" >> .config
194     # Universal Plug'n'Play
195     echo "CONFIG_WPS_UPNP=y" >> .config
196     # Near Field Communication
197     echo "CONFIG_WPS_NFC=y" >> .config
198     fi
199    
200     # Wi-Fi Direct (WiDi)
201     if use p2p ; then
202     echo "CONFIG_P2P=y" >> .config
203     fi
204    
205     # Access Point Mode
206     if use ap ; then
207     echo "CONFIG_AP=y" >> .config
208     fi
209    
210     # Enable mitigation against certain attacks against TKIP
211     echo "CONFIG_DELAYED_MIC_ERROR_REPORT=y" >> .config
212    
213     # If we are using libnl 2.0 and above, enable support for it
214     # Bug 382159
215     # Removed for now, since the 3.2 version is broken, and we don't
216     # support it.
217     if has_version ">=dev-libs/libnl-3.2"; then
218     echo "CONFIG_LIBNL32=y" >> .config
219     fi
220    
221     if use qt4 ; then
222     pushd "${S}"/wpa_gui-qt4 > /dev/null
223     eqmake4 wpa_gui.pro
224     popd > /dev/null
225     fi
226     }
227    
228     src_compile() {
229     einfo "Building wpa_supplicant"
230     emake V=1
231    
232     if use wimax; then
233     emake -C ../src/eap_peer clean
234     emake -C ../src/eap_peer
235     fi
236    
237     if use qt4 ; then
238     pushd "${S}"/wpa_gui-qt4 > /dev/null
239     einfo "Building wpa_gui"
240     emake
241     popd > /dev/null
242     fi
243     }
244    
245     src_install() {
246     dosbin wpa_supplicant
247     dobin wpa_cli wpa_passphrase
248    
249     # baselayout-1 compat
250     if has_version "<sys-apps/baselayout-2.0.0"; then
251     dodir /sbin
252     dosym /usr/sbin/wpa_supplicant /sbin/wpa_supplicant
253     dodir /bin
254     dosym /usr/bin/wpa_cli /bin/wpa_cli
255     fi
256    
257     if has_version ">=sys-apps/openrc-0.5.0"; then
258     newinitd "${FILESDIR}/${PN}-init.d" wpa_supplicant
259     newconfd "${FILESDIR}/${PN}-conf.d" wpa_supplicant
260     fi
261    
262     exeinto /etc/wpa_supplicant/
263     newexe "${FILESDIR}/wpa_cli.sh" wpa_cli.sh
264    
265     dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
266     wpa_supplicant.conf
267    
268     doman doc/docbook/*.{5,8}
269    
270     if use qt4 ; then
271     into /usr
272     dobin wpa_gui-qt4/wpa_gui
273     doicon wpa_gui-qt4/icons/wpa_gui.svg
274     make_desktop_entry wpa_gui "WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
275     fi
276    
277     use wimax && emake DESTDIR="${D}" -C ../src/eap_peer install
278    
279     if use dbus ; then
280     pushd "${S}"/dbus > /dev/null
281     insinto /etc/dbus-1/system.d
282     newins dbus-wpa_supplicant.conf wpa_supplicant.conf
283     insinto /usr/share/dbus-1/system-services
284     doins fi.epitest.hostap.WPASupplicant.service fi.w1.wpa_supplicant1.service
285     keepdir /var/run/wpa_supplicant
286     popd > /dev/null
287     fi
288    
289     # systemd stuff
290     systemd_dounit "${FILESDIR}"/wpa_supplicant.service
291     systemd_newunit "${FILESDIR}"/wpa_supplicant_at.service 'wpa_supplicant@.service'
292     }
293    
294     pkg_postinst() {
295     elog "If this is a clean installation of wpa_supplicant, you"
296     elog "have to create a configuration file named"
297     elog "/etc/wpa_supplicant/wpa_supplicant.conf"
298     elog
299     elog "An example configuration file is available for reference in"
300     elog "/usr/share/doc/${PF}/"
301    
302     if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
303     echo
304     ewarn "WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
305     ewarn "needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
306     fi
307    
308     # Mea culpa, feel free to remove that after some time --mgorny.
309     local fn
310     for fn in wpa_supplicant{,@wlan0}.service; do
311     if [[ -e "${ROOT}"/etc/systemd/system/network.target.wants/${fn} ]]
312     then
313     ebegin "Moving ${fn} to multi-user.target"
314     mv "${ROOT}"/etc/systemd/system/network.target.wants/${fn} \
315     "${ROOT}"/etc/systemd/system/multi-user.target.wants/
316     eend ${?} \
317     "Please try to re-enable ${fn}"
318     fi
319     done
320     }

  ViewVC Help
Powered by ViewVC 1.1.20