Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "Publishes & browses available services on a link according to the Zeroconf / Bonjour protocol" |
| 2 | DESCRIPTION = "Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks." |
| 3 | HOMEPAGE = "http://developer.apple.com/networking/bonjour/" |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 4 | LICENSE = "Apache-2.0 & BSD-3-Clause" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://../LICENSE;md5=31c50371921e0fb731003bbc665f29bf" |
| 6 | |
| 7 | COMPATIBLE_HOST_libc-musl = 'null' |
| 8 | |
| 9 | RPROVIDES_${PN} += "libdns_sd.so" |
| 10 | |
| 11 | SRC_URI = "https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-${PV}.tar.gz \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 12 | file://mdns.service \ |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 13 | file://0001-mdns-include-stddef.h-for-NULL.patch;patchdir=.. \ |
| 14 | file://0002-mdns-cross-compilation-fixes-for-bitbake.patch;patchdir=.. \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 15 | file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch;patchdir=.. \ |
| 16 | file://0002-Create-subroutine-for-tearing-down-an-interface.patch;patchdir=.. \ |
| 17 | file://0003-Track-interface-socket-family.patch;patchdir=.. \ |
| 18 | file://0004-Use-list-for-changed-interfaces.patch;patchdir=.. \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 19 | file://0006-Remove-unneeded-function.patch;patchdir=.. \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | file://0008-Mark-deleted-interfaces-as-being-changed.patch;patchdir=.. \ |
| 21 | file://0009-Fix-possible-NULL-dereference.patch;patchdir=.. \ |
| 22 | file://0010-Handle-errors-from-socket-calls.patch;patchdir=.. \ |
| 23 | file://0011-Change-a-dynamic-allocation-to-file-scope-variable.patch;patchdir=.. \ |
| 24 | " |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 25 | SRC_URI[md5sum] = "ac766013bbcb323e9db4c80805b2552a" |
| 26 | SRC_URI[sha256sum] = "b86f4816b4145915198e7c5bf0bc56dbbfd960e9a4518bb6486baa40cdcca7e6" |
| 27 | |
| 28 | CVE_PRODUCT = "apple:mdnsresponder" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 29 | |
| 30 | PARALLEL_MAKE = "" |
| 31 | |
| 32 | S = "${WORKDIR}/mDNSResponder-${PV}/mDNSPosix" |
| 33 | |
| 34 | EXTRA_OEMAKE += "os=linux DEBUG=0 'CC=${CC}' 'LD=${CCLD} ${LDFLAGS}'" |
| 35 | |
| 36 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 37 | |
| 38 | do_install () { |
| 39 | install -d ${D}${sbindir} |
| 40 | install -m 0755 build/prod/mdnsd ${D}${sbindir} |
| 41 | |
| 42 | install -d ${D}${libdir} |
| 43 | cp build/prod/libdns_sd.so ${D}${libdir}/libdns_sd.so.1 |
| 44 | chmod 0644 ${D}${libdir}/libdns_sd.so.1 |
| 45 | ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so |
| 46 | |
| 47 | install -d ${D}${includedir} |
| 48 | install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir} |
| 49 | |
| 50 | install -d ${D}${mandir}/man8 |
| 51 | install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8 |
| 52 | |
| 53 | install -d ${D}${bindir} |
| 54 | install -m 0755 ../Clients/build/dns-sd ${D}${bindir} |
| 55 | |
| 56 | install -d ${D}${libdir} |
| 57 | oe_libinstall -C build/prod -so libnss_mdns-0.2 ${D}${libdir} |
| 58 | ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2 |
| 59 | |
| 60 | install -d ${D}${sysconfdir} |
| 61 | install -m 0644 nss_mdns.conf ${D}${sysconfdir} |
| 62 | |
| 63 | install -d ${D}${mandir}/man5 |
| 64 | install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5 |
| 65 | |
| 66 | install -d ${D}${mandir}/man8 |
| 67 | install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 |
| 68 | |
| 69 | install -d ${D}${systemd_unitdir}/system/ |
| 70 | install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_unitdir}/system/ |
| 71 | } |
| 72 | |
| 73 | pkg_postinst_${PN} () { |
| 74 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ |
| 75 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \ |
| 76 | -i $D/etc/nsswitch.conf |
| 77 | } |
| 78 | |
| 79 | pkg_prerm_${PN} () { |
| 80 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ |
| 81 | -e '/^hosts:/s/\s*mdns//' \ |
| 82 | -i $D/etc/nsswitch.conf |
| 83 | } |
| 84 | |
| 85 | inherit systemd |
| 86 | |
| 87 | SYSTEMD_SERVICE_${PN} = "mdns.service" |
| 88 | |
| 89 | FILES_${PN} += "${systemd_unitdir}/system/mdns.service" |
| 90 | FILES_${PN} += "${libdir}/libdns_sd.so.1 \ |
| 91 | ${bindir}/dns-sd \ |
| 92 | ${libdir}/libnss_mdns-0.2.so \ |
| 93 | ${sysconfdir}/nss_mdns.conf" |
| 94 | |
| 95 | FILES_${PN}-dev += "${libdir}/libdns_sd.so \ |
| 96 | ${includedir}/dns_sd.h " |
| 97 | |
| 98 | FILES_${PN}-man += "${mandir}/man8/mdnsd.8 \ |
| 99 | ${mandir}/man5/nss_mdns.conf.5 \ |
| 100 | ${mandir}/man8/libnss_mdns.8" |
| 101 | |
| 102 | PACKAGES = "${PN} ${PN}-dev ${PN}-man ${PN}-dbg" |