wpa_supplicant: bumped to latest upstream release (0.6.8).
[underlay.git] / net-wireless / wpa_supplicant / wpa_supplicant-0.6.8.ebuild
blob8b35009e40cd00e18e6c7783ce88deadfac139d9
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 $
5 EAPI="2"
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 )"
14 SLOT="0"
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 )
19 kernel_linux? (
20 gsm? ( sys-apps/pcsc-lite )
21 madwifi? ( ||
22 ( >net-wireless/madwifi-ng-tools-0.9.3
23 net-wireless/madwifi-old )
26 !kernel_linux? ( net-libs/libpcap )
27 qt4? ( ||
28 ( x11-libs/qt-gui:4
29 <x11-libs/qt-4.4:4 )
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 ) )"
36 RDEPEND="${DEPEND}"
38 S="${WORKDIR}/${P}/${PN}"
40 pkg_setup() {
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\""
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
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
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
70 src_configure() {
71 # Toolchain setup
72 echo "CC = $(tc-getCC)" > .config
74 # Basic setup
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
96 if use dbus ; then
97 echo "CONFIG_CTRL_IFACE_DBUS=y" >> .config
100 if use debug ; then
101 echo "CONFIG_DEBUG_FILE=y" >> .config
104 if use gsm ; then
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
118 if use gnutls ; then
119 echo "CONFIG_TLS=gnutls" >> .config
120 echo "CONFIG_GNUTLS_EXTRA=y" >> .config
121 elif use ssl ; then
122 echo "CONFIG_TLS=openssl" >> .config
123 echo "CONFIG_SMARTCARD=y" >> .config
124 else
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
148 if use ps3 ; then
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
164 src_compile() {
165 emake || die "emake failed"
167 if use qt4 ; then
168 cd "${S}"/wpa_gui-qt4
169 eqmake4 wpa_gui.pro
170 emake || die "Qt4 wpa_gui compilation failed"
171 elif use qt3 ; then
172 cd "${S}"/wpa_gui
173 eqmake3 wpa_gui.pro
174 emake || die "Qt3 wpa_gui compilation failed"
178 src_install() {
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"
196 if use qt4 ; then
197 into /usr
198 dobin wpa_gui-qt4/wpa_gui || die
199 elif use qt3 ; then
200 into /usr
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;"
208 if use dbus ; then
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
217 pkg_postinst() {
218 einfo "A default configuration file has been installed to"
219 einfo "/etc/wpa_supplicant/wpa_supplicant.conf"
220 einfo
221 einfo "An example configuration file is available in"
222 einfo "/usr/share/doc/${PF}/"
224 if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
225 echo
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
231 echo
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."