diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-10-05 09:20:23 +1300 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2017-10-11 16:22:50 -0400 |
commit | b5281a99c7890e6e3c4d4128dfe1cb517dab8f37 (patch) | |
tree | 50e0a72e389ede5adf4f228a93e75b2f4d43d256 /meta-networking/recipes-protocols | |
parent | 545221b5ab149fe037b61655301ee988435e151d (diff) | |
download | meta-openembedded-b5281a99c7890e6e3c4d4128dfe1cb517dab8f37.tar.gz |
mdns: move from meta-intel-iot-middleware
The following improvements have been made over the recipe that was in
meta-intel-iot-middleware (a layer which is no longer actively
maintained):
* Upgrade to latest upstream version (765.50.9)
* Fix compilation failures by passing CC and LD
* Fix "no GNU hash in the ELF binary" issue
* Point S at the correct source subdirectory so that "make clean" works
* Fix lack of soname on libdns_sd.so leading to missing RDEPENDS QA error
* Add SUMMARY
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-protocols')
3 files changed, 271 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/mdns/files/build.patch b/meta-networking/recipes-protocols/mdns/files/build.patch new file mode 100644 index 000000000..4ab9d23bf --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/files/build.patch | |||
@@ -0,0 +1,167 @@ | |||
1 | From 43b6e98c9c37afd0d914949dcff4eab81f5a995f Mon Sep 17 00:00:00 2001 | ||
2 | From: Brendan Le Foll <brendan.le.foll@intel.com> | ||
3 | Date: Tue, 3 Mar 2015 11:42:57 +0000 | ||
4 | |||
5 | Upstream-Status: Inappropriate [OE-specific] | ||
6 | |||
7 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
8 | |||
9 | --- | ||
10 | mDNSPosix/Makefile | 54 +++++++++++++++++++++++++----------------------------- | ||
11 | 1 file changed, 25 insertions(+), 29 deletions(-) | ||
12 | |||
13 | diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile | ||
14 | index 4f98e90..8ac97ad 100755 | ||
15 | --- a/mDNSPosix/Makefile | ||
16 | +++ b/mDNSPosix/Makefile | ||
17 | @@ -50,6 +50,7 @@ | ||
18 | |||
19 | LIBVERS = 1 | ||
20 | |||
21 | +POSIXDIR = ../mDNSPosix | ||
22 | COREDIR = ../mDNSCore | ||
23 | SHAREDDIR ?= ../mDNSShared | ||
24 | JDK = /usr/jdk | ||
25 | @@ -58,11 +59,11 @@ CC = @cc | ||
26 | BISON = @bison | ||
27 | FLEX = @flex | ||
28 | ST = @strip | ||
29 | -LD = ld -shared | ||
30 | +LD =@LD | ||
31 | CP = cp | ||
32 | RM = rm | ||
33 | LN = ln -s -f | ||
34 | -CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" | ||
35 | +CFLAGS_COMMON = -I$(POSIXDIR) -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" | ||
36 | CFLAGS_PTHREAD = | ||
37 | LINKOPTS = | ||
38 | LINKOPTS_PTHREAD = -lpthread | ||
39 | @@ -70,7 +71,7 @@ LDSUFFIX = so | ||
40 | JAVACFLAGS_OS = -fPIC -shared -ldns_sd | ||
41 | |||
42 | # Set up diverging paths for debug vs. prod builds | ||
43 | -DEBUG=0 | ||
44 | +DEBUG?=1 | ||
45 | ifeq ($(DEBUG),1) | ||
46 | CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2 | ||
47 | OBJDIR = objects/debug | ||
48 | @@ -213,7 +214,7 @@ endif | ||
49 | endif | ||
50 | endif | ||
51 | |||
52 | -CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG) | ||
53 | +CFLAGS_BUILD = $(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG) | ||
54 | |||
55 | ############################################################################# | ||
56 | |||
57 | @@ -249,8 +250,7 @@ Daemon: setup $(BUILDDIR)/mdnsd | ||
58 | @echo "Responder daemon done" | ||
59 | |||
60 | $(BUILDDIR)/mdnsd: $(DAEMONOBJS) | ||
61 | - $(CC) -o $@ $+ $(LINKOPTS) | ||
62 | - @$(STRIP) $@ | ||
63 | + $(CC) -o $@ $+ | ||
64 | |||
65 | # libdns_sd target builds the client library | ||
66 | libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) | ||
67 | @@ -259,22 +259,18 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX) | ||
68 | CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o | ||
69 | |||
70 | $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) | ||
71 | - @$(LD) $(LINKOPTS) -o $@ $+ | ||
72 | - @$(STRIP) $@ | ||
73 | + $(LD) -shared $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).1 -o $@ $+ | ||
74 | |||
75 | -Clients: setup libdns_sd ../Clients/build/dns-sd | ||
76 | +Clients: setup libdns_sd | ||
77 | + @$(MAKE) -C ../Clients DEBUG=${DEBUG} | ||
78 | @echo "Clients done" | ||
79 | |||
80 | -../Clients/build/dns-sd: | ||
81 | - @$(MAKE) -C ../Clients | ||
82 | - | ||
83 | # nss_mdns target builds the Name Service Switch module | ||
84 | nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE) | ||
85 | @echo "Name Service Switch module done" | ||
86 | |||
87 | $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o | ||
88 | - @$(LD) $(LINKOPTS) -o $@ $+ | ||
89 | - @$(STRIP) $@ | ||
90 | + $(LD) -shared $(LINKOPTS) -o $@ $+ | ||
91 | |||
92 | ############################################################################# | ||
93 | |||
94 | @@ -470,55 +466,55 @@ dnsextd: setup $(BUILDDIR)/dnsextd | ||
95 | @echo "dnsextd done" | ||
96 | |||
97 | $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o | ||
98 | - $(CC) $+ -o $@ $(LINKOPTS) | ||
99 | + $(CC) $+ -o $@ | ||
100 | |||
101 | $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o | ||
102 | - $(CC) $+ -o $@ $(LINKOPTS) | ||
103 | + $(CC) $+ -o $@ | ||
104 | |||
105 | $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o | ||
106 | - $(CC) $+ -o $@ $(LINKOPTS) | ||
107 | + $(CC) $+ -o $@ | ||
108 | |||
109 | $(BUILDDIR)/mDNSIdentify: $(SPECIALOBJ) $(OBJDIR)/Identify.c.o | ||
110 | - $(CC) $+ -o $@ $(LINKOPTS) | ||
111 | + $(CC) $+ -o $@ | ||
112 | |||
113 | $(OBJDIR)/Identify.c.o: $(COREDIR)/mDNS.c # Note: Identify.c textually imports mDNS.c | ||
114 | |||
115 | $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o | ||
116 | - $(CC) $+ -o $@ $(LINKOPTS) | ||
117 | + $(CC) $+ -o $@ | ||
118 | |||
119 | $(OBJDIR)/NetMonitor.c.o: $(COREDIR)/mDNS.c # Note: NetMonitor.c textually imports mDNS.c | ||
120 | |||
121 | $(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o | ||
122 | - $(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD) | ||
123 | + $(CC) $+ -o $@ $(LINKOPTS_PTHREAD) | ||
124 | |||
125 | ############################################################################# | ||
126 | |||
127 | # Implicit rules | ||
128 | $(OBJDIR)/%.c.o: %.c | ||
129 | - $(CC) $(CFLAGS) -c -o $@ $< | ||
130 | + $(CC) $(CFLAGS_BUILD) -c -o $@ $< | ||
131 | |||
132 | $(OBJDIR)/%.c.o: $(COREDIR)/%.c | ||
133 | - $(CC) $(CFLAGS) -c -o $@ $< | ||
134 | + $(CC) $(CFLAGS_BUILD) -c -o $@ $< | ||
135 | |||
136 | $(OBJDIR)/%.c.o: $(SHAREDDIR)/%.c | ||
137 | - $(CC) $(CFLAGS) -c -o $@ $< | ||
138 | + $(CC) $(CFLAGS_BUILD) -c -o $@ $< | ||
139 | |||
140 | $(OBJDIR)/%.c.threadsafe.o: %.c | ||
141 | - $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $< | ||
142 | + $(CC) $(CFLAGS_BUILD) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $< | ||
143 | |||
144 | $(OBJDIR)/%.c.threadsafe.o: $(SHAREDDIR)/%.c | ||
145 | - $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $< | ||
146 | + $(CC) $(CFLAGS_BUILD) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $< | ||
147 | |||
148 | $(OBJDIR)/%.c.so.o: %.c | ||
149 | - $(CC) $(CFLAGS) -c -fPIC -o $@ $< | ||
150 | + $(CC) $(CFLAGS_BUILD) -c -fPIC -o $@ $< | ||
151 | |||
152 | $(OBJDIR)/%.c.so.o: $(SHAREDDIR)/%.c | ||
153 | - $(CC) $(CFLAGS) -c -fPIC -o $@ $< | ||
154 | + $(CC) $(CFLAGS_BUILD) -c -fPIC -o $@ $< | ||
155 | |||
156 | $(OBJDIR)/%.y.o: $(SHAREDDIR)/%.y | ||
157 | $(BISON) -o $(OBJDIR)/$*.c -d $< | ||
158 | - $(CC) $(CFLAGS) -c -o $@ $(OBJDIR)/$*.c | ||
159 | + $(CC) $(CFLAGS_BUILD) -c -o $@ $(OBJDIR)/$*.c | ||
160 | |||
161 | $(OBJDIR)/%.l.o: $(SHAREDDIR)/%.l | ||
162 | $(FLEX) $(FLEXFLAGS_OS) -i -o$(OBJDIR)/$*.l.c $< | ||
163 | - $(CC) $(CFLAGS) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c | ||
164 | + $(CC) $(CFLAGS_BUILD) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c | ||
165 | -- | ||
166 | 2.9.5 | ||
167 | |||
diff --git a/meta-networking/recipes-protocols/mdns/files/mdns.service b/meta-networking/recipes-protocols/mdns/files/mdns.service new file mode 100644 index 000000000..531d142dc --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/files/mdns.service | |||
@@ -0,0 +1,15 @@ | |||
1 | [Unit] | ||
2 | Description=Zero-configuration networking | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | ExecStartPre=/bin/rm -f /var/run/mdnsd.pid | ||
8 | ExecStart=/usr/sbin/mdnsd | ||
9 | ExecReload=/bin/kill -HUP $MAINPID | ||
10 | PIDFile=/var/run/mdnsd.pid | ||
11 | Restart=always | ||
12 | RestartSec=10s | ||
13 | |||
14 | [Install] | ||
15 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/mdns/mdns_765.50.9.bb b/meta-networking/recipes-protocols/mdns/mdns_765.50.9.bb new file mode 100644 index 000000000..1a80f7acb --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/mdns_765.50.9.bb | |||
@@ -0,0 +1,89 @@ | |||
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." | ||
3 | HOMEPAGE = "http://developer.apple.com/networking/bonjour/" | ||
4 | LICENSE = "Apache-2.0" | ||
5 | LIC_FILES_CHKSUM = "file://../LICENSE;md5=31c50371921e0fb731003bbc665f29bf" | ||
6 | |||
7 | RPROVIDES_${PN} += "libdns_sd.so" | ||
8 | |||
9 | SRC_URI = "http://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-${PV}.tar.gz \ | ||
10 | file://build.patch;patchdir=.. \ | ||
11 | file://mdns.service \ | ||
12 | " | ||
13 | |||
14 | SRC_URI[md5sum] = "4a6bc1628851002634ea3833a4dca317" | ||
15 | SRC_URI[sha256sum] = "de61dd0034357aa50c60806726fb1f70fa8e953ff9cb62eccfb73efad10dba0a" | ||
16 | |||
17 | PARALLEL_MAKE = "" | ||
18 | |||
19 | S = "${WORKDIR}/mDNSResponder-${PV}/mDNSPosix" | ||
20 | |||
21 | EXTRA_OEMAKE += "os=linux DEBUG=0 'CC=${CC}' 'LD=${CCLD} ${LDFLAGS}'" | ||
22 | |||
23 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
24 | |||
25 | do_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 | |||
60 | pkg_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 | |||
66 | pkg_prerm_${PN} () { | ||
67 | sed -e '/^hosts:/s/\s*\<mdns\>//' \ | ||
68 | -e '/^hosts:/s/\s*mdns//' \ | ||
69 | -i $D/etc/nsswitch.conf | ||
70 | } | ||
71 | |||
72 | inherit systemd | ||
73 | |||
74 | SYSTEMD_SERVICE_${PN} = "mdns.service" | ||
75 | |||
76 | FILES_${PN} += "${systemd_unitdir}/system/mdns.service" | ||
77 | FILES_${PN} += "${libdir}/libdns_sd.so.1 \ | ||
78 | ${bindir}/dns-sd \ | ||
79 | ${libdir}/libnss_mdns-0.2.so \ | ||
80 | ${sysconfdir}/nss_mdns.conf" | ||
81 | |||
82 | FILES_${PN}-dev += "${libdir}/libdns_sd.so \ | ||
83 | ${includedir}/dns_sd.h " | ||
84 | |||
85 | FILES_${PN}-man += "${mandir}/man8/mdnsd.8 \ | ||
86 | ${mandir}/man5/nss_mdns.conf.5 \ | ||
87 | ${mandir}/man8/libnss_mdns.8" | ||
88 | |||
89 | PACKAGES = "${PN} ${PN}-dev ${PN}-man ${PN}-dbg" | ||