blob: 22028ce957536bb84119ff86bf5f2c43e0c15241 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00002DESCRIPTION = "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."
Patrick Williams03907ee2022-05-01 06:28:52 -05003HOMEPAGE = "http://w1.fi/wpa_supplicant/"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00004BUGTRACKER = "http://w1.fi/security/"
5SECTION = "network"
6LICENSE = "BSD-3-Clause"
7LIC_FILES_CHKSUM = "file://COPYING;md5=5ebcb90236d1ad640558c3d3cd3035df \
8 file://README;beginline=1;endline=56;md5=e3d2f6c2948991e37c1ca4960de84747 \
9 file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=76306a95306fee9a976b0ac1be70f705"
Patrick Williams03907ee2022-05-01 06:28:52 -050010
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000011DEPENDS = "dbus libnl"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000012
13SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000014 file://wpa-supplicant.sh \
15 file://wpa_supplicant.conf \
16 file://wpa_supplicant.conf-sane \
17 file://99_wpa_supplicant \
Patrick Williams03907ee2022-05-01 06:28:52 -050018 file://0001-build-Re-enable-options-for-libwpa_client.so-and-wpa.patch \
19 file://0002-Fix-removal-of-wpa_passphrase-on-make-clean.patch \
20 file://0001-Install-wpa_passphrase-when-not-disabled.patch \
Patrick Williams39653562024-03-01 08:54:02 -060021 file://0001-PEAP-client-Update-Phase-2-authentication-requiremen.patch \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000022 "
23SRC_URI[sha256sum] = "20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f"
24
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000025S = "${WORKDIR}/wpa_supplicant-${PV}"
26
Patrick Williams03907ee2022-05-01 06:28:52 -050027inherit pkgconfig systemd
28
29PACKAGECONFIG ?= "openssl"
30PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt"
31PACKAGECONFIG[openssl] = ",,openssl"
32
33CVE_PRODUCT = "wpa_supplicant"
34
35EXTRA_OEMAKE = "'LIBDIR=${libdir}' 'INCDIR=${includedir}' 'BINDIR=${sbindir}'"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000036
37do_configure () {
38 ${MAKE} -C wpa_supplicant clean
Andrew Geisslerd5838332022-05-27 11:33:10 -050039 sed -e '/^CONFIG_TLS=/d' <wpa_supplicant/defconfig >wpa_supplicant/.config
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000040
Patrick Williams03907ee2022-05-01 06:28:52 -050041 if ${@ bb.utils.contains('PACKAGECONFIG', 'openssl', 'true', 'false', d) }; then
42 echo 'CONFIG_TLS=openssl' >>wpa_supplicant/.config
43 elif ${@ bb.utils.contains('PACKAGECONFIG', 'gnutls', 'true', 'false', d) }; then
44 echo 'CONFIG_TLS=gnutls' >>wpa_supplicant/.config
Andrew Geisslerd5838332022-05-27 11:33:10 -050045 sed -i -e 's/\(^CONFIG_DPP=\)/#\1/' \
46 -e 's/\(^CONFIG_EAP_PWD=\)/#\1/' \
47 -e 's/\(^CONFIG_SAE=\)/#\1/' wpa_supplicant/.config
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000048 fi
49
50 # For rebuild
51 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
52}
53
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000054do_compile () {
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000055 oe_runmake -C wpa_supplicant
Patrick Williams03907ee2022-05-01 06:28:52 -050056 if [ -z "${DISABLE_STATIC}" ]; then
57 oe_runmake -C wpa_supplicant libwpa_client.a
58 fi
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000059}
60
61do_install () {
Patrick Williams03907ee2022-05-01 06:28:52 -050062 oe_runmake -C wpa_supplicant DESTDIR="${D}" install
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000063
64 install -d ${D}${docdir}/wpa_supplicant
65 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
66
67 install -d ${D}${sysconfdir}
68 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
69
70 install -d ${D}${sysconfdir}/network/if-pre-up.d/
71 install -d ${D}${sysconfdir}/network/if-post-down.d/
72 install -d ${D}${sysconfdir}/network/if-down.d/
73 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
Patrick Williams03907ee2022-05-01 06:28:52 -050074 ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000075
76 install -d ${D}/${sysconfdir}/dbus-1/system.d
77 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
78 install -d ${D}/${datadir}/dbus-1/system-services
79 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
80
81 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
82 install -d ${D}/${systemd_system_unitdir}
83 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir}
84 fi
85
86 install -d ${D}/etc/default/volatiles
87 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
Patrick Williams03907ee2022-05-01 06:28:52 -050088
89 install -d ${D}${includedir}
90 install -m 0644 ${S}/src/common/wpa_ctrl.h ${D}${includedir}
91
92 if [ -z "${DISABLE_STATIC}" ]; then
93 install -d ${D}${libdir}
94 install -m 0644 wpa_supplicant/libwpa_client.a ${D}${libdir}
95 fi
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000096}
97
98pkg_postinst:${PN} () {
99 # If we're offline, we don't need to do this.
100 if [ "x$D" = "x" ]; then
101 killall -q -HUP dbus-daemon || true
102 fi
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000103}
Patrick Williams03907ee2022-05-01 06:28:52 -0500104
105PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli"
106PACKAGES =+ "${PN}-lib"
107PACKAGES += "${PN}-plugins"
108ALLOW_EMPTY:${PN}-plugins = "1"
109
110PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
111NOAUTOPACKAGEDEBUG = "1"
112
113FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase"
114FILES:${PN}-cli = "${sbindir}/wpa_cli"
115FILES:${PN}-lib = "${libdir}/libwpa_client*${SOLIBSDEV}"
116FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*"
117FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug"
118
119CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf"
120
121RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins"
122
123SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service"
124SYSTEMD_AUTO_ENABLE = "disable"
125
126python split_wpa_supplicant_libs () {
127 libdir = d.expand('${libdir}/wpa_supplicant')
128 dbglibdir = os.path.join(libdir, '.debug')
129
130 split_packages = do_split_packages(d, libdir, r'^(.*)\.so', '${PN}-plugin-%s', 'wpa_supplicant %s plugin', prepend=True)
131 split_dbg_packages = do_split_packages(d, dbglibdir, r'^(.*)\.so', '${PN}-plugin-%s-dbg', 'wpa_supplicant %s plugin - Debugging files', prepend=True, extra_depends='${PN}-dbg')
132
133 if split_packages:
134 pn = d.getVar('PN')
135 d.setVar('RRECOMMENDS:' + pn + '-plugins', ' '.join(split_packages))
136 d.appendVar('RRECOMMENDS:' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages))
137}
Andrew Geissler517393d2023-01-13 08:55:19 -0600138PACKAGESPLITFUNCS += "split_wpa_supplicant_libs"