blob: 357c28634aea7818e9afe1d19661a585aa24eb12 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
2HOMEPAGE = "http://w1.fi/wpa_supplicant/"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06003DESCRIPTION = "wpa_supplicant is a WPA Supplicant for Linux, BSD, Mac OS X, and Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). Supplicant is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wlan driver."
Brad Bishopc342db32019-05-15 21:57:59 -04004BUGTRACKER = "http://w1.fi/security/"
5SECTION = "network"
Brad Bishopf3f93bb2019-10-16 14:33:32 -04006LICENSE = "BSD-3-Clause"
Brad Bishopc342db32019-05-15 21:57:59 -04007LIC_FILES_CHKSUM = "file://COPYING;md5=279b4f5abb9c153c285221855ddb78cc \
8 file://README;beginline=1;endline=56;md5=e7d3dbb01f75f0b9799e192731d1e1ff \
9 file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=0a8b56d3543498b742b9c0e94cc2d18b"
10DEPENDS = "dbus libnl"
11RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
12
13PACKAGECONFIG ??= "gnutls"
14PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt"
15PACKAGECONFIG[openssl] = ",,openssl"
16
17inherit pkgconfig systemd
18
Andrew Geissler5a43b432020-06-13 10:46:56 -050019SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service"
Brad Bishopc342db32019-05-15 21:57:59 -040020SYSTEMD_AUTO_ENABLE = "disable"
21
22SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
23 file://defconfig \
24 file://wpa-supplicant.sh \
25 file://wpa_supplicant.conf \
26 file://wpa_supplicant.conf-sane \
27 file://99_wpa_supplicant \
28 file://0001-replace-systemd-install-Alias-with-WantedBy.patch \
Andrew Geissler475cb722020-07-10 16:00:51 -050029 file://0001-AP-Silently-ignore-management-frame-from-unexpected-.patch \
30 file://0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch \
31 file://0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch \
32 file://0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch \
Andrew Geissler90fd73c2021-03-05 15:25:55 -060033 file://CVE-2021-0326.patch \
Andrew Geissler95ac1b82021-03-31 14:34:31 -050034 file://CVE-2021-27803.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040035 "
Brad Bishop08902b02019-08-20 09:16:51 -040036SRC_URI[md5sum] = "2d2958c782576dc9901092fbfecb4190"
37SRC_URI[sha256sum] = "fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17"
Brad Bishopc342db32019-05-15 21:57:59 -040038
39CVE_PRODUCT = "wpa_supplicant"
40
41S = "${WORKDIR}/wpa_supplicant-${PV}"
42
43PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
44FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase"
45FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli"
Andrew Geissler5a43b432020-06-13 10:46:56 -050046FILES_${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*"
Brad Bishopc342db32019-05-15 21:57:59 -040047CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf"
48
49do_configure () {
50 ${MAKE} -C wpa_supplicant clean
51 install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config
Andrew Geissler5a43b432020-06-13 10:46:56 -050052
Brad Bishopc342db32019-05-15 21:57:59 -040053 if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then
54 ssl=openssl
55 elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then
56 ssl=gnutls
57 fi
58 if [ -n "$ssl" ]; then
59 sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config
60 fi
61
62 # For rebuild
63 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
64}
65
66export EXTRA_CFLAGS = "${CFLAGS}"
67export BINDIR = "${sbindir}"
68
69do_compile () {
70 unset CFLAGS CPPFLAGS CXXFLAGS
71 sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules
72 oe_runmake -C wpa_supplicant
73}
74
75do_install () {
76 install -d ${D}${sbindir}
77 install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir}
78 install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir}
79
80 install -d ${D}${bindir}
81 install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir}
82
83 install -d ${D}${docdir}/wpa_supplicant
84 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
85
86 install -d ${D}${sysconfdir}
87 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
88
89 install -d ${D}${sysconfdir}/network/if-pre-up.d/
90 install -d ${D}${sysconfdir}/network/if-post-down.d/
91 install -d ${D}${sysconfdir}/network/if-down.d/
92 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
93 cd ${D}${sysconfdir}/network/ && \
94 ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
95
96 install -d ${D}/${sysconfdir}/dbus-1/system.d
97 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
98 install -d ${D}/${datadir}/dbus-1/system-services
99 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
100
101 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
102 install -d ${D}/${systemd_unitdir}/system
103 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system
104 fi
105
106 install -d ${D}/etc/default/volatiles
107 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
108}
109
110pkg_postinst_wpa-supplicant () {
111 # If we're offline, we don't need to do this.
112 if [ "x$D" = "x" ]; then
113 killall -q -HUP dbus-daemon || true
114 fi
115
116}