blob: 086b408692f21c45d8ca81ec728b822c0ce995f9 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Publishes & browses available services on a link according to the Zeroconf / Bonjour protocol"
2DESCRIPTION = "Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks."
3HOMEPAGE = "http://developer.apple.com/networking/bonjour/"
Andrew Geisslerd688a012020-09-18 13:36:00 -05004LICENSE = "Apache-2.0 & BSD-3-Clause"
Andrew Geissler82c905d2020-04-13 13:39:40 -05005LIC_FILES_CHKSUM = "file://../LICENSE;md5=31c50371921e0fb731003bbc665f29bf"
6
7COMPATIBLE_HOST_libc-musl = 'null'
8
9RPROVIDES_${PN} += "libdns_sd.so"
10
11SRC_URI = "https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-${PV}.tar.gz \
Andrew Geissler82c905d2020-04-13 13:39:40 -050012 file://mdns.service \
Andrew Geisslerd688a012020-09-18 13:36:00 -050013 file://0001-mdns-include-stddef.h-for-NULL.patch;patchdir=.. \
14 file://0002-mdns-cross-compilation-fixes-for-bitbake.patch;patchdir=.. \
Andrew Geissler82c905d2020-04-13 13:39:40 -050015 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 Geissler82c905d2020-04-13 13:39:40 -050019 file://0006-Remove-unneeded-function.patch;patchdir=.. \
Andrew Geissler82c905d2020-04-13 13:39:40 -050020 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 Geisslerd688a012020-09-18 13:36:00 -050025SRC_URI[md5sum] = "ac766013bbcb323e9db4c80805b2552a"
26SRC_URI[sha256sum] = "b86f4816b4145915198e7c5bf0bc56dbbfd960e9a4518bb6486baa40cdcca7e6"
27
28CVE_PRODUCT = "apple:mdnsresponder"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029
30PARALLEL_MAKE = ""
31
32S = "${WORKDIR}/mDNSResponder-${PV}/mDNSPosix"
33
34EXTRA_OEMAKE += "os=linux DEBUG=0 'CC=${CC}' 'LD=${CCLD} ${LDFLAGS}'"
35
36TARGET_CC_ARCH += "${LDFLAGS}"
37
38do_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
73pkg_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
79pkg_prerm_${PN} () {
80 sed -e '/^hosts:/s/\s*\<mdns\>//' \
81 -e '/^hosts:/s/\s*mdns//' \
82 -i $D/etc/nsswitch.conf
83}
84
85inherit systemd
86
87SYSTEMD_SERVICE_${PN} = "mdns.service"
88
89FILES_${PN} += "${systemd_unitdir}/system/mdns.service"
90FILES_${PN} += "${libdir}/libdns_sd.so.1 \
91 ${bindir}/dns-sd \
92 ${libdir}/libnss_mdns-0.2.so \
93 ${sysconfdir}/nss_mdns.conf"
94
95FILES_${PN}-dev += "${libdir}/libdns_sd.so \
96 ${includedir}/dns_sd.h "
97
98FILES_${PN}-man += "${mandir}/man8/mdnsd.8 \
99 ${mandir}/man5/nss_mdns.conf.5 \
100 ${mandir}/man8/libnss_mdns.8"
101
102PACKAGES = "${PN} ${PN}-dev ${PN}-man ${PN}-dbg"