1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/wpa_supplicant-0.6.4.ebuild,v 1.1 2008/08/19 13:03:50 rbu Exp $
7 inherit eutils toolchain-funcs qt3 qt4
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 )"
15 KEYWORDS
="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
16 IUSE
="dbus debug gnutls gsm madwifi ps3 qt3 qt4 readline ssl kernel_linux kernel_FreeBSD"
18 DEPEND
="dbus? ( sys-apps/dbus )
20 gsm? ( sys-apps/pcsc-lite )
22 ( >net-wireless/madwifi-ng-tools-0.9.3
23 net-wireless/madwifi-old )
26 !kernel_linux? ( net-libs/libpcap )
31 !qt4? ( qt3? ( x11-libs/qt:3 ) )
32 readline? ( sys-libs/ncurses sys-libs/readline )
33 gnutls? ( net-libs/gnutls )
34 !gnutls? ( ssl? ( dev-libs/openssl ) )
35 !gnutls? ( !ssl? ( dev-libs/libtommath ) )"
38 S
="${WORKDIR}/${P}/${PN}"
41 if use gnutls
&& use ssl
; then
42 einfo
"You have both 'gnutls' and 'ssl' USE flags enabled: defaulting to USE=\"gnutls\""
45 if use qt3
&& use qt4
; then
46 einfo
"You have both 'qt3' and 'qt4' USE flags enabled: defaulting to USE=\"qt4\""
51 # net/bpf.h needed for net-libs/libpcap on Gentoo/FreeBSD
53 -e "s:\(#include <pcap\.h>\):#include <net/bpf.h>\n\1:" \
54 ..
/src
/l2_packet
/l2_packet_freebsd.c || die
56 # People seem to take the example configuration file too literally (bug #102361)
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
63 # Change configuration to match Gentoo locations (bug #143750)
65 -e "s:/usr/lib/opensc:/usr/$(get_libdir):" \
66 -e "s:/usr/lib/pkcs11:/usr/$(get_libdir):" \
67 wpa_supplicant.conf || die
72 echo "CC = $(tc-getCC)" > .config
75 echo "CONFIG_CTRL_IFACE=y" >> .config
76 echo "CONFIG_BACKEND=file" >> .config
78 # Basic authentication methods
79 # NOTE: we don't set GPSK or SAKE as they conflict
80 # with the below options
81 echo "CONFIG_EAP_GTC=y" >> .config
82 echo "CONFIG_EAP_MD5=y" >> .config
83 echo "CONFIG_EAP_OTP=y" >> .config
84 echo "CONFIG_EAP_PAX=y" >> .config
85 echo "CONFIG_EAP_PSK=y" >> .config
86 echo "CONFIG_EAP_TLV=y" >> .config
87 echo "CONFIG_IEEE8021X_EAPOL=y" >> .config
88 echo "CONFIG_PKCS12=y" >> .config
89 echo "CONFIG_PEERKEY=y" >> .config
90 echo "CONFIG_EAP_LEAP=y" >> .config
91 echo "CONFIG_EAP_MSCHAPV2=y" >> .config
92 echo "CONFIG_EAP_PEAP=y" >> .config
93 echo "CONFIG_EAP_TLS=y" >> .config
94 echo "CONFIG_EAP_TTLS=y" >> .config
97 echo "CONFIG_CTRL_IFACE_DBUS=y" >> .config
101 echo "CONFIG_DEBUG_FILE=y" >> .config
105 # Smart card authentication
106 echo "CONFIG_EAP_SIM=y" >> .config
107 echo "CONFIG_EAP_AKA=y" >> .config
108 echo "CONFIG_EAP_AKA_PRIME=y" >> .config
109 echo "CONFIG_PCSC=y" >> .config
112 if use readline
; then
113 # readline/history support for wpa_cli
114 echo "CONFIG_READLINE=y" >> .config
117 # SSL authentication methods
119 echo "CONFIG_TLS=gnutls" >> .config
120 echo "CONFIG_GNUTLS_EXTRA=y" >> .config
122 echo "CONFIG_TLS=openssl" >> .config
123 echo "CONFIG_SMARTCARD=y" >> .config
125 echo "CONFIG_TLS=internal" >> .config
128 if use kernel_linux
; then
129 # Linux specific drivers
130 echo "CONFIG_DRIVER_ATMEL=y" >> .config
131 #echo "CONFIG_DRIVER_BROADCOM=y" >> .config
132 #echo "CONFIG_DRIVER_HERMES=y" >> .config
133 echo "CONFIG_DRIVER_HOSTAP=y" >> .config
134 echo "CONFIG_DRIVER_IPW=y" >> .config
135 echo "CONFIG_DRIVER_NDISWRAPPER=y" >> .config
136 echo "CONFIG_DRIVER_NL80211=y" >> .config
137 #echo "CONFIG_DRIVER_PRISM54=y" >> .config
138 echo "CONFIG_DRIVER_RALINK=y" >> .config
139 echo "CONFIG_DRIVER_WEXT=y" >> .config
140 echo "CONFIG_DRIVER_WIRED=y" >> .config
142 if use madwifi
; then
143 # Add include path for madwifi-driver headers
144 echo "CFLAGS += -I/usr/include/madwifi" >> .config
145 echo "CONFIG_DRIVER_MADWIFI=y" >> .config
149 echo "CONFIG_DRIVER_PS3=y" >> .config
152 elif use kernel_FreeBSD
; then
153 # FreeBSD specific driver
154 echo "CONFIG_DRIVER_BSD=y" >> .config
157 # Wi-Fi Protected Setup (WPS)
158 echo "CONFIG_WPS=y" >> .config
160 # Enable mitigation against certain attacks against TKIP
161 echo "CONFIG_DELAYED_MIC_ERROR_REPORT=y" >> .config
165 emake || die
"emake failed"
168 cd "${S}"/wpa_gui-qt4
170 emake || die
"Qt4 wpa_gui compilation failed"
174 emake || die
"Qt3 wpa_gui compilation failed"
179 dosbin wpa_supplicant || die
180 dobin wpa_cli wpa_passphrase || die
182 # baselayout-1 compat
183 dosym
/usr
/sbin
/wpa_supplicant
/sbin
/wpa_supplicant || die
184 dosym
/usr
/bin
/wpa_cli
/bin
/wpa_cli || die
186 exeinto
/etc
/wpa_supplicant
/
187 newexe
"${FILESDIR}"/wpa_cli.sh wpa_cli.sh
188 insinto
/etc
/wpa_supplicant
/
189 newins
"${FILESDIR}"/wpa_supplicant.conf wpa_supplicant.conf
191 dodoc ChangeLog
{eap_testing
,todo
}.txt README
{,-WPS} \
192 wpa_supplicant.conf || die
"dodoc failed"
194 doman
doc
/docbook
/*.
{5,8} || die
"doman failed"
198 dobin wpa_gui-qt
4/wpa_gui || die
201 dobin wpa_gui
/wpa_gui || die
204 if use qt3 || use qt4
; then
205 make_desktop_entry wpa_gui
"WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
209 insinto
/etc
/dbus-
1/system.d
210 newins dbus-wpa_supplicant.conf wpa_supplicant.conf || die
211 insinto
/usr
/share
/dbus-
1/system-services
212 newins dbus-wpa_supplicant.service
'fi.epitest.hostap.WPASupplicant.service' || die
213 keepdir
/var
/run
/wpa_supplicant
218 einfo
"A default configuration file has been installed to"
219 einfo
"/etc/wpa_supplicant/wpa_supplicant.conf"
221 einfo
"An example configuration file is available in"
222 einfo
"/usr/share/doc/${PF}/"
224 if [[ -e ${ROOT}etc
/wpa_supplicant.conf
]] ; then
226 ewarn
"WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
227 ewarn
"needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
230 if use madwifi
; then
232 einfo
"This package compiles against the headers installed by"
233 einfo
"madwifi-old, madwifi-ng or madwifi-ng-tools."
234 einfo
"You should re-emerge ${PN} after upgrading these packages."