Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | SUMMARY = "Client for Wi-Fi Protected Access (WPA)" |
| 2 | HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/" |
| 3 | BUGTRACKER = "http://hostap.epitest.fi/bugz/" |
| 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 libgcrypt" |
| 10 | RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli" |
| 11 | |
| 12 | PACKAGECONFIG ??= "gnutls" |
| 13 | PACKAGECONFIG[gnutls] = ",,gnutls" |
| 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://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://0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch \ |
| 28 | file://0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch \ |
| 29 | file://0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch \ |
| 30 | file://0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch \ |
| 31 | file://0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch \ |
| 32 | file://0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch \ |
| 33 | file://0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch \ |
| 34 | file://0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch \ |
| 35 | " |
| 36 | SRC_URI[md5sum] = "f0037dbe03897dcaf2ad2722e659095d" |
| 37 | SRC_URI[sha256sum] = "058dc832c096139a059e6df814080f50251a8d313c21b13364c54a1e70109122" |
| 38 | |
| 39 | S = "${WORKDIR}/wpa_supplicant-${PV}" |
| 40 | |
| 41 | PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli " |
| 42 | FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase" |
| 43 | FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli" |
| 44 | FILES_${PN} += "${datadir}/dbus-1/system-services/*" |
| 45 | CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf" |
| 46 | |
| 47 | do_configure () { |
| 48 | ${MAKE} -C wpa_supplicant clean |
| 49 | install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config |
| 50 | echo "CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config |
| 51 | echo "DRV_CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config |
| 52 | |
| 53 | if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then |
| 54 | ssl=openssl |
| 55 | elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then |
| 56 | ssl=gnutls |
| 57 | fi |
| 58 | if [ -n "$ssl" ]; then |
| 59 | sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config |
| 60 | fi |
| 61 | |
| 62 | # For rebuild |
| 63 | rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d |
| 64 | } |
| 65 | |
| 66 | export EXTRA_CFLAGS = "${CFLAGS}" |
| 67 | export BINDIR = "${sbindir}" |
| 68 | |
| 69 | do_compile () { |
| 70 | unset CFLAGS CPPFLAGS CXXFLAGS |
| 71 | sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules |
| 72 | oe_runmake -C wpa_supplicant |
| 73 | } |
| 74 | |
| 75 | do_install () { |
| 76 | install -d ${D}${sbindir} |
| 77 | install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir} |
| 78 | install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir} |
| 79 | |
| 80 | install -d ${D}${bindir} |
| 81 | install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir} |
| 82 | |
| 83 | install -d ${D}${docdir}/wpa_supplicant |
| 84 | install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant |
| 85 | |
| 86 | install -d ${D}${sysconfdir} |
| 87 | install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf |
| 88 | |
| 89 | install -d ${D}${sysconfdir}/network/if-pre-up.d/ |
| 90 | install -d ${D}${sysconfdir}/network/if-post-down.d/ |
| 91 | install -d ${D}${sysconfdir}/network/if-down.d/ |
| 92 | install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant |
| 93 | cd ${D}${sysconfdir}/network/ && \ |
| 94 | ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant |
| 95 | |
| 96 | install -d ${D}/${sysconfdir}/dbus-1/system.d |
| 97 | install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d |
| 98 | install -d ${D}/${datadir}/dbus-1/system-services |
| 99 | install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services |
| 100 | |
| 101 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 102 | install -d ${D}/${systemd_unitdir}/system |
| 103 | install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system |
| 104 | fi |
| 105 | |
| 106 | install -d ${D}/etc/default/volatiles |
| 107 | install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles |
| 108 | } |
| 109 | |
| 110 | pkg_postinst_wpa-supplicant () { |
| 111 | # If we're offline, we don't need to do this. |
| 112 | if [ "x$D" = "x" ]; then |
| 113 | killall -q -HUP dbus-daemon || true |
| 114 | fi |
| 115 | |
| 116 | } |