Gentoo Archives: gentoo-commits

From: Bjarke Istrup Pedersen <gurligebis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-wireless/wpa_supplicant/, net-wireless/wpa_supplicant/files/
Date: Wed, 05 Oct 2016 17:03:32
Message-Id: 1475687001.0cff14d765f37cec7c324c1fc15a8768e9058397.gurligebis@gentoo
1 commit: 0cff14d765f37cec7c324c1fc15a8768e9058397
2 Author: Bjarke Istrup Pedersen <gurligebis <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 5 17:02:50 2016 +0000
4 Commit: Bjarke Istrup Pedersen <gurligebis <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 5 17:03:21 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cff14d7
7
8 net-wireless/wpa_supplicant: Bumping to 2.6
9
10 Package-Manager: portage-2.3.1
11
12 net-wireless/wpa_supplicant/Manifest | 1 +
13 ...do-not-call-dbus-functions-with-NULL-path.patch | 13 +
14 .../wpa_supplicant/wpa_supplicant-2.6.ebuild | 395 +++++++++++++++++++++
15 3 files changed, 409 insertions(+)
16
17 diff --git a/net-wireless/wpa_supplicant/Manifest b/net-wireless/wpa_supplicant/Manifest
18 index 192819a..41e9b86 100644
19 --- a/net-wireless/wpa_supplicant/Manifest
20 +++ b/net-wireless/wpa_supplicant/Manifest
21 @@ -1 +1,2 @@
22 DIST wpa_supplicant-2.5.tar.gz 2607336 SHA256 cce55bae483b364eae55c35ba567c279be442ed8bab5b80a3c7fb0d057b9b316 SHA512 e3ca36ed10b4dae8f663e98ad230c8c059c952316c21a6b0638ecb1b40a5ef1b9083138ab45207cb764a17e870b4bd0625dd6efdb65856cb4dca13ccc0559e81 WHIRLPOOL 7f35ba06fc4022fe21f05a54a5b108bf2111dcb22e795e1566a514400db8348e79cc80b605dab5b586ab8f3966833ade7153e63c118794a0f06c4afd7a37781d
23 +DIST wpa_supplicant-2.6.tar.gz 2753524 SHA256 b4936d34c4e6cdd44954beba74296d964bc2c9668ecaa5255e499636fe2b1450 SHA512 46442cddb6ca043b8b08d143908f149954c238e0f3a57a0df73ca4fab9c1acd91b078f3f26375a1d99cd1d65625986328018c735d8705882c8f91e389cad28a6 WHIRLPOOL 63f91b9f72fee65df5412e90f5a4b38f327f47b44724164aa27a6933a68c68672a129d7c01e658c7fed1f7018fe9e4b743f3c6cef2f69fd75c3f5b9a1cb67c1b
24
25 diff --git a/net-wireless/wpa_supplicant/files/wpa_supplicant-2.6-do-not-call-dbus-functions-with-NULL-path.patch b/net-wireless/wpa_supplicant/files/wpa_supplicant-2.6-do-not-call-dbus-functions-with-NULL-path.patch
26 new file mode 100644
27 index 00000000..0f340c9
28 --- /dev/null
29 +++ b/net-wireless/wpa_supplicant/files/wpa_supplicant-2.6-do-not-call-dbus-functions-with-NULL-path.patch
30 @@ -0,0 +1,13 @@
31 +diff --git a/wpa_supplicant/dbus/dbus_new_helpers.c b/wpa_supplicant/dbus/dbus_new_helpers.c
32 +index 45623f3..0fc3d08 100644
33 +--- a/wpa_supplicant/dbus/dbus_new_helpers.c
34 ++++ b/wpa_supplicant/dbus/dbus_new_helpers.c
35 +@@ -847,7 +847,7 @@ void wpa_dbus_mark_property_changed(struct wpas_dbus_priv *iface,
36 + const struct wpa_dbus_property_desc *dsc;
37 + int i = 0;
38 +
39 +- if (iface == NULL)
40 ++ if (iface == NULL || path == NULL)
41 + return;
42 +
43 + dbus_connection_get_object_path_data(iface->con, path,
44
45 diff --git a/net-wireless/wpa_supplicant/wpa_supplicant-2.6.ebuild b/net-wireless/wpa_supplicant/wpa_supplicant-2.6.ebuild
46 new file mode 100644
47 index 00000000..7f44dcf
48 --- /dev/null
49 +++ b/net-wireless/wpa_supplicant/wpa_supplicant-2.6.ebuild
50 @@ -0,0 +1,395 @@
51 +# Copyright 1999-2016 Gentoo Foundation
52 +# Distributed under the terms of the GNU General Public License v2
53 +# $Id$
54 +
55 +EAPI=5
56 +
57 +inherit eutils toolchain-funcs qt4-r2 qmake-utils systemd multilib
58 +
59 +DESCRIPTION="IEEE 802.1X/WPA supplicant for secure wireless transfers"
60 +HOMEPAGE="http://hostap.epitest.fi/wpa_supplicant/"
61 +SRC_URI="http://hostap.epitest.fi/releases/${P}.tar.gz"
62 +LICENSE="|| ( GPL-2 BSD )"
63 +
64 +SLOT="0"
65 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
66 +IUSE="ap dbus gnutls eap-sim fasteap +hs2-0 libressl p2p ps3 qt4 qt5 readline selinux smartcard ssl tdls uncommon-eap-types wimax wps kernel_linux kernel_FreeBSD"
67 +REQUIRED_USE="fasteap? ( !gnutls !ssl ) smartcard? ( ssl ) ?? ( qt4 qt5 )"
68 +
69 +CDEPEND="dbus? ( sys-apps/dbus )
70 + kernel_linux? (
71 + eap-sim? ( sys-apps/pcsc-lite )
72 + dev-libs/libnl:3
73 + net-wireless/crda
74 + )
75 + !kernel_linux? ( net-libs/libpcap )
76 + qt4? (
77 + dev-qt/qtcore:4
78 + dev-qt/qtgui:4
79 + dev-qt/qtsvg:4
80 + )
81 + qt5? (
82 + dev-qt/qtcore:5
83 + dev-qt/qtgui:5
84 + dev-qt/qtwidgets:5
85 + dev-qt/qtsvg:5
86 + )
87 + readline? (
88 + sys-libs/ncurses:0=
89 + sys-libs/readline:0=
90 + )
91 + ssl? (
92 + !libressl? ( dev-libs/openssl:0= )
93 + libressl? ( dev-libs/libressl )
94 + )
95 + !ssl? (
96 + gnutls? (
97 + net-libs/gnutls
98 + dev-libs/libgcrypt:*
99 + )
100 + !gnutls? ( dev-libs/libtommath )
101 + )
102 +"
103 +DEPEND="${CDEPEND}
104 + virtual/pkgconfig
105 +"
106 +RDEPEND="${CDEPEND}
107 + selinux? ( sec-policy/selinux-networkmanager )
108 +"
109 +
110 +S="${WORKDIR}/${P}/${PN}"
111 +
112 +Kconfig_style_config() {
113 + #param 1 is CONFIG_* item
114 + #param 2 is what to set it = to, defaulting in y
115 + CONFIG_PARAM="${CONFIG_HEADER:-CONFIG_}$1"
116 + setting="${2:-y}"
117 +
118 + if [ ! $setting = n ]; then
119 + #first remove any leading "# " if $2 is not n
120 + sed -i "/^# *$CONFIG_PARAM=/s/^# *//" .config || echo "Kconfig_style_config error uncommenting $CONFIG_PARAM"
121 + #set item = $setting (defaulting to y)
122 + sed -i "/^$CONFIG_PARAM/s/=.*/=$setting/" .config || echo "Kconfig_style_config error setting $CONFIG_PARAM=$setting"
123 + else
124 + #ensure item commented out
125 + sed -i "/^$CONFIG_PARAM/s/$CONFIG_PARAM/# $CONFIG_PARAM/" .config || echo "Kconfig_style_config error commenting $CONFIG_PARAM"
126 + fi
127 +}
128 +
129 +pkg_setup() {
130 + if use gnutls && use ssl ; then
131 + elog "You have both 'gnutls' and 'ssl' USE flags enabled: defaulting to USE=\"ssl\""
132 + fi
133 +}
134 +
135 +src_prepare() {
136 + # net/bpf.h needed for net-libs/libpcap on Gentoo/FreeBSD
137 + sed -i \
138 + -e "s:\(#include <pcap\.h>\):#include <net/bpf.h>\n\1:" \
139 + ../src/l2_packet/l2_packet_freebsd.c || die
140 +
141 + # People seem to take the example configuration file too literally (bug #102361)
142 + sed -i \
143 + -e "s:^\(opensc_engine_path\):#\1:" \
144 + -e "s:^\(pkcs11_engine_path\):#\1:" \
145 + -e "s:^\(pkcs11_module_path\):#\1:" \
146 + wpa_supplicant.conf || die
147 +
148 + # Change configuration to match Gentoo locations (bug #143750)
149 + sed -i \
150 + -e "s:/usr/lib/opensc:/usr/$(get_libdir):" \
151 + -e "s:/usr/lib/pkcs11:/usr/$(get_libdir):" \
152 + wpa_supplicant.conf || die
153 +
154 + #if use dbus; then
155 + # epatch "${FILESDIR}/${P}-dbus-path-fix.patch"
156 + #fi
157 +
158 + # systemd entries to D-Bus service files (bug #372877)
159 + echo 'SystemdService=wpa_supplicant.service' \
160 + | tee -a dbus/*.service >/dev/null || die
161 +
162 + cd "${WORKDIR}/${P}"
163 +
164 + if use wimax; then
165 + # generate-libeap-peer.patch comes before
166 + # fix-undefined-reference-to-random_get_bytes.patch
167 + epatch "${FILESDIR}/${P}-generate-libeap-peer.patch"
168 +
169 + # multilib-strict fix (bug #373685)
170 + sed -e "s/\/usr\/lib/\/usr\/$(get_libdir)/" -i src/eap_peer/Makefile
171 + fi
172 +
173 + # bug (320097)
174 + epatch "${FILESDIR}/${P}-do-not-call-dbus-functions-with-NULL-path.patch"
175 +
176 + # TODO - NEED TESTING TO SEE IF STILL NEEDED, NOT COMPATIBLE WITH 1.0 OUT OF THE BOX,
177 + # SO WOULD BE NICE TO JUST DROP IT, IF IT IS NOT NEEDED.
178 + # bug (374089)
179 + #epatch "${FILESDIR}/${P}-dbus-WPAIE-fix.patch"
180 +}
181 +
182 +src_configure() {
183 + # Toolchain setup
184 + tc-export CC
185 +
186 + cp defconfig .config
187 +
188 + # Basic setup
189 + Kconfig_style_config CTRL_IFACE
190 + Kconfig_style_config BACKEND file
191 + Kconfig_style_config IBSS_RSN
192 + Kconfig_style_config IEEE80211W
193 + Kconfig_style_config IEEE80211R
194 +
195 + # Basic authentication methods
196 + # NOTE: we don't set GPSK or SAKE as they conflict
197 + # with the below options
198 + Kconfig_style_config EAP_GTC
199 + Kconfig_style_config EAP_MD5
200 + Kconfig_style_config EAP_OTP
201 + Kconfig_style_config EAP_PAX
202 + Kconfig_style_config EAP_PSK
203 + Kconfig_style_config EAP_TLV
204 + Kconfig_style_config EAP_EXE
205 + Kconfig_style_config IEEE8021X_EAPOL
206 + Kconfig_style_config PKCS12
207 + Kconfig_style_config PEERKEY
208 + Kconfig_style_config EAP_LEAP
209 + Kconfig_style_config EAP_MSCHAPV2
210 + Kconfig_style_config EAP_PEAP
211 + Kconfig_style_config EAP_TLS
212 + Kconfig_style_config EAP_TTLS
213 +
214 + # Enabling background scanning.
215 + Kconfig_style_config BGSCAN_SIMPLE
216 + Kconfig_style_config BGSCAN_LEARN
217 +
218 + # Enabling mesh networks.
219 + Kconfig_style_config MESH
220 +
221 + if use dbus ; then
222 + Kconfig_style_config CTRL_IFACE_DBUS
223 + Kconfig_style_config CTRL_IFACE_DBUS_NEW
224 + Kconfig_style_config CTRL_IFACE_DBUS_INTRO
225 + fi
226 +
227 + # Enable support for writing debug info to a log file and syslog.
228 + Kconfig_style_config DEBUG_FILE
229 + Kconfig_style_config DEBUG_SYSLOG
230 +
231 + if use hs2-0 ; then
232 + Kconfig_style_config INTERWORKING
233 + Kconfig_style_config HS20
234 + fi
235 +
236 + if use uncommon-eap-types; then
237 + Kconfig_style_config EAP_GPSK
238 + Kconfig_style_config EAP_SAKE
239 + Kconfig_style_config EAP_GPSK_SHA256
240 + Kconfig_style_config EAP_IKEV2
241 + Kconfig_style_config EAP_EKE
242 + fi
243 +
244 + if use eap-sim ; then
245 + # Smart card authentication
246 + Kconfig_style_config EAP_SIM
247 + Kconfig_style_config EAP_AKA
248 + Kconfig_style_config EAP_AKA_PRIME
249 + Kconfig_style_config PCSC
250 + fi
251 +
252 + if use fasteap ; then
253 + Kconfig_style_config EAP_FAST
254 + fi
255 +
256 + if use readline ; then
257 + # readline/history support for wpa_cli
258 + Kconfig_style_config READLINE
259 + else
260 + #internal line edit mode for wpa_cli
261 + Kconfig_style_config WPA_CLI_EDIT
262 + fi
263 +
264 + # SSL authentication methods
265 + if use ssl ; then
266 + Kconfig_style_config TLS openssl
267 + elif use gnutls ; then
268 + Kconfig_style_config TLS gnutls
269 + Kconfig_style_config GNUTLS_EXTRA
270 + else
271 + Kconfig_style_config TLS internal
272 + fi
273 +
274 + if use smartcard ; then
275 + Kconfig_style_config SMARTCARD
276 + fi
277 +
278 + if use tdls ; then
279 + Kconfig_style_config TDLS
280 + fi
281 +
282 + if use kernel_linux ; then
283 + # Linux specific drivers
284 + Kconfig_style_config DRIVER_ATMEL
285 + Kconfig_style_config DRIVER_HOSTAP
286 + Kconfig_style_config DRIVER_IPW
287 + Kconfig_style_config DRIVER_NL80211
288 + Kconfig_style_config DRIVER_RALINK
289 + Kconfig_style_config DRIVER_WEXT
290 + Kconfig_style_config DRIVER_WIRED
291 +
292 + if use ps3 ; then
293 + Kconfig_style_config DRIVER_PS3
294 + fi
295 +
296 + elif use kernel_FreeBSD ; then
297 + # FreeBSD specific driver
298 + Kconfig_style_config DRIVER_BSD
299 + fi
300 +
301 + # Wi-Fi Protected Setup (WPS)
302 + if use wps ; then
303 + Kconfig_style_config WPS
304 + Kconfig_style_config WPS2
305 + # USB Flash Drive
306 + Kconfig_style_config WPS_UFD
307 + # External Registrar
308 + Kconfig_style_config WPS_ER
309 + # Universal Plug'n'Play
310 + Kconfig_style_config WPS_UPNP
311 + # Near Field Communication
312 + Kconfig_style_config WPS_NFC
313 + fi
314 +
315 + # Wi-Fi Direct (WiDi)
316 + if use p2p ; then
317 + Kconfig_style_config P2P
318 + Kconfig_style_config WIFI_DISPLAY
319 + fi
320 +
321 + # Access Point Mode
322 + if use ap ; then
323 + Kconfig_style_config AP
324 + fi
325 +
326 + # Enable mitigation against certain attacks against TKIP
327 + Kconfig_style_config DELAYED_MIC_ERROR_REPORT
328 +
329 + # If we are using libnl 2.0 and above, enable support for it
330 + # Bug 382159
331 + # Removed for now, since the 3.2 version is broken, and we don't
332 + # support it.
333 + if has_version ">=dev-libs/libnl-3.2"; then
334 + Kconfig_style_config LIBNL32
335 + fi
336 +
337 + if use qt4 ; then
338 + pushd "${S}"/wpa_gui-qt4 > /dev/null
339 + eqmake4 wpa_gui.pro
340 + popd > /dev/null
341 + fi
342 + if use qt5 ; then
343 + pushd "${S}"/wpa_gui-qt4 > /dev/null
344 + eqmake5 wpa_gui.pro
345 + popd > /dev/null
346 + fi
347 +}
348 +
349 +src_compile() {
350 + einfo "Building wpa_supplicant"
351 + emake V=1 BINDIR=/usr/sbin
352 +
353 + if use wimax; then
354 + emake -C ../src/eap_peer clean
355 + emake -C ../src/eap_peer
356 + fi
357 +
358 + if use qt4 || use qt5; then
359 + pushd "${S}"/wpa_gui-qt4 > /dev/null
360 + einfo "Building wpa_gui"
361 + emake
362 + popd > /dev/null
363 + fi
364 +}
365 +
366 +src_install() {
367 + dosbin wpa_supplicant
368 + dobin wpa_cli wpa_passphrase
369 +
370 + # baselayout-1 compat
371 + if has_version "<sys-apps/baselayout-2.0.0"; then
372 + dodir /sbin
373 + dosym /usr/sbin/wpa_supplicant /sbin/wpa_supplicant
374 + dodir /bin
375 + dosym /usr/bin/wpa_cli /bin/wpa_cli
376 + fi
377 +
378 + if has_version ">=sys-apps/openrc-0.5.0"; then
379 + newinitd "${FILESDIR}/${PN}-init.d" wpa_supplicant
380 + newconfd "${FILESDIR}/${PN}-conf.d" wpa_supplicant
381 + fi
382 +
383 + exeinto /etc/wpa_supplicant/
384 + newexe "${FILESDIR}/wpa_cli.sh" wpa_cli.sh
385 +
386 + dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
387 + wpa_supplicant.conf
388 +
389 + newdoc .config build-config
390 +
391 + doman doc/docbook/*.{5,8}
392 +
393 + if use qt4 || use qt5 ; then
394 + into /usr
395 + dobin wpa_gui-qt4/wpa_gui
396 + doicon wpa_gui-qt4/icons/wpa_gui.svg
397 + make_desktop_entry wpa_gui "WPA Supplicant Administration GUI" "wpa_gui" "Qt;Network;"
398 + fi
399 +
400 + use wimax && emake DESTDIR="${D}" -C ../src/eap_peer install
401 +
402 + if use dbus ; then
403 + pushd "${S}"/dbus > /dev/null
404 + insinto /etc/dbus-1/system.d
405 + newins dbus-wpa_supplicant.conf wpa_supplicant.conf
406 + insinto /usr/share/dbus-1/system-services
407 + doins fi.epitest.hostap.WPASupplicant.service fi.w1.wpa_supplicant1.service
408 + popd > /dev/null
409 +
410 + # This unit relies on dbus support, bug 538600.
411 + systemd_dounit systemd/wpa_supplicant.service
412 + fi
413 +
414 + systemd_dounit "systemd/wpa_supplicant@.service"
415 + systemd_dounit "systemd/wpa_supplicant-nl80211@.service"
416 + systemd_dounit "systemd/wpa_supplicant-wired@.service"
417 +}
418 +
419 +pkg_postinst() {
420 + elog "If this is a clean installation of wpa_supplicant, you"
421 + elog "have to create a configuration file named"
422 + elog "/etc/wpa_supplicant/wpa_supplicant.conf"
423 + elog
424 + elog "An example configuration file is available for reference in"
425 + elog "/usr/share/doc/${PF}/"
426 +
427 + if [[ -e ${ROOT}etc/wpa_supplicant.conf ]] ; then
428 + echo
429 + ewarn "WARNING: your old configuration file ${ROOT}etc/wpa_supplicant.conf"
430 + ewarn "needs to be moved to ${ROOT}etc/wpa_supplicant/wpa_supplicant.conf"
431 + fi
432 +
433 + # Mea culpa, feel free to remove that after some time --mgorny.
434 + local fn
435 + for fn in wpa_supplicant{,@wlan0}.service; do
436 + if [[ -e "${ROOT}"/etc/systemd/system/network.target.wants/${fn} ]]
437 + then
438 + ebegin "Moving ${fn} to multi-user.target"
439 + mv "${ROOT}"/etc/systemd/system/network.target.wants/${fn} \
440 + "${ROOT}"/etc/systemd/system/multi-user.target.wants/
441 + eend ${?} \
442 + "Please try to re-enable ${fn}"
443 + fi
444 + done
445 +}