Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [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." |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame^] | 3 | HOMEPAGE = "https://developer.apple.com/bonjour/" |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 4 | LICENSE = "Apache-2.0 & BSD-3-Clause" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=31c50371921e0fb731003bbc665f29bf" |
| 6 | |
| 7 | DEPENDS:append:libc-musl = " musl-nscd" |
| 8 | |
| 9 | SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https;branch=rel/mDNSResponder-2200 \ |
| 10 | file://0001-dns-sd-Include-missing-headers.patch \ |
| 11 | file://0002-make-Set-libdns_sd.so-soname-correctly.patch \ |
| 12 | file://0004-make-Separate-TLS-targets-from-libraries.patch \ |
| 13 | file://0005-mDNSCore-Fix-broken-debug-parameter.patch \ |
| 14 | file://0006-make-Add-top-level-Makefile.patch \ |
| 15 | file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch \ |
| 16 | file://0002-Create-subroutine-for-tearing-down-an-interface.patch \ |
| 17 | file://0003-Track-interface-socket-family.patch \ |
| 18 | file://0004-Indicate-loopback-interface-to-mDNS-core.patch \ |
| 19 | file://0005-Use-list-for-changed-interfaces.patch \ |
| 20 | file://0006-Handle-noisy-netlink-sockets.patch \ |
| 21 | file://0007-Mark-deleted-interfaces-as-being-changed.patch \ |
| 22 | file://0008-Handle-errors-from-socket-calls.patch \ |
| 23 | file://0009-remove-unneeded-headers.patch \ |
| 24 | file://mdns.service \ |
| 25 | file://0015-Add-missing-limits.h.patch \ |
| 26 | file://0001-Handle-interface-without-ifa_addr.patch \ |
| 27 | " |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame^] | 28 | SRCREV = "8acabead9ae56551011172d6835822a89c5298d6" |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 29 | |
| 30 | # We install a stub Makefile in the top directory so that the various checks |
| 31 | # in base.bbclass pass their tests for a Makefile, this ensures (that amongst |
| 32 | # other things) the sstate checks will clean the build directory when the |
| 33 | # task hashes changes. |
| 34 | # |
| 35 | # We can't use the approach of setting ${S} to mDNSPosix as we need |
| 36 | # DEBUG_PREFIX_MAP to cover files which come from the Clients directory too. |
| 37 | S = "${WORKDIR}/git" |
| 38 | |
| 39 | inherit github-releases manpages systemd update-rc.d |
| 40 | |
| 41 | PACKAGECONFIG ?= "tls \ |
| 42 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" |
| 43 | PACKAGECONFIG[debug] = "DEBUG=1,DEBUG=0" |
| 44 | PACKAGECONFIG[ipv6] = "HAVE_IPV6=1,HAVE_IPV6=0" |
| 45 | PACKAGECONFIG[manpages] = "" |
| 46 | PACKAGECONFIG[tls] = ",tls=no,mbedtls" |
| 47 | |
| 48 | CVE_PRODUCT = "apple:mdnsresponder" |
| 49 | |
| 50 | CVE_STATUS[CVE-2007-0613] = "not-applicable-platform: Issue affects Apple products \ |
| 51 | i.e. ichat,mdnsresponder, instant message framework and MacOS. Also, \ |
| 52 | https://www.exploit-db.com/exploits/3230 shows the part of code \ |
| 53 | affected by CVE-2007-0613 which is not preset in upstream source code. \ |
| 54 | Hence, CVE-2007-0613 does not affect other Yocto implementations and \ |
| 55 | is not reported for other distros can be marked whitelisted. \ |
| 56 | Links: https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613 \ |
| 57 | https://www.incibe-cert.es/en/early-warning/vulnerabilities/cve-2007-0613 \ |
| 58 | https://security-tracker.debian.org/tracker/CVE-2007-0613 \ |
| 59 | https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613" |
| 60 | |
| 61 | PARALLEL_MAKE = "" |
| 62 | |
| 63 | EXTRA_OEMAKE = "os=linux 'CC=${CCLD}' 'LD=${CCLD}' 'LINKOPTS=${LDFLAGS}' STRIP=: ${PACKAGECONFIG_CONFARGS}" |
| 64 | |
| 65 | # MDNS_VERSIONSTR_NODTS disables __DATE__ and __TIME__ in the version string, |
| 66 | # which are fixed anyway for build reproducibility. |
| 67 | TARGET_CPPFLAGS += "-DMDNS_VERSIONSTR_NODTS" |
| 68 | |
| 69 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 70 | |
| 71 | MDNS_BUILDDIR = "build/${@bb.utils.contains('PACKAGECONFIG','debug','debug','prod', d)}" |
| 72 | |
| 73 | do_install () { |
| 74 | cd mDNSPosix |
| 75 | |
| 76 | install -d ${D}${sbindir} |
| 77 | install ${MDNS_BUILDDIR}/mdnsd ${D}${sbindir} |
| 78 | |
| 79 | install -d ${D}${libdir} |
| 80 | install -m 0644 ${MDNS_BUILDDIR}/libdns_sd.so ${D}${libdir}/libdns_sd.so.1 |
| 81 | ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so |
| 82 | |
| 83 | install -d ${D}${includedir} |
| 84 | install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir} |
| 85 | |
| 86 | install -d ${D}${mandir}/man8 |
| 87 | install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8 |
| 88 | |
| 89 | install -d ${D}${bindir} |
| 90 | install -m 0755 ../Clients/build/dns-sd ${D}${bindir} |
| 91 | |
| 92 | install -d ${D}${libdir} |
| 93 | oe_libinstall -C ${MDNS_BUILDDIR} -so libnss_mdns-0.2 ${D}${libdir} |
| 94 | ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2 |
| 95 | |
| 96 | install -d ${D}${sysconfdir} |
| 97 | install -m 0644 nss_mdns.conf ${D}${sysconfdir} |
| 98 | |
| 99 | install -d ${D}${mandir}/man5 |
| 100 | install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5 |
| 101 | |
| 102 | install -d ${D}${mandir}/man8 |
| 103 | install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 |
| 104 | |
| 105 | install -d ${D}${systemd_system_unitdir} |
| 106 | install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_system_unitdir} |
| 107 | |
| 108 | install -d ${D}${INIT_D_DIR} |
| 109 | install mdnsd.sh ${D}${INIT_D_DIR}/mdns |
| 110 | } |
| 111 | |
| 112 | pkg_postinst:${PN} () { |
| 113 | if [ -r $D${sysconfdir}/nsswitch.conf ]; then |
| 114 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ |
| 115 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \ |
| 116 | -i $D${sysconfdir}/nsswitch.conf |
| 117 | fi |
| 118 | } |
| 119 | |
| 120 | pkg_prerm:${PN} () { |
| 121 | if [ -r $D${sysconfdir}/nsswitch.conf ]; then |
| 122 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ |
| 123 | -e '/^hosts:/s/\s*mdns//' \ |
| 124 | -i $D${sysconfdir}/nsswitch.conf |
| 125 | fi |
| 126 | } |
| 127 | |
| 128 | SYSTEMD_SERVICE:${PN} = "mdns.service" |
| 129 | INITSCRIPT_NAME = "mdns" |
| 130 | |
| 131 | FILES_SOLIBSDEV = "${libdir}/libdns_sd.so" |
| 132 | FILES:${PN} += "${libdir}/libnss_mdns-0.2.so" |
| 133 | |
| 134 | RPROVIDES:${PN} += "libdns_sd.so" |