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

Contents of /net-wireless/wpa_supplicant/wpa_supplicant-0.7.3-r5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations) (download)
Wed Dec 28 23:15:25 2011 UTC (8 years, 7 months ago) by ago
Branch: MAIN
Changes since 1.10: +2 -2 lines
Stable for AMD64, wrt bug #386129

(Portage version: 2.1.10.41/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20