Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | SUMMARY = "Client for Wi-Fi Protected Access (WPA)" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 2 | DESCRIPTION = "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 Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 3 | HOMEPAGE = "http://w1.fi/wpa_supplicant/" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 4 | BUGTRACKER = "http://w1.fi/security/" |
| 5 | SECTION = "network" |
| 6 | LICENSE = "BSD-3-Clause" |
| 7 | LIC_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 Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 10 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 11 | DEPENDS = "dbus libnl" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 12 | |
| 13 | SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 14 | file://wpa-supplicant.sh \ |
| 15 | file://wpa_supplicant.conf \ |
| 16 | file://wpa_supplicant.conf-sane \ |
| 17 | file://99_wpa_supplicant \ |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 18 | 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 Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 21 | " |
| 22 | SRC_URI[sha256sum] = "20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f" |
| 23 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 24 | S = "${WORKDIR}/wpa_supplicant-${PV}" |
| 25 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 26 | inherit pkgconfig systemd |
| 27 | |
| 28 | PACKAGECONFIG ?= "openssl" |
| 29 | PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt" |
| 30 | PACKAGECONFIG[openssl] = ",,openssl" |
| 31 | |
| 32 | CVE_PRODUCT = "wpa_supplicant" |
| 33 | |
| 34 | EXTRA_OEMAKE = "'LIBDIR=${libdir}' 'INCDIR=${includedir}' 'BINDIR=${sbindir}'" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 35 | |
| 36 | do_configure () { |
| 37 | ${MAKE} -C wpa_supplicant clean |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 38 | sed -e '/^CONFIG_TLS=/d' <wpa_supplicant/defconfig >wpa_supplicant/.config |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 39 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 40 | 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 Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 44 | sed -i -e 's/\(^CONFIG_DPP=\)/#\1/' \ |
| 45 | -e 's/\(^CONFIG_EAP_PWD=\)/#\1/' \ |
| 46 | -e 's/\(^CONFIG_SAE=\)/#\1/' wpa_supplicant/.config |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 47 | fi |
| 48 | |
| 49 | # For rebuild |
| 50 | rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d |
| 51 | } |
| 52 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 53 | do_compile () { |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 54 | oe_runmake -C wpa_supplicant |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 55 | if [ -z "${DISABLE_STATIC}" ]; then |
| 56 | oe_runmake -C wpa_supplicant libwpa_client.a |
| 57 | fi |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | do_install () { |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 61 | oe_runmake -C wpa_supplicant DESTDIR="${D}" install |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 62 | |
| 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 Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 73 | ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 74 | |
| 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 Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 87 | |
| 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 Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | pkg_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 Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 102 | } |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 103 | |
| 104 | PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli" |
| 105 | PACKAGES =+ "${PN}-lib" |
| 106 | PACKAGES += "${PN}-plugins" |
| 107 | ALLOW_EMPTY:${PN}-plugins = "1" |
| 108 | |
| 109 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*$" |
| 110 | NOAUTOPACKAGEDEBUG = "1" |
| 111 | |
| 112 | FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase" |
| 113 | FILES:${PN}-cli = "${sbindir}/wpa_cli" |
| 114 | FILES:${PN}-lib = "${libdir}/libwpa_client*${SOLIBSDEV}" |
| 115 | FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*" |
| 116 | FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug" |
| 117 | |
| 118 | CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf" |
| 119 | |
| 120 | RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins" |
| 121 | |
| 122 | SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service" |
| 123 | SYSTEMD_AUTO_ENABLE = "disable" |
| 124 | |
| 125 | python 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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 137 | PACKAGESPLITFUNCS += "split_wpa_supplicant_libs" |