blob: e68453748653c84b5959cbd78c53760abe0c2334 [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 Bishop6e60e8b2018-02-01 10:27:11 -050035 "
36SRC_URI[md5sum] = "091569eb4440b7d7f2b4276dbfc03c3c"
37SRC_URI[sha256sum] = "b4936d34c4e6cdd44954beba74296d964bc2c9668ecaa5255e499636fe2b1450"
38
39CVE_PRODUCT = "wpa_supplicant"
40
41S = "${WORKDIR}/wpa_supplicant-${PV}"
42
43PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
44FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase"
45FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli"
46FILES_${PN} += "${datadir}/dbus-1/system-services/*"
47CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf"
48
49do_configure () {
50 ${MAKE} -C wpa_supplicant clean
51 install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config
52 echo "CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
53 echo "DRV_CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
54
55 if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then
56 ssl=openssl
57 elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then
58 ssl=gnutls
59 fi
60 if [ -n "$ssl" ]; then
61 sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config
62 fi
63
64 # For rebuild
65 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
66}
67
68export EXTRA_CFLAGS = "${CFLAGS}"
69export BINDIR = "${sbindir}"
70
71do_compile () {
72 unset CFLAGS CPPFLAGS CXXFLAGS
73 sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules
74 oe_runmake -C wpa_supplicant
75}
76
77do_install () {
78 install -d ${D}${sbindir}
79 install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir}
80 install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir}
81
82 install -d ${D}${bindir}
83 install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir}
84
85 install -d ${D}${docdir}/wpa_supplicant
86 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
87
88 install -d ${D}${sysconfdir}
89 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
90
91 install -d ${D}${sysconfdir}/network/if-pre-up.d/
92 install -d ${D}${sysconfdir}/network/if-post-down.d/
93 install -d ${D}${sysconfdir}/network/if-down.d/
94 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
95 cd ${D}${sysconfdir}/network/ && \
96 ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
97
98 install -d ${D}/${sysconfdir}/dbus-1/system.d
99 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
100 install -d ${D}/${datadir}/dbus-1/system-services
101 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
102
103 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
104 install -d ${D}/${systemd_unitdir}/system
105 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system
106 fi
107
108 install -d ${D}/etc/default/volatiles
109 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
110}
111
112pkg_postinst_wpa-supplicant () {
113 # If we're offline, we don't need to do this.
114 if [ "x$D" = "x" ]; then
115 killall -q -HUP dbus-daemon || true
116 fi
117
118}