/[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.4 - (hide annotations) (download)
Sun Oct 5 19:07:17 2014 UTC (5 years, 10 months ago) by zerochaos
Branch: MAIN
Changes since 1.3: +2 -1 lines
added missing dep on dev-qt/qtcore

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

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

  ViewVC Help
Powered by ViewVC 1.1.20