blob: 0f446aab820b3306e9786305bddff8455b45e282 [file] [log] [blame]
developer29c4d2d2022-12-26 19:41:22 +08001SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
2DESCRIPTION = "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."
3HOMEPAGE = "http://w1.fi/wpa_supplicant/"
4BUGTRACKER = "http://w1.fi/security/"
5SECTION = "network"
6LICENSE = "BSD-3-Clause"
7LIC_FILES_CHKSUM = "file://hostapd/README;md5=c905478466c90f1cefc0df987c40e172"
8
9DEPENDS = "dbus libnl ubus"
10FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
11FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches-${PV}:"
12
developer8bff6472023-07-17 11:11:44 +080013SRCREV ?= "599d00be9de2846c6ea18c1487d8329522ade22b"
developer29c4d2d2022-12-26 19:41:22 +080014SRC_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 \
19 file://wpa_supplicant-full.config \
20 file://src \
21 file://001-rdkb-remove-ubus-support.patch;apply=no \
22 "
23require files/patches-${PV}/patches.inc
24
25S = "${WORKDIR}/git"
26
27inherit pkgconfig systemd
28
29PACKAGECONFIG ?= "openssl"
30PACKAGECONFIG[openssl] = ",,openssl"
31
32CVE_PRODUCT = "wpa_supplicant"
33
34EXTRA_OEMAKE = "'LIBDIR=${libdir}' 'INCDIR=${includedir}' 'BINDIR=${sbindir}'"
35
36do_unpack_append() {
37 bb.build.exec_func('do_copy_openwrt_src', d)
38}
39
40do_copy_openwrt_src() {
41 cp -Rfp ${WORKDIR}/src/* ${S}/
42}
43
44do_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
52addtask filogic_patches after do_patch before do_compile
53
54do_configure () {
55 ${MAKE} -C wpa_supplicant clean
56
57 # For rebuild
58 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
59}
60
61do_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
71 echo "CONFIG_DPP=y" >> wpa_supplicant/.config
72 echo "CONFIG_DPP2=y" >> wpa_supplicant/.config
73 echo "CONFIG_DPP3=y" >> wpa_supplicant/.config
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
developer78848c62023-04-06 13:44:00 +080085 echo "CONFIG_IEEE80211BE=y" >> wpa_supplicant/.config
86 echo "CONFIG_HE_OVERRIDES=y" >> wpa_supplicant/.config
87 echo "CONFIG_EHT_OVERRIDES=y" >> wpa_supplicant/.config
developer29c4d2d2022-12-26 19:41:22 +080088}
89
90do_compile () {
91 oe_runmake -C wpa_supplicant
92 oe_runmake -C wpa_supplicant libwpa_client.a
93}
94
95do_install () {
96 oe_runmake -C wpa_supplicant DESTDIR="${D}" install
97
98 install -d ${D}${docdir}/wpa_supplicant
99 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
100
101 install -d ${D}${sysconfdir}
102 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
103
104 install -d ${D}${sysconfdir}/network/if-pre-up.d/
105 install -d ${D}${sysconfdir}/network/if-post-down.d/
106 install -d ${D}${sysconfdir}/network/if-down.d/
107 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
108 ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant
109
110 install -d ${D}/${sysconfdir}/dbus-1/system.d
111 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
112 install -d ${D}/${datadir}/dbus-1/system-services
113 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
114
115 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
116 install -d ${D}/${systemd_system_unitdir}
117 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir}
118 fi
119
120 install -d ${D}/etc/default/volatiles
121 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
122
123 install -d ${D}${includedir}
124 install -m 0644 ${S}/src/common/wpa_ctrl.h ${D}${includedir}
125
126 install -d ${D}${libdir}
127 install -m 0644 ${S}/wpa_supplicant/libwpa_client.so ${D}${libdir}
128}
129
130pkg_postinst:${PN} () {
131 # If we're offline, we don't need to do this.
132 if [ "x$D" = "x" ]; then
133 killall -q -HUP dbus-daemon || true
134 fi
135}
136
137PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli"
138PACKAGES =+ "${PN}-lib"
139PACKAGES += "${PN}-plugins"
140ALLOW_EMPTY:${PN}-plugins = "1"
141
142PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
143NOAUTOPACKAGEDEBUG = "1"
144
145FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase"
146FILES:${PN}-cli = "${sbindir}/wpa_cli"
147FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*"
148FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug"
149
150CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf"
151
152RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins"
153
154SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service"
155SYSTEMD_AUTO_ENABLE = "disable"
156
157# move from cmf
158FILES_SOLIBSDEV = ""
159FILES_${PN} += "${libdir}/libwpa_client.so"
160