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

Contents of /net-wireless/wpa_supplicant/wpa_supplicant-1.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Sun Jun 3 08:03:26 2012 UTC (11 months, 2 weeks ago) by gurligebis
Branch: MAIN
Changes since 1.2: +2 -1 lines
Making wpa_supplicant depend on net-wireless/crda on linux, fixing bug 401277

(Portage version: 2.2.0_alpha108/cvs/Linux i686)

1 gurligebis 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 gurligebis 1.3 # $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/wpa_supplicant-1.0.ebuild,v 1.2 2012/05/22 07:17:10 gurligebis 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     KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86 ~x86-fbsd"
16     IUSE="dbus debug gnutls eap-sim fasteap madwifi ps3 qt4 readline selinux ssl wimax wps kernel_linux kernel_FreeBSD"
17    
18     RDEPEND="dbus? ( sys-apps/dbus )
19     kernel_linux? (
20     eap-sim? ( sys-apps/pcsc-lite )
21     madwifi? ( >net-wireless/madwifi-ng-tools-0.9.3 )
22     dev-libs/libnl:1.1
23 gurligebis 1.3 net-wireless/crda
24 gurligebis 1.1 )
25     !kernel_linux? ( net-libs/libpcap )
26     qt4? (
27     x11-libs/qt-gui:4
28     x11-libs/qt-svg: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 fasteap && (use gnutls || use ssl) ; then
45     die "If you use fasteap, you must build with wpa_supplicant's internal TLS implementation. That is, both 'gnutls' and 'ssl' USE flags must be disabled"
46     fi
47    
48     if use gnutls && use ssl ; then
49     einfo "You have both 'gnutls' and 'ssl' USE flags enabled: defaulting to USE=\"ssl\""
50     fi
51     }
52    
53     src_prepare() {
54     # net/bpf.h needed for net-libs/libpcap on Gentoo/FreeBSD
55     sed -i \
56     -e "s:\(#include <pcap\.h>\):#include <net/bpf.h>\n\1:" \
57     ../src/l2_packet/l2_packet_freebsd.c || die
58    
59     # People seem to take the example configuration file too literally (bug #102361)
60     sed -i \
61     -e "s:^\(opensc_engine_path\):#\1:" \
62     -e "s:^\(pkcs11_engine_path\):#\1:" \
63     -e "s:^\(pkcs11_module_path\):#\1:" \
64     wpa_supplicant.conf || die
65    
66     # Change configuration to match Gentoo locations (bug #143750)
67     sed -i \
68     -e "s:/usr/lib/opensc:/usr/$(get_libdir):" \
69     -e "s:/usr/lib/pkcs11:/usr/$(get_libdir):" \
70     wpa_supplicant.conf || die
71    
72     if use dbus; then
73     epatch "${FILESDIR}/${P}-dbus-path-fix.patch"
74     fi
75    
76     # systemd entries to D-Bus service files (bug #372877)
77     echo 'SystemdService=wpa_supplicant.service' \
78     | tee -a dbus/*.service >/dev/null || die
79    
80     if use wimax; then
81     cd "${WORKDIR}/${P}"
82     epatch "${FILESDIR}/${P}-generate-libeap-peer.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 gurligebis 1.2 # bug (409285)
92     epatch "${FILESDIR}/wpa_supplicant-gcc470.patch"
93    
94 gurligebis 1.1 # TODO - NEED TESTING TO SEE IF STILL NEEDED, NOT COMPATIBLE WITH 1.0 OUT OF THE BOX,
95     # SO WOULD BE NICE TO JUST DROP IT, IF IT IS NOT NEEDED.
96     # bug (374089)
97     #epatch "${FILESDIR}/${P}-dbus-WPAIE-fix.patch"
98     }
99    
100     src_configure() {
101     # Toolchain setup
102     tc-export CC
103    
104     # Basic setup
105     echo "CONFIG_CTRL_IFACE=y" >> .config
106     echo "CONFIG_BACKEND=file" >> .config
107    
108     # Basic authentication methods
109     # NOTE: we don't set GPSK or SAKE as they conflict
110     # with the below options
111     echo "CONFIG_EAP_GTC=y" >> .config
112     echo "CONFIG_EAP_MD5=y" >> .config
113     echo "CONFIG_EAP_OTP=y" >> .config
114     echo "CONFIG_EAP_PAX=y" >> .config
115     echo "CONFIG_EAP_PSK=y" >> .config
116     echo "CONFIG_EAP_TLV=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     if use dbus ; then
127     echo "CONFIG_CTRL_IFACE_DBUS=y" >> .config
128     echo "CONFIG_CTRL_IFACE_DBUS_NEW=y" >> .config
129     echo "CONFIG_CTRL_IFACE_DBUS_INTRO=y" >> .config
130     fi
131    
132     if use debug ; then
133     echo "CONFIG_DEBUG_FILE=y" >> .config
134     fi
135    
136     if use eap-sim ; then
137     # Smart card authentication
138     echo "CONFIG_EAP_SIM=y" >> .config
139     echo "CONFIG_EAP_AKA=y" >> .config
140     echo "CONFIG_EAP_AKA_PRIME=y" >> .config
141     echo "CONFIG_PCSC=y" >> .config
142     fi
143    
144     if use fasteap ; then
145     echo "CONFIG_EAP_FAST=y" >> .config
146     fi
147    
148     if use readline ; then
149     # readline/history support for wpa_cli
150     echo "CONFIG_READLINE=y" >> .config
151     fi
152    
153     # SSL authentication methods
154     if use ssl ; then
155     echo "CONFIG_TLS=openssl" >> .config
156     echo "CONFIG_SMARTCARD=y" >> .config
157     elif use gnutls ; then
158     echo "CONFIG_TLS=gnutls" >> .config
159     echo "CONFIG_GNUTLS_EXTRA=y" >> .config
160     else
161     echo "CONFIG_TLS=internal" >> .config
162     fi
163    
164     if use kernel_linux ; then
165     # Linux specific drivers
166     echo "CONFIG_DRIVER_ATMEL=y" >> .config
167     #echo "CONFIG_DRIVER_BROADCOM=y" >> .config
168     #echo "CONFIG_DRIVER_HERMES=y" >> .config
169     echo "CONFIG_DRIVER_HOSTAP=y" >> .config
170     echo "CONFIG_DRIVER_IPW=y" >> .config
171     echo "CONFIG_DRIVER_NDISWRAPPER=y" >> .config
172     echo "CONFIG_DRIVER_NL80211=y" >> .config
173     #echo "CONFIG_DRIVER_PRISM54=y" >> .config
174     echo "CONFIG_DRIVER_RALINK=y" >> .config
175     echo "CONFIG_DRIVER_WEXT=y" >> .config
176     echo "CONFIG_DRIVER_WIRED=y" >> .config
177    
178     if use madwifi ; then
179     # Add include path for madwifi-driver headers
180     echo "CFLAGS += -I/usr/include/madwifi" >> .config
181     echo "CONFIG_DRIVER_MADWIFI=y" >> .config
182     fi
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     fi
197    
198     # Enable mitigation against certain attacks against TKIP
199     echo "CONFIG_DELAYED_MIC_ERROR_REPORT=y" >> .config
200    
201     # If we are using libnl 2.0 and above, enable support for it
202     # Bug 382159
203     # Removed for now, since the 3.2 version is broken, and we don't
204     # support it.
205     #if has_version ">=dev-libs/libnl-2.0"; then
206     # echo "CONFIG_LIBNL20=y" >> .config
207     #fi
208    
209     if use qt4 ; then
210     pushd "${S}"/wpa_gui-qt4 > /dev/null
211     eqmake4 wpa_gui.pro
212     popd > /dev/null
213     fi
214     }
215    
216     src_compile() {
217     einfo "Building wpa_supplicant"
218     emake
219    
220     if use wimax; then
221     emake -C ../src/eap_peer clean
222     emake -C ../src/eap_peer
223     fi
224    
225     if use qt4 ; then
226     pushd "${S}"/wpa_gui-qt4 > /dev/null
227     einfo "Building wpa_gui"
228     emake
229     popd > /dev/null
230     fi
231     }
232    
233     src_install() {
234     dosbin wpa_supplicant
235     dobin wpa_cli wpa_passphrase
236    
237     # baselayout-1 compat
238     if has_version "<sys-apps/baselayout-2.0.0"; then
239     dodir /sbin
240     dosym /usr/sbin/wpa_supplicant /sbin/wpa_supplicant
241     dodir /bin
242     dosym /usr/bin/wpa_cli /bin/wpa_cli
243     fi
244    
245     if has_version ">=sys-apps/openrc-0.5.0"; then
246     newinitd "${FILESDIR}/${PN}-init.d" wpa_supplicant
247     newconfd "${FILESDIR}/${PN}-conf.d" wpa_supplicant
248     fi
249    
250     exeinto /etc/wpa_supplicant/
251     newexe "${FILESDIR}/wpa_cli.sh" wpa_cli.sh
252    
253     dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
254     wpa_supplicant.conf
255    
256     doman doc/docbook/*.{5,8}
257    
258     if use qt4 ; then
259     into /usr
260     dobin wpa_gui-qt4/wpa_gui
261     doicon wpa_gui-qt4/icons/wpa_gui.svg
262     make_desktop_entry wpa_gui "WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
263     fi
264    
265     use wimax && emake DESTDIR="${D}" -C ../src/eap_peer install
266    
267     if use dbus ; then
268     pushd "${S}"/dbus > /dev/null
269     insinto /etc/dbus-1/system.d
270     newins dbus-wpa_supplicant.conf wpa_supplicant.conf
271     insinto /usr/share/dbus-1/system-services
272     doins fi.epitest.hostap.WPASupplicant.service fi.w1.wpa_supplicant1.service
273     keepdir /var/run/wpa_supplicant
274     popd > /dev/null
275     fi
276    
277     # systemd stuff
278     systemd_dounit "${FILESDIR}"/wpa_supplicant.service
279     systemd_newunit "${FILESDIR}"/wpa_supplicant_at.service 'wpa_supplicant@.service'
280     }
281    
282     pkg_postinst() {
283     einfo "If this is a clean installation of wpa_supplicant, you"
284     einfo "have to create a configuration file named"
285     einfo "/etc/wpa_supplicant/wpa_supplicant.conf"
286     einfo
287     einfo "An example configuration file is available for reference in"
288     einfo "/usr/share/doc/${PF}/"
289    
290     if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
291     echo
292     ewarn "WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
293     ewarn "needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
294     fi
295    
296     if use madwifi ; then
297     echo
298     einfo "This package compiles against the headers installed by"
299     einfo "madwifi-old, madwifi-ng or madwifi-ng-tools."
300     einfo "You should re-emerge ${PN} after upgrading these packages."
301     fi
302    
303     # Mea culpa, feel free to remove that after some time --mgorny.
304     local fn
305     for fn in wpa_supplicant{,@wlan0}.service; do
306     if [[ -e "${ROOT}"/etc/systemd/system/network.target.wants/${fn} ]]
307     then
308     ebegin "Moving ${fn} to multi-user.target"
309     mv "${ROOT}"/etc/systemd/system/network.target.wants/${fn} \
310     "${ROOT}"/etc/systemd/system/multi-user.target.wants/
311     eend ${?} \
312     "Please try to re-enable ${fn}"
313     fi
314     done
315     }

  ViewVC Help
Powered by ViewVC 1.1.13