blob: 1bd17031af65ecd492a463784d98eb4704206d69 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -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
7RPROVIDES_${PN} += "libdns_sd.so"
8
Brad Bishop15ae2502019-06-18 21:44:24 -04009SRC_URI = "https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-${PV}.tar.gz \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010 file://build.patch;patchdir=.. \
11 file://mdns.service \
Brad Bishop316dfdd2018-06-25 12:45:53 -040012 file://0001-nss_mdns-Do-not-include-nss.h-when-libc-glibc.patch;patchdir=.. \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050013 "
Brad Bishop15ae2502019-06-18 21:44:24 -040014SRC_URI[md5sum] = "e773f290a7d29f1072247985d6add2ff"
15SRC_URI[sha256sum] = "e777b4d7dbf5eb1552cb80090ad1ede319067ab6e45e3990d68aabf6e8b3f5a0"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050016
17PARALLEL_MAKE = ""
18
19S = "${WORKDIR}/mDNSResponder-${PV}/mDNSPosix"
20
21EXTRA_OEMAKE += "os=linux DEBUG=0 'CC=${CC}' 'LD=${CCLD} ${LDFLAGS}'"
22
23TARGET_CC_ARCH += "${LDFLAGS}"
24
25do_install () {
26 install -d ${D}${sbindir}
27 install -m 0755 build/prod/mdnsd ${D}${sbindir}
28
29 install -d ${D}${libdir}
30 cp build/prod/libdns_sd.so ${D}${libdir}/libdns_sd.so.1
31 chmod 0644 ${D}${libdir}/libdns_sd.so.1
32 ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so
33
34 install -d ${D}${includedir}
35 install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir}
36
37 install -d ${D}${mandir}/man8
38 install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8
39
40 install -d ${D}${bindir}
41 install -m 0755 ../Clients/build/dns-sd ${D}${bindir}
42
43 install -d ${D}${libdir}
44 oe_libinstall -C build/prod -so libnss_mdns-0.2 ${D}${libdir}
45 ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2
46
47 install -d ${D}${sysconfdir}
48 install -m 0644 nss_mdns.conf ${D}${sysconfdir}
49
50 install -d ${D}${mandir}/man5
51 install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5
52
53 install -d ${D}${mandir}/man8
54 install -m 0644 libnss_mdns.8 ${D}${mandir}/man8
55
56 install -d ${D}${systemd_unitdir}/system/
57 install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_unitdir}/system/
58}
59
60pkg_postinst_${PN} () {
61 sed -e '/^hosts:/s/\s*\<mdns\>//' \
62 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \
63 -i $D/etc/nsswitch.conf
64}
65
66pkg_prerm_${PN} () {
67 sed -e '/^hosts:/s/\s*\<mdns\>//' \
68 -e '/^hosts:/s/\s*mdns//' \
69 -i $D/etc/nsswitch.conf
70}
71
72inherit systemd
73
74SYSTEMD_SERVICE_${PN} = "mdns.service"
75
76FILES_${PN} += "${systemd_unitdir}/system/mdns.service"
77FILES_${PN} += "${libdir}/libdns_sd.so.1 \
78 ${bindir}/dns-sd \
79 ${libdir}/libnss_mdns-0.2.so \
80 ${sysconfdir}/nss_mdns.conf"
81
82FILES_${PN}-dev += "${libdir}/libdns_sd.so \
83 ${includedir}/dns_sd.h "
84
85FILES_${PN}-man += "${mandir}/man8/mdnsd.8 \
86 ${mandir}/man5/nss_mdns.conf.5 \
87 ${mandir}/man8/libnss_mdns.8"
88
89PACKAGES = "${PN} ${PN}-dev ${PN}-man ${PN}-dbg"