blob: 46604045da1db7ec5df3f5b342da777124dcf6b4 [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 \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000021 "
22SRC_URI[sha256sum] = "20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f"
23
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000024S = "${WORKDIR}/wpa_supplicant-${PV}"
25
Patrick Williams03907ee2022-05-01 06:28:52 -050026inherit pkgconfig systemd
27
28PACKAGECONFIG ?= "openssl"
29PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt"
30PACKAGECONFIG[openssl] = ",,openssl"
31
32CVE_PRODUCT = "wpa_supplicant"
33
34EXTRA_OEMAKE = "'LIBDIR=${libdir}' 'INCDIR=${includedir}' 'BINDIR=${sbindir}'"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000035
36do_configure () {
37 ${MAKE} -C wpa_supplicant clean
Andrew Geisslerd5838332022-05-27 11:33:10 -050038 sed -e '/^CONFIG_TLS=/d' <wpa_supplicant/defconfig >wpa_supplicant/.config
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000039
Patrick Williams03907ee2022-05-01 06:28:52 -050040 if ${@ bb.utils.contains('PACKAGECONFIG', 'openssl', 'true', 'false', d) }; then
41 echo 'CONFIG_TLS=openssl' >>wpa_supplicant/.config
42 elif ${@ bb.utils.contains('PACKAGECONFIG', 'gnutls', 'true', 'false', d) }; then
43 echo 'CONFIG_TLS=gnutls' >>wpa_supplicant/.config
Andrew Geisslerd5838332022-05-27 11:33:10 -050044 sed -i -e 's/\(^CONFIG_DPP=\)/#\1/' \
45 -e 's/\(^CONFIG_EAP_PWD=\)/#\1/' \
46 -e 's/\(^CONFIG_SAE=\)/#\1/' wpa_supplicant/.config
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000047 fi
48
49 # For rebuild
50 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
51}
52
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000053do_compile () {
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000054 oe_runmake -C wpa_supplicant
Patrick Williams03907ee2022-05-01 06:28:52 -050055 if [ -z "${DISABLE_STATIC}" ]; then
56 oe_runmake -C wpa_supplicant libwpa_client.a
57 fi
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000058}
59
60do_install () {
Patrick Williams03907ee2022-05-01 06:28:52 -050061 oe_runmake -C wpa_supplicant DESTDIR="${D}" install
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000062
63 install -d ${D}${docdir}/wpa_supplicant
64 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
65
66 install -d ${D}${sysconfdir}
67 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
68
69 install -d ${D}${sysconfdir}/network/if-pre-up.d/
70 install -d ${D}${sysconfdir}/network/if-post-down.d/
71 install -d ${D}${sysconfdir}/network/if-down.d/
72 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
Patrick Williams03907ee2022-05-01 06:28:52 -050073 ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000074
75 install -d ${D}/${sysconfdir}/dbus-1/system.d
76 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
77 install -d ${D}/${datadir}/dbus-1/system-services
78 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
79
80 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
81 install -d ${D}/${systemd_system_unitdir}
82 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir}
83 fi
84
85 install -d ${D}/etc/default/volatiles
86 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
Patrick Williams03907ee2022-05-01 06:28:52 -050087
88 install -d ${D}${includedir}
89 install -m 0644 ${S}/src/common/wpa_ctrl.h ${D}${includedir}
90
91 if [ -z "${DISABLE_STATIC}" ]; then
92 install -d ${D}${libdir}
93 install -m 0644 wpa_supplicant/libwpa_client.a ${D}${libdir}
94 fi
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000095}
96
97pkg_postinst:${PN} () {
98 # If we're offline, we don't need to do this.
99 if [ "x$D" = "x" ]; then
100 killall -q -HUP dbus-daemon || true
101 fi
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000102}
Patrick Williams03907ee2022-05-01 06:28:52 -0500103
104PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli"
105PACKAGES =+ "${PN}-lib"
106PACKAGES += "${PN}-plugins"
107ALLOW_EMPTY:${PN}-plugins = "1"
108
109PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
110NOAUTOPACKAGEDEBUG = "1"
111
112FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase"
113FILES:${PN}-cli = "${sbindir}/wpa_cli"
114FILES:${PN}-lib = "${libdir}/libwpa_client*${SOLIBSDEV}"
115FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*"
116FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug"
117
118CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf"
119
120RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins"
121
122SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service"
123SYSTEMD_AUTO_ENABLE = "disable"
124
125python split_wpa_supplicant_libs () {
126 libdir = d.expand('${libdir}/wpa_supplicant')
127 dbglibdir = os.path.join(libdir, '.debug')
128
129 split_packages = do_split_packages(d, libdir, r'^(.*)\.so', '${PN}-plugin-%s', 'wpa_supplicant %s plugin', prepend=True)
130 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')
131
132 if split_packages:
133 pn = d.getVar('PN')
134 d.setVar('RRECOMMENDS:' + pn + '-plugins', ' '.join(split_packages))
135 d.appendVar('RRECOMMENDS:' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages))
136}
Andrew Geissler517393d2023-01-13 08:55:19 -0600137PACKAGESPLITFUNCS += "split_wpa_supplicant_libs"