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