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

Contents of /net-wireless/wpa_supplicant/wpa_supplicant-0.7.2-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Sep 8 17:34:33 2010 UTC (9 years, 11 months ago) by gurligebis
Branch: MAIN
Changes since 1.1: +4 -4 lines
Bumping and cleaning up

(Portage version: 2.2_rc77/cvs/Linux i686)

1 # Copyright 1999-2010 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.7.2-r3.ebuild,v 1.1 2010/08/14 10:16:52 gurligebis Exp $
4
5 EAPI="2"
6
7 inherit eutils toolchain-funcs qt4-r2
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 ~ppc ~ppc64 ~x86 ~x86-fbsd"
16 IUSE="dbus debug gnutls eap-sim fasteap madwifi ps3 qt4 readline ssl wps kernel_linux kernel_FreeBSD"
17
18 RDEPEND="dbus? ( sys-apps/dbus )
19 kernel_linux? (
20 eap-sim? ( sys-apps/pcsc-lite )
21 madwifi? ( ||
22 ( >net-wireless/madwifi-ng-tools-0.9.3
23 net-wireless/madwifi-old )
24 )
25 dev-libs/libnl
26 )
27 !kernel_linux? ( net-libs/libpcap )
28 qt4? ( x11-libs/qt-gui:4
29 x11-libs/qt-svg:4 )
30 readline? ( sys-libs/ncurses sys-libs/readline )
31 ssl? ( dev-libs/openssl )
32 !ssl? ( gnutls? ( net-libs/gnutls ) )
33 !ssl? ( !gnutls? ( dev-libs/libtommath ) )"
34 DEPEND="${RDEPEND}
35 dev-util/pkgconfig"
36
37 S="${WORKDIR}/${P}/${PN}"
38
39 pkg_setup() {
40 if use fasteap && (use gnutls || use ssl) ; then
41 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"
42 fi
43
44 if use gnutls && use ssl ; then
45 einfo "You have both 'gnutls' and 'ssl' USE flags enabled: defaulting to USE=\"ssl\""
46 fi
47 }
48
49 src_prepare() {
50 # net/bpf.h needed for net-libs/libpcap on Gentoo/FreeBSD
51 sed -i \
52 -e "s:\(#include <pcap\.h>\):#include <net/bpf.h>\n\1:" \
53 ../src/l2_packet/l2_packet_freebsd.c || die
54
55 # People seem to take the example configuration file too literally (bug #102361)
56 sed -i \
57 -e "s:^\(opensc_engine_path\):#\1:" \
58 -e "s:^\(pkcs11_engine_path\):#\1:" \
59 -e "s:^\(pkcs11_module_path\):#\1:" \
60 wpa_supplicant.conf || die
61
62 # Change configuration to match Gentoo locations (bug #143750)
63 sed -i \
64 -e "s:/usr/lib/opensc:/usr/$(get_libdir):" \
65 -e "s:/usr/lib/pkcs11:/usr/$(get_libdir):" \
66 wpa_supplicant.conf || die
67
68 epatch "${FILESDIR}/${P}-dbus_path_fix.patch"
69
70 # bug (320097)
71 epatch "${FILESDIR}/do-not-call-dbus-functions-with-NULL-path.patch"
72
73 # bug (321627)
74 epatch "${FILESDIR}/fix-ssid-combo.patch"
75
76 # bug (330085)
77 epatch "${FILESDIR}/${P}-no-crash.patch"
78 }
79
80 src_configure() {
81 # Toolchain setup
82 echo "CC = $(tc-getCC)" > .config
83
84 # Basic setup
85 echo "CONFIG_CTRL_IFACE=y" >> .config
86 echo "CONFIG_BACKEND=file" >> .config
87
88 # Basic authentication methods
89 # NOTE: we don't set GPSK or SAKE as they conflict
90 # with the below options
91 echo "CONFIG_EAP_GTC=y" >> .config
92 echo "CONFIG_EAP_MD5=y" >> .config
93 echo "CONFIG_EAP_OTP=y" >> .config
94 echo "CONFIG_EAP_PAX=y" >> .config
95 echo "CONFIG_EAP_PSK=y" >> .config
96 echo "CONFIG_EAP_TLV=y" >> .config
97 echo "CONFIG_IEEE8021X_EAPOL=y" >> .config
98 echo "CONFIG_PKCS12=y" >> .config
99 echo "CONFIG_PEERKEY=y" >> .config
100 echo "CONFIG_EAP_LEAP=y" >> .config
101 echo "CONFIG_EAP_MSCHAPV2=y" >> .config
102 echo "CONFIG_EAP_PEAP=y" >> .config
103 echo "CONFIG_EAP_TLS=y" >> .config
104 echo "CONFIG_EAP_TTLS=y" >> .config
105
106 if use dbus ; then
107 echo "CONFIG_CTRL_IFACE_DBUS=y" >> .config
108 fi
109
110 if use debug ; then
111 echo "CONFIG_DEBUG_FILE=y" >> .config
112 fi
113
114 if use eap-sim ; then
115 # Smart card authentication
116 echo "CONFIG_EAP_SIM=y" >> .config
117 echo "CONFIG_EAP_AKA=y" >> .config
118 echo "CONFIG_EAP_AKA_PRIME=y" >> .config
119 echo "CONFIG_PCSC=y" >> .config
120 fi
121
122 if use fasteap ; then
123 echo "CONFIG_EAP_FAST=y" >> .config
124 fi
125
126 if use readline ; then
127 # readline/history support for wpa_cli
128 echo "CONFIG_READLINE=y" >> .config
129 fi
130
131 # SSL authentication methods
132 if use ssl ; then
133 echo "CONFIG_TLS=openssl" >> .config
134 echo "CONFIG_SMARTCARD=y" >> .config
135 elif use gnutls ; then
136 echo "CONFIG_TLS=gnutls" >> .config
137 echo "CONFIG_GNUTLS_EXTRA=y" >> .config
138 else
139 echo "CONFIG_TLS=internal" >> .config
140 fi
141
142 if use kernel_linux ; then
143 # Linux specific drivers
144 echo "CONFIG_DRIVER_ATMEL=y" >> .config
145 #echo "CONFIG_DRIVER_BROADCOM=y" >> .config
146 #echo "CONFIG_DRIVER_HERMES=y" >> .config
147 echo "CONFIG_DRIVER_HOSTAP=y" >> .config
148 echo "CONFIG_DRIVER_IPW=y" >> .config
149 echo "CONFIG_DRIVER_NDISWRAPPER=y" >> .config
150 echo "CONFIG_DRIVER_NL80211=y" >> .config
151 #echo "CONFIG_DRIVER_PRISM54=y" >> .config
152 echo "CONFIG_DRIVER_RALINK=y" >> .config
153 echo "CONFIG_DRIVER_WEXT=y" >> .config
154 echo "CONFIG_DRIVER_WIRED=y" >> .config
155
156 if use madwifi ; then
157 # Add include path for madwifi-driver headers
158 echo "CFLAGS += -I/usr/include/madwifi" >> .config
159 echo "CONFIG_DRIVER_MADWIFI=y" >> .config
160 fi
161
162 if use ps3 ; then
163 echo "CONFIG_DRIVER_PS3=y" >> .config
164 fi
165
166 elif use kernel_FreeBSD ; then
167 # FreeBSD specific driver
168 echo "CONFIG_DRIVER_BSD=y" >> .config
169 fi
170
171 # Wi-Fi Protected Setup (WPS)
172 if use wps ; then
173 echo "CONFIG_WPS=y" >> .config
174 fi
175
176 # Enable mitigation against certain attacks against TKIP
177 echo "CONFIG_DELAYED_MIC_ERROR_REPORT=y" >> .config
178
179 if use qt4 ; then
180 cd "${S}"/wpa_gui-qt4
181 eqmake4 wpa_gui.pro
182 fi
183 }
184
185 src_compile() {
186 einfo "Building wpa_supplicant"
187 emake || die "emake failed"
188
189 if use qt4 ; then
190 cd "${S}"/wpa_gui-qt4
191 einfo "Building wpa_gui"
192 emake || die "wpa_gui compilation failed"
193 fi
194 }
195
196 src_install() {
197 dosbin wpa_supplicant || die
198 dobin wpa_cli wpa_passphrase || die
199
200 # baselayout-1 compat
201 if has_version "<sys-apps/baselayout-2.0.0"; then
202 dodir /sbin
203 dosym /usr/sbin/wpa_supplicant /sbin/wpa_supplicant || die
204 dodir /bin
205 dosym /usr/bin/wpa_cli /bin/wpa_cli || die
206 fi
207
208 if has_version ">=sys-apps/openrc-0.5.0"; then
209 newinitd "${FILESDIR}/${PN}-init.d" wpa_supplicant
210 newconfd "${FILESDIR}/${PN}-conf.d" wpa_supplicant
211 fi
212
213 exeinto /etc/wpa_supplicant/
214 newexe "${FILESDIR}/wpa_cli.sh" wpa_cli.sh
215
216 dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
217 wpa_supplicant.conf || die "dodoc failed"
218
219 doman doc/docbook/*.{5,8} || die "doman failed"
220
221 if use qt4 ; then
222 into /usr
223 dobin wpa_gui-qt4/wpa_gui || die
224 doicon wpa_gui-qt4/icons/wpa_gui.svg || die "Icon not found"
225 make_desktop_entry wpa_gui "WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
226 fi
227
228 if use dbus ; then
229 cd "${S}"/dbus
230 insinto /etc/dbus-1/system.d
231 newins dbus-wpa_supplicant.conf wpa_supplicant.conf || die
232 insinto /usr/share/dbus-1/system-services
233 doins fi.epitest.hostap.WPASupplicant.service || die
234 keepdir /var/run/wpa_supplicant
235 fi
236 }
237
238 pkg_postinst() {
239 einfo "If this is a clean installation of wpa_supplicant, you"
240 einfo "have to create a configuration file named"
241 einfo "/etc/wpa_supplicant/wpa_supplicant.conf"
242 einfo
243 einfo "An example configuration file is available for reference in"
244 einfo "/usr/share/doc/${PF}/"
245
246 if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
247 echo
248 ewarn "WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
249 ewarn "needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
250 fi
251
252 if use madwifi ; then
253 echo
254 einfo "This package compiles against the headers installed by"
255 einfo "madwifi-old, madwifi-ng or madwifi-ng-tools."
256 einfo "You should re-emerge ${PN} after upgrading these packages."
257 fi
258 }

  ViewVC Help
Powered by ViewVC 1.1.20