blob: 0f8dc92df3b58627f1a08d8d6759776de209e687 [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/"
4LICENSE = "Apache-2.0"
5LIC_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 \
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 "
26SRC_URI[md5sum] = "4e139a8e1133349006b0436291c9e29b"
27SRC_URI[sha256sum] = "2cef0ee9900504c5277fb81de0a28e6c0835fe482ebecf1067c6864f5c4eda74"
28
29PARALLEL_MAKE = ""
30
31S = "${WORKDIR}/mDNSResponder-${PV}/mDNSPosix"
32
33EXTRA_OEMAKE += "os=linux DEBUG=0 'CC=${CC}' 'LD=${CCLD} ${LDFLAGS}'"
34
35TARGET_CC_ARCH += "${LDFLAGS}"
36
37do_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
72pkg_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
78pkg_prerm_${PN} () {
79 sed -e '/^hosts:/s/\s*\<mdns\>//' \
80 -e '/^hosts:/s/\s*mdns//' \
81 -i $D/etc/nsswitch.conf
82}
83
84inherit systemd
85
86SYSTEMD_SERVICE_${PN} = "mdns.service"
87
88FILES_${PN} += "${systemd_unitdir}/system/mdns.service"
89FILES_${PN} += "${libdir}/libdns_sd.so.1 \
90 ${bindir}/dns-sd \
91 ${libdir}/libnss_mdns-0.2.so \
92 ${sysconfdir}/nss_mdns.conf"
93
94FILES_${PN}-dev += "${libdir}/libdns_sd.so \
95 ${includedir}/dns_sd.h "
96
97FILES_${PN}-man += "${mandir}/man8/mdnsd.8 \
98 ${mandir}/man5/nss_mdns.conf.5 \
99 ${mandir}/man8/libnss_mdns.8"
100
101PACKAGES = "${PN} ${PN}-dev ${PN}-man ${PN}-dbg"