/[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.2 - (hide annotations) (download)
Mon Jul 11 10:06:34 2011 UTC (9 years ago) by gurligebis
Branch: MAIN
Changes since 1.1: +2 -2 lines
Fixing bug #374729

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

1 gurligebis 1.1 # Copyright 1999-2011 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 gurligebis 1.2 # $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/wpa_supplicant-0.7.3-r5.ebuild,v 1.1 2011/07/08 07:06:21 gurligebis Exp $
4 gurligebis 1.1
5     EAPI="2"
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 gurligebis 1.2 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     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     wimax? ( !net-wireless/libeap )
32     ssl? ( dev-libs/openssl )
33     !ssl? ( gnutls? ( net-libs/gnutls ) )
34     !ssl? ( !gnutls? ( dev-libs/libtommath ) )"
35     DEPEND="${RDEPEND}
36     dev-util/pkgconfig"
37    
38     S="${WORKDIR}/${P}/${PN}"
39    
40     pkg_setup() {
41     if use fasteap && (use gnutls || use ssl) ; then
42     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"
43     fi
44    
45     if use gnutls && use ssl ; then
46     einfo "You have both 'gnutls' and 'ssl' USE flags enabled: defaulting to USE=\"ssl\""
47     fi
48     }
49    
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
55    
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
62    
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
68    
69     epatch "${FILESDIR}/${P}-dbus_path_fix.patch"
70    
71     if use wimax; then
72     cd "${WORKDIR}/${P}"
73     epatch "${FILESDIR}/${P}-generate-libeap-peer.patch"
74    
75     # multilib-strict fix (bug #373685)
76     sed -e "s/\/usr\/lib/\/usr\/$(get_libdir)/" -i src/eap_peer/Makefile
77     fi
78    
79     # bug (320097)
80     epatch "${FILESDIR}/do-not-call-dbus-functions-with-NULL-path.patch"
81     # https://bugzilla.gnome.org/show_bug.cgi?id=644634
82     epatch "${FILESDIR}/${P}-dbus-api-changes.patch"
83     # bug (374089)
84     epatch "${FILESDIR}/${P}-dbus-WPAIE-fix.patch"
85     }
86    
87     src_configure() {
88     # Toolchain setup
89     echo "CC = $(tc-getCC)" > .config
90    
91     # Basic setup
92     echo "CONFIG_CTRL_IFACE=y" >> .config
93     echo "CONFIG_BACKEND=file" >> .config
94    
95     # Basic authentication methods
96     # NOTE: we don't set GPSK or SAKE as they conflict
97     # with the below options
98     echo "CONFIG_EAP_GTC=y" >> .config
99     echo "CONFIG_EAP_MD5=y" >> .config
100     echo "CONFIG_EAP_OTP=y" >> .config
101     echo "CONFIG_EAP_PAX=y" >> .config
102     echo "CONFIG_EAP_PSK=y" >> .config
103     echo "CONFIG_EAP_TLV=y" >> .config
104     echo "CONFIG_IEEE8021X_EAPOL=y" >> .config
105     echo "CONFIG_PKCS12=y" >> .config
106     echo "CONFIG_PEERKEY=y" >> .config
107     echo "CONFIG_EAP_LEAP=y" >> .config
108     echo "CONFIG_EAP_MSCHAPV2=y" >> .config
109     echo "CONFIG_EAP_PEAP=y" >> .config
110     echo "CONFIG_EAP_TLS=y" >> .config
111     echo "CONFIG_EAP_TTLS=y" >> .config
112    
113     if use dbus ; then
114     echo "CONFIG_CTRL_IFACE_DBUS=y" >> .config
115     echo "CONFIG_CTRL_IFACE_DBUS_NEW=y" >> .config
116     echo "CONFIG_CTRL_IFACE_DBUS_INTRO=y" >> .config
117     fi
118    
119     if use debug ; then
120     echo "CONFIG_DEBUG_FILE=y" >> .config
121     fi
122    
123     if use eap-sim ; then
124     # Smart card authentication
125     echo "CONFIG_EAP_SIM=y" >> .config
126     echo "CONFIG_EAP_AKA=y" >> .config
127     echo "CONFIG_EAP_AKA_PRIME=y" >> .config
128     echo "CONFIG_PCSC=y" >> .config
129     fi
130    
131     if use fasteap ; then
132     echo "CONFIG_EAP_FAST=y" >> .config
133     fi
134    
135     if use readline ; then
136     # readline/history support for wpa_cli
137     echo "CONFIG_READLINE=y" >> .config
138     fi
139    
140     # SSL authentication methods
141     if use ssl ; then
142     echo "CONFIG_TLS=openssl" >> .config
143     echo "CONFIG_SMARTCARD=y" >> .config
144     elif use gnutls ; then
145     echo "CONFIG_TLS=gnutls" >> .config
146     echo "CONFIG_GNUTLS_EXTRA=y" >> .config
147     else
148     echo "CONFIG_TLS=internal" >> .config
149     fi
150    
151     if use kernel_linux ; then
152     # Linux specific drivers
153     echo "CONFIG_DRIVER_ATMEL=y" >> .config
154     #echo "CONFIG_DRIVER_BROADCOM=y" >> .config
155     #echo "CONFIG_DRIVER_HERMES=y" >> .config
156     echo "CONFIG_DRIVER_HOSTAP=y" >> .config
157     echo "CONFIG_DRIVER_IPW=y" >> .config
158     echo "CONFIG_DRIVER_NDISWRAPPER=y" >> .config
159     echo "CONFIG_DRIVER_NL80211=y" >> .config
160     #echo "CONFIG_DRIVER_PRISM54=y" >> .config
161     echo "CONFIG_DRIVER_RALINK=y" >> .config
162     echo "CONFIG_DRIVER_WEXT=y" >> .config
163     echo "CONFIG_DRIVER_WIRED=y" >> .config
164    
165     if use madwifi ; then
166     # Add include path for madwifi-driver headers
167     echo "CFLAGS += -I/usr/include/madwifi" >> .config
168     echo "CONFIG_DRIVER_MADWIFI=y" >> .config
169     fi
170    
171     if use ps3 ; then
172     echo "CONFIG_DRIVER_PS3=y" >> .config
173     fi
174    
175     elif use kernel_FreeBSD ; then
176     # FreeBSD specific driver
177     echo "CONFIG_DRIVER_BSD=y" >> .config
178     fi
179    
180     # Wi-Fi Protected Setup (WPS)
181     if use wps ; then
182     echo "CONFIG_WPS=y" >> .config
183     fi
184    
185     # Enable mitigation against certain attacks against TKIP
186     echo "CONFIG_DELAYED_MIC_ERROR_REPORT=y" >> .config
187    
188     if use qt4 ; then
189     cd "${S}"/wpa_gui-qt4
190     eqmake4 wpa_gui.pro
191     fi
192     }
193    
194     src_compile() {
195     einfo "Building wpa_supplicant"
196     emake || die "emake failed"
197    
198     if use wimax; then
199     emake -C ../src/eap_peer clean || die "emake failed"
200     emake -C ../src/eap_peer || die "emake failed"
201     fi
202    
203     if use qt4 ; then
204     cd "${S}"/wpa_gui-qt4
205     einfo "Building wpa_gui"
206     emake || die "wpa_gui compilation failed"
207     fi
208     }
209    
210     src_install() {
211     dosbin wpa_supplicant || die
212     dobin wpa_cli wpa_passphrase || die
213    
214     # baselayout-1 compat
215     if has_version "<sys-apps/baselayout-2.0.0"; then
216     dodir /sbin
217     dosym /usr/sbin/wpa_supplicant /sbin/wpa_supplicant || die
218     dodir /bin
219     dosym /usr/bin/wpa_cli /bin/wpa_cli || die
220     fi
221    
222     if has_version ">=sys-apps/openrc-0.5.0"; then
223     newinitd "${FILESDIR}/${PN}-init.d" wpa_supplicant
224     newconfd "${FILESDIR}/${PN}-conf.d" wpa_supplicant
225     fi
226    
227     exeinto /etc/wpa_supplicant/
228     newexe "${FILESDIR}/wpa_cli.sh" wpa_cli.sh
229    
230     dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
231     wpa_supplicant.conf || die "dodoc failed"
232    
233     doman doc/docbook/*.{5,8} || die "doman failed"
234    
235     if use qt4 ; then
236     into /usr
237     dobin wpa_gui-qt4/wpa_gui || die
238     doicon wpa_gui-qt4/icons/wpa_gui.svg || die "Icon not found"
239     make_desktop_entry wpa_gui "WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
240     fi
241    
242     if use wimax; then
243     emake DESTDIR="${D}" -C ../src/eap_peer install || die
244     fi
245    
246     if use dbus ; then
247     cd "${S}"/dbus
248     insinto /etc/dbus-1/system.d
249     newins dbus-wpa_supplicant.conf wpa_supplicant.conf || die
250     insinto /usr/share/dbus-1/system-services
251     doins fi.epitest.hostap.WPASupplicant.service fi.w1.wpa_supplicant1.service || die
252     keepdir /var/run/wpa_supplicant
253     fi
254    
255     # SystemD stuff
256     systemd_dounit "${FILESDIR}"/wpa_supplicant.service
257     systemd_newunit "${FILESDIR}"/wpa_supplicant_at.service 'wpa_supplicant@.service' || die
258     }
259    
260     pkg_postinst() {
261     einfo "If this is a clean installation of wpa_supplicant, you"
262     einfo "have to create a configuration file named"
263     einfo "/etc/wpa_supplicant/wpa_supplicant.conf"
264     einfo
265     einfo "An example configuration file is available for reference in"
266     einfo "/usr/share/doc/${PF}/"
267    
268     if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
269     echo
270     ewarn "WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
271     ewarn "needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
272     fi
273    
274     if use madwifi ; then
275     echo
276     einfo "This package compiles against the headers installed by"
277     einfo "madwifi-old, madwifi-ng or madwifi-ng-tools."
278     einfo "You should re-emerge ${PN} after upgrading these packages."
279     fi
280     }

  ViewVC Help
Powered by ViewVC 1.1.20