Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [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" |
Brad Bishop | f3f93bb | 2019-10-16 14:33:32 -0400 | [diff] [blame] | 5 | LICENSE = "BSD-3-Clause" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=279b4f5abb9c153c285221855ddb78cc \ |
| 7 | file://README;beginline=1;endline=56;md5=e7d3dbb01f75f0b9799e192731d1e1ff \ |
| 8 | file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=0a8b56d3543498b742b9c0e94cc2d18b" |
| 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 pkgconfig systemd |
| 17 | |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 18 | SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 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 | file://0001-replace-systemd-install-Alias-with-WantedBy.patch \ |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame^] | 28 | file://0001-AP-Silently-ignore-management-frame-from-unexpected-.patch \ |
| 29 | file://0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch \ |
| 30 | file://0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch \ |
| 31 | file://0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 32 | " |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 33 | SRC_URI[md5sum] = "2d2958c782576dc9901092fbfecb4190" |
| 34 | SRC_URI[sha256sum] = "fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 35 | |
| 36 | CVE_PRODUCT = "wpa_supplicant" |
| 37 | |
| 38 | S = "${WORKDIR}/wpa_supplicant-${PV}" |
| 39 | |
| 40 | PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli " |
| 41 | FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase" |
| 42 | FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli" |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 43 | FILES_${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 44 | CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf" |
| 45 | |
| 46 | do_configure () { |
| 47 | ${MAKE} -C wpa_supplicant clean |
| 48 | install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 49 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 50 | if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then |
| 51 | ssl=openssl |
| 52 | elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then |
| 53 | ssl=gnutls |
| 54 | fi |
| 55 | if [ -n "$ssl" ]; then |
| 56 | sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config |
| 57 | fi |
| 58 | |
| 59 | # For rebuild |
| 60 | rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d |
| 61 | } |
| 62 | |
| 63 | export EXTRA_CFLAGS = "${CFLAGS}" |
| 64 | export BINDIR = "${sbindir}" |
| 65 | |
| 66 | do_compile () { |
| 67 | unset CFLAGS CPPFLAGS CXXFLAGS |
| 68 | sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules |
| 69 | oe_runmake -C wpa_supplicant |
| 70 | } |
| 71 | |
| 72 | do_install () { |
| 73 | install -d ${D}${sbindir} |
| 74 | install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir} |
| 75 | install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir} |
| 76 | |
| 77 | install -d ${D}${bindir} |
| 78 | install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir} |
| 79 | |
| 80 | install -d ${D}${docdir}/wpa_supplicant |
| 81 | install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant |
| 82 | |
| 83 | install -d ${D}${sysconfdir} |
| 84 | install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf |
| 85 | |
| 86 | install -d ${D}${sysconfdir}/network/if-pre-up.d/ |
| 87 | install -d ${D}${sysconfdir}/network/if-post-down.d/ |
| 88 | install -d ${D}${sysconfdir}/network/if-down.d/ |
| 89 | install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant |
| 90 | cd ${D}${sysconfdir}/network/ && \ |
| 91 | ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant |
| 92 | |
| 93 | install -d ${D}/${sysconfdir}/dbus-1/system.d |
| 94 | install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d |
| 95 | install -d ${D}/${datadir}/dbus-1/system-services |
| 96 | install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services |
| 97 | |
| 98 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 99 | install -d ${D}/${systemd_unitdir}/system |
| 100 | install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system |
| 101 | fi |
| 102 | |
| 103 | install -d ${D}/etc/default/volatiles |
| 104 | install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles |
| 105 | } |
| 106 | |
| 107 | pkg_postinst_wpa-supplicant () { |
| 108 | # If we're offline, we don't need to do this. |
| 109 | if [ "x$D" = "x" ]; then |
| 110 | killall -q -HUP dbus-daemon || true |
| 111 | fi |
| 112 | |
| 113 | } |