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/" |
| 4 | LICENSE = "Apache-2.0" |
| 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 \ |
| 12 | file://build.patch;patchdir=.. \ |
| 13 | file://mdns.service \ |
| 14 | file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch;patchdir=.. \ |
| 15 | file://0002-Create-subroutine-for-tearing-down-an-interface.patch;patchdir=.. \ |
| 16 | file://0003-Track-interface-socket-family.patch;patchdir=.. \ |
| 17 | file://0004-Use-list-for-changed-interfaces.patch;patchdir=.. \ |
| 18 | file://0005-Handle-noisy-netlink-sockets.patch;patchdir=.. \ |
| 19 | file://0006-Remove-unneeded-function.patch;patchdir=.. \ |
| 20 | file://0007-Indicate-loopback-interface-to-mDNS-core.patch;patchdir=.. \ |
| 21 | file://0008-Mark-deleted-interfaces-as-being-changed.patch;patchdir=.. \ |
| 22 | file://0009-Fix-possible-NULL-dereference.patch;patchdir=.. \ |
| 23 | file://0010-Handle-errors-from-socket-calls.patch;patchdir=.. \ |
| 24 | file://0011-Change-a-dynamic-allocation-to-file-scope-variable.patch;patchdir=.. \ |
| 25 | " |
| 26 | SRC_URI[md5sum] = "4e139a8e1133349006b0436291c9e29b" |
| 27 | SRC_URI[sha256sum] = "2cef0ee9900504c5277fb81de0a28e6c0835fe482ebecf1067c6864f5c4eda74" |
| 28 | |
| 29 | PARALLEL_MAKE = "" |
| 30 | |
| 31 | S = "${WORKDIR}/mDNSResponder-${PV}/mDNSPosix" |
| 32 | |
| 33 | EXTRA_OEMAKE += "os=linux DEBUG=0 'CC=${CC}' 'LD=${CCLD} ${LDFLAGS}'" |
| 34 | |
| 35 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 36 | |
| 37 | do_install () { |
| 38 | install -d ${D}${sbindir} |
| 39 | install -m 0755 build/prod/mdnsd ${D}${sbindir} |
| 40 | |
| 41 | install -d ${D}${libdir} |
| 42 | cp build/prod/libdns_sd.so ${D}${libdir}/libdns_sd.so.1 |
| 43 | chmod 0644 ${D}${libdir}/libdns_sd.so.1 |
| 44 | ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so |
| 45 | |
| 46 | install -d ${D}${includedir} |
| 47 | install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir} |
| 48 | |
| 49 | install -d ${D}${mandir}/man8 |
| 50 | install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8 |
| 51 | |
| 52 | install -d ${D}${bindir} |
| 53 | install -m 0755 ../Clients/build/dns-sd ${D}${bindir} |
| 54 | |
| 55 | install -d ${D}${libdir} |
| 56 | oe_libinstall -C build/prod -so libnss_mdns-0.2 ${D}${libdir} |
| 57 | ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2 |
| 58 | |
| 59 | install -d ${D}${sysconfdir} |
| 60 | install -m 0644 nss_mdns.conf ${D}${sysconfdir} |
| 61 | |
| 62 | install -d ${D}${mandir}/man5 |
| 63 | install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5 |
| 64 | |
| 65 | install -d ${D}${mandir}/man8 |
| 66 | install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 |
| 67 | |
| 68 | install -d ${D}${systemd_unitdir}/system/ |
| 69 | install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_unitdir}/system/ |
| 70 | } |
| 71 | |
| 72 | pkg_postinst_${PN} () { |
| 73 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ |
| 74 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \ |
| 75 | -i $D/etc/nsswitch.conf |
| 76 | } |
| 77 | |
| 78 | pkg_prerm_${PN} () { |
| 79 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ |
| 80 | -e '/^hosts:/s/\s*mdns//' \ |
| 81 | -i $D/etc/nsswitch.conf |
| 82 | } |
| 83 | |
| 84 | inherit systemd |
| 85 | |
| 86 | SYSTEMD_SERVICE_${PN} = "mdns.service" |
| 87 | |
| 88 | FILES_${PN} += "${systemd_unitdir}/system/mdns.service" |
| 89 | FILES_${PN} += "${libdir}/libdns_sd.so.1 \ |
| 90 | ${bindir}/dns-sd \ |
| 91 | ${libdir}/libnss_mdns-0.2.so \ |
| 92 | ${sysconfdir}/nss_mdns.conf" |
| 93 | |
| 94 | FILES_${PN}-dev += "${libdir}/libdns_sd.so \ |
| 95 | ${includedir}/dns_sd.h " |
| 96 | |
| 97 | FILES_${PN}-man += "${mandir}/man8/mdnsd.8 \ |
| 98 | ${mandir}/man5/nss_mdns.conf.5 \ |
| 99 | ${mandir}/man8/libnss_mdns.8" |
| 100 | |
| 101 | PACKAGES = "${PN} ${PN}-dev ${PN}-man ${PN}-dbg" |