1*4882a593SmuzhiyunSUMMARY = "Client for Wi-Fi Protected Access (WPA)" 2*4882a593SmuzhiyunHOMEPAGE = "http://w1.fi/wpa_supplicant/" 3*4882a593SmuzhiyunDESCRIPTION = "wpa_supplicant is a WPA Supplicant for Linux, BSD, Mac OS X, and Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). Supplicant is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wlan driver." 4*4882a593SmuzhiyunBUGTRACKER = "http://w1.fi/security/" 5*4882a593SmuzhiyunSECTION = "network" 6*4882a593SmuzhiyunLICENSE = "BSD-3-Clause" 7*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=5ebcb90236d1ad640558c3d3cd3035df \ 8*4882a593Smuzhiyun file://README;beginline=1;endline=56;md5=e3d2f6c2948991e37c1ca4960de84747 \ 9*4882a593Smuzhiyun file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=76306a95306fee9a976b0ac1be70f705" 10*4882a593SmuzhiyunDEPENDS = "dbus libnl" 11*4882a593SmuzhiyunRRECOMMENDS:${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli" 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunPACKAGECONFIG ??= "openssl" 14*4882a593SmuzhiyunPACKAGECONFIG[gnutls] = ",,gnutls libgcrypt" 15*4882a593SmuzhiyunPACKAGECONFIG[openssl] = ",,openssl" 16*4882a593Smuzhiyun 17*4882a593Smuzhiyuninherit pkgconfig systemd 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "wpa_supplicant.service" 20*4882a593SmuzhiyunSYSTEMD_AUTO_ENABLE = "disable" 21*4882a593Smuzhiyun 22*4882a593SmuzhiyunSRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \ 23*4882a593Smuzhiyun file://defconfig \ 24*4882a593Smuzhiyun file://wpa-supplicant.sh \ 25*4882a593Smuzhiyun file://wpa_supplicant.conf \ 26*4882a593Smuzhiyun file://wpa_supplicant.conf-sane \ 27*4882a593Smuzhiyun file://99_wpa_supplicant \ 28*4882a593Smuzhiyun " 29*4882a593SmuzhiyunSRC_URI[sha256sum] = "20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f" 30*4882a593Smuzhiyun 31*4882a593SmuzhiyunCVE_PRODUCT = "wpa_supplicant" 32*4882a593Smuzhiyun 33*4882a593SmuzhiyunS = "${WORKDIR}/wpa_supplicant-${PV}" 34*4882a593Smuzhiyun 35*4882a593SmuzhiyunPACKAGES:prepend = "wpa-supplicant-passphrase wpa-supplicant-cli " 36*4882a593SmuzhiyunFILES:wpa-supplicant-passphrase = "${bindir}/wpa_passphrase" 37*4882a593SmuzhiyunFILES:wpa-supplicant-cli = "${sbindir}/wpa_cli" 38*4882a593SmuzhiyunFILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/*" 39*4882a593SmuzhiyunCONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf" 40*4882a593Smuzhiyun 41*4882a593Smuzhiyundo_configure () { 42*4882a593Smuzhiyun ${MAKE} -C wpa_supplicant clean 43*4882a593Smuzhiyun install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then 46*4882a593Smuzhiyun ssl=openssl 47*4882a593Smuzhiyun elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then 48*4882a593Smuzhiyun ssl=gnutls 49*4882a593Smuzhiyun fi 50*4882a593Smuzhiyun if [ -n "$ssl" ]; then 51*4882a593Smuzhiyun sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config 52*4882a593Smuzhiyun fi 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun # For rebuild 55*4882a593Smuzhiyun rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d 56*4882a593Smuzhiyun} 57*4882a593Smuzhiyun 58*4882a593Smuzhiyunexport EXTRA_CFLAGS = "${CFLAGS}" 59*4882a593Smuzhiyunexport BINDIR = "${sbindir}" 60*4882a593Smuzhiyun 61*4882a593Smuzhiyundo_compile () { 62*4882a593Smuzhiyun unset CFLAGS CPPFLAGS CXXFLAGS 63*4882a593Smuzhiyun sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules 64*4882a593Smuzhiyun oe_runmake -C wpa_supplicant 65*4882a593Smuzhiyun} 66*4882a593Smuzhiyun 67*4882a593Smuzhiyundo_install () { 68*4882a593Smuzhiyun install -d ${D}${sbindir} 69*4882a593Smuzhiyun install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir} 70*4882a593Smuzhiyun install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir} 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun install -d ${D}${bindir} 73*4882a593Smuzhiyun install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir} 74*4882a593Smuzhiyun 75*4882a593Smuzhiyun install -d ${D}${docdir}/wpa_supplicant 76*4882a593Smuzhiyun install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun install -d ${D}${sysconfdir} 79*4882a593Smuzhiyun install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun install -d ${D}${sysconfdir}/network/if-pre-up.d/ 82*4882a593Smuzhiyun install -d ${D}${sysconfdir}/network/if-post-down.d/ 83*4882a593Smuzhiyun install -d ${D}${sysconfdir}/network/if-down.d/ 84*4882a593Smuzhiyun install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant 85*4882a593Smuzhiyun cd ${D}${sysconfdir}/network/ && \ 86*4882a593Smuzhiyun ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun install -d ${D}/${sysconfdir}/dbus-1/system.d 89*4882a593Smuzhiyun install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d 90*4882a593Smuzhiyun install -d ${D}/${datadir}/dbus-1/system-services 91*4882a593Smuzhiyun install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 94*4882a593Smuzhiyun install -d ${D}/${systemd_system_unitdir} 95*4882a593Smuzhiyun install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir} 96*4882a593Smuzhiyun fi 97*4882a593Smuzhiyun 98*4882a593Smuzhiyun install -d ${D}/etc/default/volatiles 99*4882a593Smuzhiyun install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles 100*4882a593Smuzhiyun} 101*4882a593Smuzhiyun 102*4882a593Smuzhiyunpkg_postinst:${PN} () { 103*4882a593Smuzhiyun # If we're offline, we don't need to do this. 104*4882a593Smuzhiyun if [ "x$D" = "x" ]; then 105*4882a593Smuzhiyun killall -q -HUP dbus-daemon || true 106*4882a593Smuzhiyun fi 107*4882a593Smuzhiyun 108*4882a593Smuzhiyun} 109