developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 1 | SUMMARY = "Client for Wi-Fi Protected Access (WPA)" |
| 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." |
| 3 | HOMEPAGE = "http://w1.fi/wpa_supplicant/" |
| 4 | BUGTRACKER = "http://w1.fi/security/" |
| 5 | SECTION = "network" |
| 6 | LICENSE = "BSD-3-Clause" |
| 7 | LIC_FILES_CHKSUM = "file://hostapd/README;md5=c905478466c90f1cefc0df987c40e172" |
| 8 | |
developer | bc262d5 | 2022-06-27 19:47:13 +0800 | [diff] [blame] | 9 | DEPENDS = "dbus libnl ubus" |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 10 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" |
| 11 | FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:" |
| 12 | |
developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 13 | SRCREV ?= "b704dc72ef824dfdd96674b90179b274d1d38105" |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 14 | SRC_URI = "git://w1.fi/hostap.git;protocol=https;branch=main \ |
| 15 | file://wpa-supplicant.sh \ |
| 16 | file://wpa_supplicant.conf \ |
| 17 | file://wpa_supplicant.conf-sane \ |
| 18 | file://99_wpa_supplicant \ |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 19 | file://wpa_supplicant-full.config \ |
| 20 | file://src \ |
| 21 | file://001-rdkb-remove-ubus-support.patch;apply=no \ |
| 22 | " |
| 23 | require files/patches/patches.inc |
| 24 | |
| 25 | S = "${WORKDIR}/git" |
| 26 | |
| 27 | inherit pkgconfig systemd |
| 28 | |
| 29 | PACKAGECONFIG ?= "openssl" |
| 30 | PACKAGECONFIG[openssl] = ",,openssl" |
| 31 | |
| 32 | CVE_PRODUCT = "wpa_supplicant" |
| 33 | |
| 34 | EXTRA_OEMAKE = "'LIBDIR=${libdir}' 'INCDIR=${includedir}' 'BINDIR=${sbindir}'" |
| 35 | |
| 36 | do_unpack_append() { |
| 37 | bb.build.exec_func('do_copy_openwrt_src', d) |
| 38 | } |
| 39 | |
| 40 | do_copy_openwrt_src() { |
| 41 | cp -Rfp ${WORKDIR}/src/* ${S}/ |
| 42 | } |
| 43 | |
| 44 | do_filogic_patches() { |
| 45 | cd ${S} |
| 46 | if [ ! -e patch_applied ]; then |
| 47 | patch -p1 < ${WORKDIR}/001-rdkb-remove-ubus-support.patch |
| 48 | touch patch_applied |
| 49 | fi |
| 50 | } |
| 51 | |
| 52 | addtask filogic_patches after do_patch before do_compile |
| 53 | |
| 54 | do_configure () { |
| 55 | ${MAKE} -C wpa_supplicant clean |
| 56 | |
| 57 | # For rebuild |
| 58 | rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d |
| 59 | } |
| 60 | |
| 61 | do_configure_append () { |
| 62 | # from Openwrt defconfig |
| 63 | install -m 0644 ${WORKDIR}/wpa_supplicant-full.config wpa_supplicant/.config |
| 64 | |
| 65 | # RDKB |
| 66 | echo "CONFIG_BUILD_WPA_CLIENT_SO=y" >> wpa_supplicant/.config |
| 67 | |
| 68 | # mtk add |
| 69 | echo "CONFIG_MBO=y" >> wpa_supplicant/.config |
| 70 | echo "CONFIG_WPS_UPNP=y" >> wpa_supplicant/.config |
developer | 17732dd | 2022-07-05 14:59:41 +0800 | [diff] [blame] | 71 | echo "CONFIG_DPP=y" >> wpa_supplicant/.config |
| 72 | echo "CONFIG_DPP2=y" >> wpa_supplicant/.config |
| 73 | echo "CONFIG_DPP3=y" >> wpa_supplicant/.config |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 74 | |
| 75 | # OpenWRT hostapd Makefile add |
| 76 | echo "CONFIG_ACS=y" >> wpa_supplicant/.config |
| 77 | echo "CONFIG_IEEE80211AX=y" >> wpa_supplicant/.config |
| 78 | echo "CONFIG_TLS=openssl" >> wpa_supplicant/.config |
| 79 | echo "CONFIG_SAE=y" >> wpa_supplicant/.config |
| 80 | echo "CONFIG_OWE=y" >> wpa_supplicant/.config |
| 81 | echo "CONFIG_SUITEB192=y" >> wpa_supplicant/.config |
| 82 | echo "CONFIG_WEP=y" >> wpa_supplicant/.config |
| 83 | echo "CONFIG_AP=y" >> wpa_supplicant/.config |
| 84 | echo "CONFIG_MESH=y" >> wpa_supplicant/.config |
| 85 | } |
| 86 | |
| 87 | do_compile () { |
| 88 | oe_runmake -C wpa_supplicant |
| 89 | oe_runmake -C wpa_supplicant libwpa_client.a |
| 90 | } |
| 91 | |
| 92 | do_install () { |
| 93 | oe_runmake -C wpa_supplicant DESTDIR="${D}" install |
| 94 | |
| 95 | install -d ${D}${docdir}/wpa_supplicant |
| 96 | install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant |
| 97 | |
| 98 | install -d ${D}${sysconfdir} |
| 99 | install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf |
| 100 | |
| 101 | install -d ${D}${sysconfdir}/network/if-pre-up.d/ |
| 102 | install -d ${D}${sysconfdir}/network/if-post-down.d/ |
| 103 | install -d ${D}${sysconfdir}/network/if-down.d/ |
| 104 | install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant |
| 105 | ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant |
| 106 | |
| 107 | install -d ${D}/${sysconfdir}/dbus-1/system.d |
| 108 | install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d |
| 109 | install -d ${D}/${datadir}/dbus-1/system-services |
| 110 | install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services |
| 111 | |
| 112 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 113 | install -d ${D}/${systemd_system_unitdir} |
| 114 | install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir} |
| 115 | fi |
| 116 | |
| 117 | install -d ${D}/etc/default/volatiles |
| 118 | install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles |
| 119 | |
| 120 | install -d ${D}${includedir} |
| 121 | install -m 0644 ${S}/src/common/wpa_ctrl.h ${D}${includedir} |
| 122 | |
| 123 | install -d ${D}${libdir} |
| 124 | install -m 0644 ${S}/wpa_supplicant/libwpa_client.so ${D}${libdir} |
| 125 | } |
| 126 | |
| 127 | pkg_postinst:${PN} () { |
| 128 | # If we're offline, we don't need to do this. |
| 129 | if [ "x$D" = "x" ]; then |
| 130 | killall -q -HUP dbus-daemon || true |
| 131 | fi |
| 132 | } |
| 133 | |
| 134 | PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli" |
| 135 | PACKAGES =+ "${PN}-lib" |
| 136 | PACKAGES += "${PN}-plugins" |
| 137 | ALLOW_EMPTY:${PN}-plugins = "1" |
| 138 | |
| 139 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*$" |
| 140 | NOAUTOPACKAGEDEBUG = "1" |
| 141 | |
| 142 | FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase" |
| 143 | FILES:${PN}-cli = "${sbindir}/wpa_cli" |
| 144 | FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*" |
| 145 | FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug" |
| 146 | |
| 147 | CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf" |
| 148 | |
| 149 | RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins" |
| 150 | |
| 151 | SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service" |
| 152 | SYSTEMD_AUTO_ENABLE = "disable" |
| 153 | |
| 154 | # move from cmf |
| 155 | FILES_SOLIBSDEV = "" |
| 156 | FILES_${PN} += "${libdir}/libwpa_client.so" |
| 157 | |