summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/wpa-supplicant/wpa-supplicant.inc')
-rw-r--r--meta/recipes-connectivity/wpa-supplicant/wpa-supplicant.inc107
1 files changed, 107 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant.inc b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant.inc
new file mode 100644
index 0000000..7923bb9
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant.inc
@@ -0,0 +1,107 @@
1SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
2HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/"
3BUGTRACKER = "http://hostap.epitest.fi/bugz/"
4SECTION = "network"
5LICENSE = "BSD"
6LIC_FILES_CHKSUM = "file://COPYING;md5=ab87f20cd7e8c0d0a6539b34d3791d0e \
7 file://README;beginline=1;endline=56;md5=a07250b28e857455336bb59fc31cb845 \
8 file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=e8e021e30f3a6ab7c341b66b86626a5a"
9DEPENDS = "dbus libnl libgcrypt"
10RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
11
12PACKAGECONFIG ??= "gnutls"
13PACKAGECONFIG[gnutls] = ",,gnutls"
14PACKAGECONFIG[openssl] = ",,openssl"
15
16inherit systemd
17
18SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service"
19SYSTEMD_AUTO_ENABLE = "disable"
20
21SRC_URI = "http://hostap.epitest.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://fix-libnl3-host-contamination.patch \
28 "
29SRC_URI[md5sum] = "238e8e888bbd558e1a57e3eb28d1dd07"
30SRC_URI[sha256sum] = "e0d8b8fd68a659636eaba246bb2caacbf53d22d53b2b6b90eb4b4fef0993c8ed"
31
32S = "${WORKDIR}/wpa_supplicant-${PV}"
33
34PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
35FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase"
36FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli"
37FILES_${PN} += "${datadir}/dbus-1/system-services/*"
38CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf"
39
40do_configure () {
41 install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config
42 echo "CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
43
44 if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then
45 ssl=openssl
46 elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then
47 ssl=gnutls
48 fi
49 if [ -n "$ssl" ]; then
50 sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config
51 fi
52
53 # For rebuild
54 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
55}
56
57export EXTRA_CFLAGS = "${CFLAGS}"
58export BINDIR = "${sbindir}"
59
60do_compile () {
61 unset CFLAGS CPPFLAGS CXXFLAGS
62 sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules
63 oe_runmake -C wpa_supplicant
64}
65
66do_install () {
67 install -d ${D}${sbindir}
68 install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir}
69 install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir}
70
71 install -d ${D}${bindir}
72 install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir}
73
74 install -d ${D}${docdir}/wpa_supplicant
75 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
76
77 install -d ${D}${sysconfdir}
78 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
79
80 install -d ${D}${sysconfdir}/network/if-pre-up.d/
81 install -d ${D}${sysconfdir}/network/if-post-down.d/
82 install -d ${D}${sysconfdir}/network/if-down.d/
83 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
84 cd ${D}${sysconfdir}/network/ && \
85 ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
86
87 install -d ${D}/${sysconfdir}/dbus-1/system.d
88 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
89 install -d ${D}/${datadir}/dbus-1/system-services
90 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
91
92 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
93 install -d ${D}/${systemd_unitdir}/system
94 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system
95 fi
96
97 install -d ${D}/etc/default/volatiles
98 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
99}
100
101pkg_postinst_wpa-supplicant () {
102 # If we're offline, we don't need to do this.
103 if [ "x$D" = "x" ]; then
104 killall -q -HUP dbus-daemon || true
105 fi
106
107}