/[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.5 - (hide annotations) (download)
Fri Sep 9 09:42:19 2011 UTC (8 years, 10 months ago) by gurligebis
Branch: MAIN
Changes since 1.4: +7 -2 lines
Fixing bug 382159

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

  ViewVC Help
Powered by ViewVC 1.1.20