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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Sun Apr 19 07:00:52 2015 UTC (5 years, 3 months ago) by pacho
Branch: MAIN
Changes since 1.6: +2 -2 lines
x86 stable wrt bug #522852

(Portage version: 2.2.18/cvs/Linux x86_64, RepoMan options: --include-arches="x86", signed Manifest commit with key A188FBD4)

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

  ViewVC Help
Powered by ViewVC 1.1.20