blob: 2936e89eed98146a0306f06244a85ef71546aa11 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
2HOMEPAGE = "http://w1.fi/wpa_supplicant/"
3BUGTRACKER = "http://w1.fi/security/"
4SECTION = "network"
Brad Bishopf3f93bb2019-10-16 14:33:32 -04005LICENSE = "BSD-3-Clause"
Brad Bishopc342db32019-05-15 21:57:59 -04006LIC_FILES_CHKSUM = "file://COPYING;md5=279b4f5abb9c153c285221855ddb78cc \
7 file://README;beginline=1;endline=56;md5=e7d3dbb01f75f0b9799e192731d1e1ff \
8 file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=0a8b56d3543498b742b9c0e94cc2d18b"
9DEPENDS = "dbus libnl"
10RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
11
12PACKAGECONFIG ??= "gnutls"
13PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt"
14PACKAGECONFIG[openssl] = ",,openssl"
15
16inherit pkgconfig systemd
17
Andrew Geissler5a43b432020-06-13 10:46:56 -050018SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service"
Brad Bishopc342db32019-05-15 21:57:59 -040019SYSTEMD_AUTO_ENABLE = "disable"
20
21SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
22 file://defconfig \
23 file://wpa-supplicant.sh \
24 file://wpa_supplicant.conf \
25 file://wpa_supplicant.conf-sane \
26 file://99_wpa_supplicant \
27 file://0001-replace-systemd-install-Alias-with-WantedBy.patch \
Brad Bishop64c979e2019-11-04 13:55:29 -050028 file://0001-AP-Silently-ignore-management-frame-from-unexpected-.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040029 "
Brad Bishop08902b02019-08-20 09:16:51 -040030SRC_URI[md5sum] = "2d2958c782576dc9901092fbfecb4190"
31SRC_URI[sha256sum] = "fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17"
Brad Bishopc342db32019-05-15 21:57:59 -040032
33CVE_PRODUCT = "wpa_supplicant"
34
35S = "${WORKDIR}/wpa_supplicant-${PV}"
36
37PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
38FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase"
39FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli"
Andrew Geissler5a43b432020-06-13 10:46:56 -050040FILES_${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*"
Brad Bishopc342db32019-05-15 21:57:59 -040041CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf"
42
43do_configure () {
44 ${MAKE} -C wpa_supplicant clean
45 install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config
Andrew Geissler5a43b432020-06-13 10:46:56 -050046
Brad Bishopc342db32019-05-15 21:57:59 -040047 if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then
48 ssl=openssl
49 elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then
50 ssl=gnutls
51 fi
52 if [ -n "$ssl" ]; then
53 sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config
54 fi
55
56 # For rebuild
57 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
58}
59
60export EXTRA_CFLAGS = "${CFLAGS}"
61export BINDIR = "${sbindir}"
62
63do_compile () {
64 unset CFLAGS CPPFLAGS CXXFLAGS
65 sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules
66 oe_runmake -C wpa_supplicant
67}
68
69do_install () {
70 install -d ${D}${sbindir}
71 install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir}
72 install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir}
73
74 install -d ${D}${bindir}
75 install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir}
76
77 install -d ${D}${docdir}/wpa_supplicant
78 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
79
80 install -d ${D}${sysconfdir}
81 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
82
83 install -d ${D}${sysconfdir}/network/if-pre-up.d/
84 install -d ${D}${sysconfdir}/network/if-post-down.d/
85 install -d ${D}${sysconfdir}/network/if-down.d/
86 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
87 cd ${D}${sysconfdir}/network/ && \
88 ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
89
90 install -d ${D}/${sysconfdir}/dbus-1/system.d
91 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
92 install -d ${D}/${datadir}/dbus-1/system-services
93 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
94
95 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
96 install -d ${D}/${systemd_unitdir}/system
97 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system
98 fi
99
100 install -d ${D}/etc/default/volatiles
101 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
102}
103
104pkg_postinst_wpa-supplicant () {
105 # If we're offline, we don't need to do this.
106 if [ "x$D" = "x" ]; then
107 killall -q -HUP dbus-daemon || true
108 fi
109
110}