blob: fad0f81d7feb24ce9f44f4a4d17ce2ac5abf3c2f [file] [log] [blame]
developer4e0da232022-05-09 13:05:53 +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"
10FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
11FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:"
12
developer42b63282022-06-16 13:33:13 +080013SRCREV ?= "b859b9bceadccd882252ff0aa2fdba0d3b91764e"
developer4e0da232022-05-09 13:05:53 +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 \
developer4e0da232022-05-09 13:05:53 +080019 file://wpa_supplicant-full.config \
20 file://src \
21 file://001-rdkb-remove-ubus-support.patch;apply=no \
22 "
23require files/patches/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
72 # OpenWRT hostapd Makefile add
73 echo "CONFIG_ACS=y" >> wpa_supplicant/.config
74 echo "CONFIG_IEEE80211AX=y" >> wpa_supplicant/.config
75 echo "CONFIG_TLS=openssl" >> wpa_supplicant/.config
76 echo "CONFIG_SAE=y" >> wpa_supplicant/.config
77 echo "CONFIG_OWE=y" >> wpa_supplicant/.config
78 echo "CONFIG_SUITEB192=y" >> wpa_supplicant/.config
79 echo "CONFIG_WEP=y" >> wpa_supplicant/.config
80 echo "CONFIG_AP=y" >> wpa_supplicant/.config
81 echo "CONFIG_MESH=y" >> wpa_supplicant/.config
82}
83
84do_compile () {
85 oe_runmake -C wpa_supplicant
86 oe_runmake -C wpa_supplicant libwpa_client.a
87}
88
89do_install () {
90 oe_runmake -C wpa_supplicant DESTDIR="${D}" install
91
92 install -d ${D}${docdir}/wpa_supplicant
93 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
94
95 install -d ${D}${sysconfdir}
96 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
97
98 install -d ${D}${sysconfdir}/network/if-pre-up.d/
99 install -d ${D}${sysconfdir}/network/if-post-down.d/
100 install -d ${D}${sysconfdir}/network/if-down.d/
101 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
102 ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant
103
104 install -d ${D}/${sysconfdir}/dbus-1/system.d
105 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
106 install -d ${D}/${datadir}/dbus-1/system-services
107 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
108
109 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
110 install -d ${D}/${systemd_system_unitdir}
111 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir}
112 fi
113
114 install -d ${D}/etc/default/volatiles
115 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
116
117 install -d ${D}${includedir}
118 install -m 0644 ${S}/src/common/wpa_ctrl.h ${D}${includedir}
119
120 install -d ${D}${libdir}
121 install -m 0644 ${S}/wpa_supplicant/libwpa_client.so ${D}${libdir}
122}
123
124pkg_postinst:${PN} () {
125 # If we're offline, we don't need to do this.
126 if [ "x$D" = "x" ]; then
127 killall -q -HUP dbus-daemon || true
128 fi
129}
130
131PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli"
132PACKAGES =+ "${PN}-lib"
133PACKAGES += "${PN}-plugins"
134ALLOW_EMPTY:${PN}-plugins = "1"
135
136PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
137NOAUTOPACKAGEDEBUG = "1"
138
139FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase"
140FILES:${PN}-cli = "${sbindir}/wpa_cli"
141FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*"
142FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug"
143
144CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf"
145
146RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins"
147
148SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service"
149SYSTEMD_AUTO_ENABLE = "disable"
150
151# move from cmf
152FILES_SOLIBSDEV = ""
153FILES_${PN} += "${libdir}/libwpa_client.so"
154