blob: aee56578d2e278459b061de59fa3bd7d0bc1abdd [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
Patrick Williams03907ee2022-05-01 06:28:52 -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 Geissler7e0e3c02022-02-25 20:34:39 +000044 fi
45
46 # For rebuild
47 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
48}
49
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000050do_compile () {
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000051 oe_runmake -C wpa_supplicant
Patrick Williams03907ee2022-05-01 06:28:52 -050052 if [ -z "${DISABLE_STATIC}" ]; then
53 oe_runmake -C wpa_supplicant libwpa_client.a
54 fi
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000055}
56
57do_install () {
Patrick Williams03907ee2022-05-01 06:28:52 -050058 oe_runmake -C wpa_supplicant DESTDIR="${D}" install
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000059
60 install -d ${D}${docdir}/wpa_supplicant
61 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
62
63 install -d ${D}${sysconfdir}
64 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
65
66 install -d ${D}${sysconfdir}/network/if-pre-up.d/
67 install -d ${D}${sysconfdir}/network/if-post-down.d/
68 install -d ${D}${sysconfdir}/network/if-down.d/
69 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
Patrick Williams03907ee2022-05-01 06:28:52 -050070 ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000071
72 install -d ${D}/${sysconfdir}/dbus-1/system.d
73 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
74 install -d ${D}/${datadir}/dbus-1/system-services
75 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
76
77 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
78 install -d ${D}/${systemd_system_unitdir}
79 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir}
80 fi
81
82 install -d ${D}/etc/default/volatiles
83 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
Patrick Williams03907ee2022-05-01 06:28:52 -050084
85 install -d ${D}${includedir}
86 install -m 0644 ${S}/src/common/wpa_ctrl.h ${D}${includedir}
87
88 if [ -z "${DISABLE_STATIC}" ]; then
89 install -d ${D}${libdir}
90 install -m 0644 wpa_supplicant/libwpa_client.a ${D}${libdir}
91 fi
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000092}
93
94pkg_postinst:${PN} () {
95 # If we're offline, we don't need to do this.
96 if [ "x$D" = "x" ]; then
97 killall -q -HUP dbus-daemon || true
98 fi
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000099}
Patrick Williams03907ee2022-05-01 06:28:52 -0500100
101PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli"
102PACKAGES =+ "${PN}-lib"
103PACKAGES += "${PN}-plugins"
104ALLOW_EMPTY:${PN}-plugins = "1"
105
106PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
107NOAUTOPACKAGEDEBUG = "1"
108
109FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase"
110FILES:${PN}-cli = "${sbindir}/wpa_cli"
111FILES:${PN}-lib = "${libdir}/libwpa_client*${SOLIBSDEV}"
112FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*"
113FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug"
114
115CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf"
116
117RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins"
118
119SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service"
120SYSTEMD_AUTO_ENABLE = "disable"
121
122python split_wpa_supplicant_libs () {
123 libdir = d.expand('${libdir}/wpa_supplicant')
124 dbglibdir = os.path.join(libdir, '.debug')
125
126 split_packages = do_split_packages(d, libdir, r'^(.*)\.so', '${PN}-plugin-%s', 'wpa_supplicant %s plugin', prepend=True)
127 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')
128
129 if split_packages:
130 pn = d.getVar('PN')
131 d.setVar('RRECOMMENDS:' + pn + '-plugins', ' '.join(split_packages))
132 d.appendVar('RRECOMMENDS:' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages))
133}
134PACKAGESPLITFUNCS:prepend = "split_wpa_supplicant_libs "