From cedfa1be3aee047ddc6ac146626eb17eb2529342 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Wed, 30 Oct 2024 09:32:54 +0000 Subject: mdns: Upgrade 2200.140.11 -> 2559.1.1 Add local fixes for: * definition for MAX() * missing `limit` declarations Signed-off-by: Alex Kiernan Signed-off-by: Khem Raj --- .../0001-Fix-SIGSEGV-during-DumpStateLog.patch | 6 +- .../0001-Handle-interface-without-ifa_addr.patch | 8 +- .../mdns/mdns/0004-Add-definition-for-MAX.patch | 24 ++++ .../mdns/0005-Fix-missing-limit-declarations.patch | 49 ++++++++ .../mdns/mdns/0009-remove-unneeded-headers.patch | 5 +- .../recipes-protocols/mdns/mdns_2200.140.11.bb | 134 -------------------- .../recipes-protocols/mdns/mdns_2559.1.1.bb | 137 +++++++++++++++++++++ 7 files changed, 219 insertions(+), 144 deletions(-) create mode 100644 meta-networking/recipes-protocols/mdns/mdns/0004-Add-definition-for-MAX.patch create mode 100644 meta-networking/recipes-protocols/mdns/mdns/0005-Fix-missing-limit-declarations.patch delete mode 100644 meta-networking/recipes-protocols/mdns/mdns_2200.140.11.bb create mode 100644 meta-networking/recipes-protocols/mdns/mdns_2559.1.1.bb (limited to 'meta-networking') diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch index abf82b1e02..d74c031ab3 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Fix-SIGSEGV-during-DumpStateLog.patch @@ -1,4 +1,4 @@ -From 2db1f5bc941e4b4cd1721e361a47cfe288b07a76 Mon Sep 17 00:00:00 2001 +From 3138d70ce8f521d03120e7789e93ebe290ece101 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Thu, 1 Feb 2024 14:07:03 +0000 Subject: [PATCH] Fix SIGSEGV during DumpStateLog() @@ -13,10 +13,10 @@ Signed-off-by: Alex Kiernan 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mDNSShared/mDNSDebug.c b/mDNSShared/mDNSDebug.c -index 7a4ca19eff6d..d449dde320f6 100644 +index b531fcea2bb9..1e8d9b10afbc 100644 --- a/mDNSShared/mDNSDebug.c +++ b/mDNSShared/mDNSDebug.c -@@ -71,7 +71,7 @@ mDNSlocal void LogMsgWithLevelv(os_log_t category, os_log_type_t level, const ch +@@ -72,7 +72,7 @@ mDNSlocal void LogMsgWithLevelv(os_log_t category, os_log_type_t level, const ch mDNSlocal void LogMsgWithLevelv(const char *category, mDNSLogLevel_t level, const char *format, va_list args) { // Do not print the logs if the log category is MDNS_LOG_CATEGORY_DISABLED. diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch index 7ec5996013..a531884afc 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0001-Handle-interface-without-ifa_addr.patch @@ -1,4 +1,4 @@ -From c67102307f25c5f4d238c736e90519e56a76ae79 Mon Sep 17 00:00:00 2001 +From 199b376e585d5362a1f51ea20e45dcc3bdb7d6aa Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 23 Jun 2023 10:10:00 +0200 Subject: [PATCH] Handle interface without `ifa_addr` @@ -15,10 +15,10 @@ Signed-off-by: Alex Kiernan 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c -index 0c9dd2582660..c3ead26799e6 100644 +index 4c835a8c253c..e1e27b1de3b2 100644 --- a/mDNSPosix/mDNSPosix.c +++ b/mDNSPosix/mDNSPosix.c -@@ -1895,6 +1895,7 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) +@@ -1927,6 +1927,7 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) continue; if ((ifa_loop4 == NULL) && @@ -26,7 +26,7 @@ index 0c9dd2582660..c3ead26799e6 100644 ((*ifi)->ifa_addr->sa_family == AF_INET) && ((*ifi)->ifa_flags & IFF_UP) && ((*ifi)->ifa_flags & IFF_LOOPBACK)) -@@ -1903,7 +1904,8 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) +@@ -1935,7 +1936,8 @@ mDNSlocal void InterfaceChangeCallback(int fd, void *context) continue; } diff --git a/meta-networking/recipes-protocols/mdns/mdns/0004-Add-definition-for-MAX.patch b/meta-networking/recipes-protocols/mdns/mdns/0004-Add-definition-for-MAX.patch new file mode 100644 index 0000000000..82d7ceca30 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0004-Add-definition-for-MAX.patch @@ -0,0 +1,24 @@ +From f0adca77472c9c1df6db14f2b03e66d78a577649 Mon Sep 17 00:00:00 2001 +From: Alex Kiernan +Date: Sat, 26 Oct 2024 13:24:45 +0000 +Subject: [PATCH] Add definition for MAX() + +Upstream-Status: Inactive-Upstream [Upstream does not take patches] +Signed-off-by: Alex Kiernan +--- + mDNSShared/uds_daemon.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/mDNSShared/uds_daemon.c b/mDNSShared/uds_daemon.c +index e73bc1181b73..1d590a6a3580 100644 +--- a/mDNSShared/uds_daemon.c ++++ b/mDNSShared/uds_daemon.c +@@ -89,6 +89,8 @@ + + #include "mdns_strict.h" + ++#define MAX(A, B) (((A) > (B)) ? (A) : (B)) ++ + // User IDs 0-500 are system-wide processes, not actual users in the usual sense + // User IDs for real user accounts start at 501 and count up from there + #define SystemUID(X) ((X) <= 500) diff --git a/meta-networking/recipes-protocols/mdns/mdns/0005-Fix-missing-limit-declarations.patch b/meta-networking/recipes-protocols/mdns/mdns/0005-Fix-missing-limit-declarations.patch new file mode 100644 index 0000000000..4d4a8cf9b7 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns/0005-Fix-missing-limit-declarations.patch @@ -0,0 +1,49 @@ +From cf216a6872139e435d5712787359b03022b51d2b Mon Sep 17 00:00:00 2001 +From: Alex Kiernan +Date: Sat, 26 Oct 2024 13:26:09 +0000 +Subject: [PATCH] Fix missing `limit` declarations + +`put_attribute_tlvs` needs a limit setting which is missing, add it in. + +Upstream-Status: Inactive-Upstream [Upstream does not take patches] +Signed-off-by: Alex Kiernan +--- + mDNSShared/dnssd_clientstub.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/mDNSShared/dnssd_clientstub.c b/mDNSShared/dnssd_clientstub.c +index fc93d162446a..a6cf45fa9856 100644 +--- a/mDNSShared/dnssd_clientstub.c ++++ b/mDNSShared/dnssd_clientstub.c +@@ -2022,6 +2022,7 @@ DNSServiceErrorType DNSServiceRegisterInternal + ipc_msg_hdr *hdr; + DNSServiceErrorType err; + union { uint16_t s; u_char b[2]; } port = { portInNetworkByteOrder }; ++ const uint8_t *limit; + (void)attr; + + if (!sdRef || !regtype) return kDNSServiceErr_BadParam; +@@ -2054,6 +2055,7 @@ DNSServiceErrorType DNSServiceRegisterInternal + if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; } + if (!callBack) hdr->ipc_flags |= IPC_FLAGS_NOREPLY; + ++ limit = ptr + len; + put_flags(flags, &ptr); + put_uint32(interfaceIndex, &ptr); + put_string(name, &ptr); +@@ -2334,6 +2336,7 @@ DNSServiceErrorType DNSServiceRegisterRecordInternal + ipc_msg_hdr *hdr = NULL; + DNSRecordRef rref = NULL; + DNSRecord **p; ++ const uint8_t *limit; + (void)attr; + + // Verify that only one of the following flags is set. +@@ -2389,6 +2392,7 @@ DNSServiceErrorType DNSServiceRegisterRecordInternal + hdr = create_hdr(reg_record_request, &len, &ptr, !(flags & kDNSServiceFlagsQueueRequest), sdRef); + if (!hdr) return kDNSServiceErr_NoMemory; + ++ limit = ptr + len; + put_flags(flags, &ptr); + put_uint32(interfaceIndex, &ptr); + put_string(fullname, &ptr); diff --git a/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch b/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch index 818017037c..3784e3be81 100644 --- a/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch +++ b/meta-networking/recipes-protocols/mdns/mdns/0009-remove-unneeded-headers.patch @@ -1,4 +1,4 @@ -From 05cb409ce213f35798c02faf2032d4846a84b48e Mon Sep 17 00:00:00 2001 +From d15ee692af42163846be7517372f3ee098cdaf18 Mon Sep 17 00:00:00 2001 From: Beniamin Sandu Date: Thu, 15 Jun 2023 17:02:58 +0000 Subject: [PATCH] remove unneeded headers @@ -7,8 +7,7 @@ From a quick look, these seem to not be needed and having them breaks the build with mbedtls 3.x. Without them it builds fine on both 2.x and 3.x versions. -Upstream-Status: Pending - +Upstream-Status: Inactive-Upstream [Upstream does not take patches] Signed-off-by: Beniamin Sandu --- mDNSPosix/mbedtls.c | 2 -- diff --git a/meta-networking/recipes-protocols/mdns/mdns_2200.140.11.bb b/meta-networking/recipes-protocols/mdns/mdns_2200.140.11.bb deleted file mode 100644 index e6ea707197..0000000000 --- a/meta-networking/recipes-protocols/mdns/mdns_2200.140.11.bb +++ /dev/null @@ -1,134 +0,0 @@ -SUMMARY = "Publishes & browses available services on a link according to the Zeroconf / Bonjour protocol" -DESCRIPTION = "Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks." -HOMEPAGE = "https://developer.apple.com/bonjour/" -LICENSE = "Apache-2.0 & BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=31c50371921e0fb731003bbc665f29bf" - -DEPENDS:append:libc-musl = " musl-nscd" - -SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https;branch=rel/mDNSResponder-2200 \ - file://0001-dns-sd-Include-missing-headers.patch \ - file://0002-make-Set-libdns_sd.so-soname-correctly.patch \ - file://0004-make-Separate-TLS-targets-from-libraries.patch \ - file://0005-mDNSCore-Fix-broken-debug-parameter.patch \ - file://0006-make-Add-top-level-Makefile.patch \ - file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch \ - file://0002-Create-subroutine-for-tearing-down-an-interface.patch \ - file://0003-Track-interface-socket-family.patch \ - file://0004-Indicate-loopback-interface-to-mDNS-core.patch \ - file://0005-Use-list-for-changed-interfaces.patch \ - file://0006-Handle-noisy-netlink-sockets.patch \ - file://0007-Mark-deleted-interfaces-as-being-changed.patch \ - file://0008-Handle-errors-from-socket-calls.patch \ - file://0009-remove-unneeded-headers.patch \ - file://mdns.service \ - file://0001-Handle-interface-without-ifa_addr.patch \ - file://0001-Fix-SIGSEGV-during-DumpStateLog.patch \ - " -SRCREV = "12e84b9089e577e0c0a9f48c4b922d7349fcc5a4" - -# We install a stub Makefile in the top directory so that the various checks -# in base.bbclass pass their tests for a Makefile, this ensures (that amongst -# other things) the sstate checks will clean the build directory when the -# task hashes changes. -# -# We can't use the approach of setting ${S} to mDNSPosix as we need -# DEBUG_PREFIX_MAP to cover files which come from the Clients directory too. -S = "${WORKDIR}/git" - -inherit github-releases manpages systemd update-rc.d - -PACKAGECONFIG ?= "tls \ - ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" -PACKAGECONFIG[debug] = "DEBUG=1,DEBUG=0" -PACKAGECONFIG[ipv6] = "HAVE_IPV6=1,HAVE_IPV6=0" -PACKAGECONFIG[manpages] = "" -PACKAGECONFIG[tls] = ",tls=no,mbedtls" - -CVE_PRODUCT = "apple:mdnsresponder" - -CVE_STATUS[CVE-2007-0613] = "not-applicable-platform: Issue affects Apple products \ -i.e. ichat,mdnsresponder, instant message framework and MacOS. Also, \ -https://www.exploit-db.com/exploits/3230 shows the part of code \ -affected by CVE-2007-0613 which is not preset in upstream source code. \ -Hence, CVE-2007-0613 does not affect other Yocto implementations and \ -is not reported for other distros can be marked whitelisted. \ -Links: https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613 \ -https://www.incibe-cert.es/en/early-warning/vulnerabilities/cve-2007-0613 \ -https://security-tracker.debian.org/tracker/CVE-2007-0613 \ -https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613" - -PARALLEL_MAKE = "" - -EXTRA_OEMAKE = "os=linux 'CC=${CCLD}' 'LD=${CCLD}' 'LINKOPTS=${LDFLAGS}' STRIP=: ${PACKAGECONFIG_CONFARGS}" - -# MDNS_VERSIONSTR_NODTS disables __DATE__ and __TIME__ in the version string, -# which are fixed anyway for build reproducibility. -TARGET_CPPFLAGS += "-DMDNS_VERSIONSTR_NODTS" - -TARGET_CC_ARCH += "${LDFLAGS}" - -MDNS_BUILDDIR = "build/${@bb.utils.contains('PACKAGECONFIG','debug','debug','prod', d)}" - -do_install () { - cd mDNSPosix - - install -d ${D}${sbindir} - install ${MDNS_BUILDDIR}/mdnsd ${D}${sbindir} - - install -d ${D}${libdir} - install -m 0644 ${MDNS_BUILDDIR}/libdns_sd.so ${D}${libdir}/libdns_sd.so.1 - ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so - - install -d ${D}${includedir} - install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir} - - install -d ${D}${mandir}/man8 - install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8 - - install -d ${D}${bindir} - install -m 0755 ../Clients/build/dns-sd ${D}${bindir} - - install -d ${D}${libdir} - oe_libinstall -C ${MDNS_BUILDDIR} -so libnss_mdns-0.2 ${D}${libdir} - ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2 - - install -d ${D}${sysconfdir} - install -m 0644 nss_mdns.conf ${D}${sysconfdir} - - install -d ${D}${mandir}/man5 - install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5 - - install -d ${D}${mandir}/man8 - install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 - - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${UNPACKDIR}/mdns.service ${D}${systemd_system_unitdir} - - install -d ${D}${INIT_D_DIR} - install mdnsd.sh ${D}${INIT_D_DIR}/mdns -} - -pkg_postinst:${PN} () { - if [ -r $D${sysconfdir}/nsswitch.conf ]; then - sed -e '/^hosts:/s/\s*\//' \ - -e 's/\(^hosts:.*\)\(\\)\(.*\)\(\\)\(.*\)/\1\2 mdns\3\4\5/' \ - -i $D${sysconfdir}/nsswitch.conf - fi -} - -pkg_prerm:${PN} () { - if [ -r $D${sysconfdir}/nsswitch.conf ]; then - sed -e '/^hosts:/s/\s*\//' \ - -e '/^hosts:/s/\s*mdns//' \ - -i $D${sysconfdir}/nsswitch.conf - fi -} - -SYSTEMD_SERVICE:${PN} = "mdns.service" -INITSCRIPT_NAME = "mdns" - -FILES_SOLIBSDEV = "${libdir}/libdns_sd.so" -FILES:${PN} += "${libdir}/libnss_mdns-0.2.so" - -RPROVIDES:${PN} += "libdns_sd.so" diff --git a/meta-networking/recipes-protocols/mdns/mdns_2559.1.1.bb b/meta-networking/recipes-protocols/mdns/mdns_2559.1.1.bb new file mode 100644 index 0000000000..212fd0eab5 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns_2559.1.1.bb @@ -0,0 +1,137 @@ +SUMMARY = "Publishes & browses available services on a link according to the Zeroconf / Bonjour protocol" +DESCRIPTION = "Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks." +HOMEPAGE = "https://developer.apple.com/bonjour/" +LICENSE = "Apache-2.0 & BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=31c50371921e0fb731003bbc665f29bf" + +DEPENDS:append:libc-musl = " musl-nscd" + +SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https;branch=${BRANCH} \ + file://0001-dns-sd-Include-missing-headers.patch \ + file://0002-make-Set-libdns_sd.so-soname-correctly.patch \ + file://0004-make-Separate-TLS-targets-from-libraries.patch \ + file://0005-mDNSCore-Fix-broken-debug-parameter.patch \ + file://0006-make-Add-top-level-Makefile.patch \ + file://0001-Create-subroutine-for-cleaning-recent-interfaces.patch \ + file://0002-Create-subroutine-for-tearing-down-an-interface.patch \ + file://0003-Track-interface-socket-family.patch \ + file://0004-Indicate-loopback-interface-to-mDNS-core.patch \ + file://0005-Use-list-for-changed-interfaces.patch \ + file://0006-Handle-noisy-netlink-sockets.patch \ + file://0007-Mark-deleted-interfaces-as-being-changed.patch \ + file://0008-Handle-errors-from-socket-calls.patch \ + file://0009-remove-unneeded-headers.patch \ + file://mdns.service \ + file://0001-Handle-interface-without-ifa_addr.patch \ + file://0001-Fix-SIGSEGV-during-DumpStateLog.patch \ + file://0005-Fix-missing-limit-declarations.patch \ + file://0004-Add-definition-for-MAX.patch \ + " +BRANCH = "main" +SRCREV = "71e6611203d57c78b26fd505d98cb57a33d00880" + +# We install a stub Makefile in the top directory so that the various checks +# in base.bbclass pass their tests for a Makefile, this ensures (that amongst +# other things) the sstate checks will clean the build directory when the +# task hashes changes. +# +# We can't use the approach of setting ${S} to mDNSPosix as we need +# DEBUG_PREFIX_MAP to cover files which come from the Clients directory too. +S = "${WORKDIR}/git" + +inherit github-releases manpages systemd update-rc.d + +PACKAGECONFIG ?= "tls \ + ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" +PACKAGECONFIG[debug] = "DEBUG=1,DEBUG=0" +PACKAGECONFIG[ipv6] = "HAVE_IPV6=1,HAVE_IPV6=0" +PACKAGECONFIG[manpages] = "" +PACKAGECONFIG[tls] = ",tls=no,mbedtls" + +CVE_PRODUCT = "apple:mdnsresponder" + +CVE_STATUS[CVE-2007-0613] = "not-applicable-platform: Issue affects Apple products \ +i.e. ichat,mdnsresponder, instant message framework and MacOS. Also, \ +https://www.exploit-db.com/exploits/3230 shows the part of code \ +affected by CVE-2007-0613 which is not preset in upstream source code. \ +Hence, CVE-2007-0613 does not affect other Yocto implementations and \ +is not reported for other distros can be marked whitelisted. \ +Links: https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613 \ +https://www.incibe-cert.es/en/early-warning/vulnerabilities/cve-2007-0613 \ +https://security-tracker.debian.org/tracker/CVE-2007-0613 \ +https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613" + +PARALLEL_MAKE = "" + +EXTRA_OEMAKE = "os=linux 'CC=${CCLD}' 'LD=${CCLD}' 'LINKOPTS=${LDFLAGS}' STRIP=: ${PACKAGECONFIG_CONFARGS}" + +# MDNS_VERSIONSTR_NODTS disables __DATE__ and __TIME__ in the version string, +# which are fixed anyway for build reproducibility. +TARGET_CPPFLAGS += "-DMDNS_VERSIONSTR_NODTS" + +TARGET_CC_ARCH += "${LDFLAGS}" + +MDNS_BUILDDIR = "build/${@bb.utils.contains('PACKAGECONFIG','debug','debug','prod', d)}" + +do_install () { + cd mDNSPosix + + install -d ${D}${sbindir} + install ${MDNS_BUILDDIR}/mdnsd ${D}${sbindir} + + install -d ${D}${libdir} + install -m 0644 ${MDNS_BUILDDIR}/libdns_sd.so ${D}${libdir}/libdns_sd.so.1 + ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so + + install -d ${D}${includedir} + install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir} + + install -d ${D}${mandir}/man8 + install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8 + + install -d ${D}${bindir} + install -m 0755 ../Clients/build/dns-sd ${D}${bindir} + + install -d ${D}${libdir} + oe_libinstall -C ${MDNS_BUILDDIR} -so libnss_mdns-0.2 ${D}${libdir} + ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2 + + install -d ${D}${sysconfdir} + install -m 0644 nss_mdns.conf ${D}${sysconfdir} + + install -d ${D}${mandir}/man5 + install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5 + + install -d ${D}${mandir}/man8 + install -m 0644 libnss_mdns.8 ${D}${mandir}/man8 + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${UNPACKDIR}/mdns.service ${D}${systemd_system_unitdir} + + install -d ${D}${INIT_D_DIR} + install mdnsd.sh ${D}${INIT_D_DIR}/mdns +} + +pkg_postinst:${PN} () { + if [ -r $D${sysconfdir}/nsswitch.conf ]; then + sed -e '/^hosts:/s/\s*\//' \ + -e 's/\(^hosts:.*\)\(\\)\(.*\)\(\\)\(.*\)/\1\2 mdns\3\4\5/' \ + -i $D${sysconfdir}/nsswitch.conf + fi +} + +pkg_prerm:${PN} () { + if [ -r $D${sysconfdir}/nsswitch.conf ]; then + sed -e '/^hosts:/s/\s*\//' \ + -e '/^hosts:/s/\s*mdns//' \ + -i $D${sysconfdir}/nsswitch.conf + fi +} + +SYSTEMD_SERVICE:${PN} = "mdns.service" +INITSCRIPT_NAME = "mdns" + +FILES_SOLIBSDEV = "${libdir}/libdns_sd.so" +FILES:${PN} += "${libdir}/libnss_mdns-0.2.so" + +RPROVIDES:${PN} += "libdns_sd.so" -- cgit v1.2.3-54-g00ecf