blob: aa4c4c2da002b2af55bd2b8fadb6564bcdee6658 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
2HOMEPAGE = "http://w1.fi/wpa_supplicant/"
3BUGTRACKER = "http://w1.fi/security/"
4SECTION = "network"
5LICENSE = "BSD"
6LIC_FILES_CHKSUM = "file://COPYING;md5=292eece3f2ebbaa25608eed8464018a3 \
7 file://README;beginline=1;endline=56;md5=3f01d778be8f953962388307ee38ed2b \
8 file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=4061612fc5715696134e3baf933e8aba"
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
18SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service"
19SYSTEMD_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 \
Brad Bishopd5ae7d92018-06-14 09:52:03 -070027 file://key-replay-cve-multiple1.patch \
28 file://key-replay-cve-multiple2.patch \
29 file://key-replay-cve-multiple3.patch \
30 file://key-replay-cve-multiple4.patch \
31 file://key-replay-cve-multiple5.patch \
32 file://key-replay-cve-multiple6.patch \
33 file://key-replay-cve-multiple7.patch \
34 file://key-replay-cve-multiple8.patch \
Brad Bishopbba38f32018-08-23 16:11:46 +080035 file://wpa_supplicant-CVE-2018-14526.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050036 "
37SRC_URI[md5sum] = "091569eb4440b7d7f2b4276dbfc03c3c"
38SRC_URI[sha256sum] = "b4936d34c4e6cdd44954beba74296d964bc2c9668ecaa5255e499636fe2b1450"
39
40CVE_PRODUCT = "wpa_supplicant"
41
42S = "${WORKDIR}/wpa_supplicant-${PV}"
43
44PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
45FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase"
46FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli"
47FILES_${PN} += "${datadir}/dbus-1/system-services/*"
48CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf"
49
50do_configure () {
51 ${MAKE} -C wpa_supplicant clean
52 install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config
53 echo "CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
54 echo "DRV_CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
55
56 if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then
57 ssl=openssl
58 elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then
59 ssl=gnutls
60 fi
61 if [ -n "$ssl" ]; then
62 sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config
63 fi
64
65 # For rebuild
66 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
67}
68
69export EXTRA_CFLAGS = "${CFLAGS}"
70export BINDIR = "${sbindir}"
71
72do_compile () {
73 unset CFLAGS CPPFLAGS CXXFLAGS
74 sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules
75 oe_runmake -C wpa_supplicant
76}
77
78do_install () {
79 install -d ${D}${sbindir}
80 install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir}
81 install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir}
82
83 install -d ${D}${bindir}
84 install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir}
85
86 install -d ${D}${docdir}/wpa_supplicant
87 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
88
89 install -d ${D}${sysconfdir}
90 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
91
92 install -d ${D}${sysconfdir}/network/if-pre-up.d/
93 install -d ${D}${sysconfdir}/network/if-post-down.d/
94 install -d ${D}${sysconfdir}/network/if-down.d/
95 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
96 cd ${D}${sysconfdir}/network/ && \
97 ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
98
99 install -d ${D}/${sysconfdir}/dbus-1/system.d
100 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
101 install -d ${D}/${datadir}/dbus-1/system-services
102 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
103
104 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
105 install -d ${D}/${systemd_unitdir}/system
106 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system
107 fi
108
109 install -d ${D}/etc/default/volatiles
110 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
111}
112
113pkg_postinst_wpa-supplicant () {
114 # If we're offline, we don't need to do this.
115 if [ "x$D" = "x" ]; then
116 killall -q -HUP dbus-daemon || true
117 fi
118
119}