summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/avahi
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-06-21 14:00:22 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-27 13:55:21 +0100
commit2b152d36581053b2fa9e81b2cd1664b885c951f0 (patch)
tree861368084dd1c9860c5fdcd58eb88b28a4878a14 /meta/recipes-connectivity/avahi
parent19c22fc08a9ca778bcf79690cf7f27c3bf372211 (diff)
downloadpoky-2b152d36581053b2fa9e81b2cd1664b885c951f0.tar.gz
avahi: reorganize codes
This patch does nothing but reorganizing codes. avahi.inc is shared by avahi and avahi-ui recipes. Move common things into it, and move uncommon things out of it. (From OE-Core rev: 75529d384bfeaf52befccb892cf41f22dc02668b) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/avahi')
-rw-r--r--meta/recipes-connectivity/avahi/avahi-ui_0.7.bb16
-rw-r--r--meta/recipes-connectivity/avahi/avahi.inc84
-rw-r--r--meta/recipes-connectivity/avahi/avahi_0.7.bb83
3 files changed, 83 insertions, 100 deletions
diff --git a/meta/recipes-connectivity/avahi/avahi-ui_0.7.bb b/meta/recipes-connectivity/avahi/avahi-ui_0.7.bb
index 5648e386b3..a77653bf55 100644
--- a/meta/recipes-connectivity/avahi/avahi-ui_0.7.bb
+++ b/meta/recipes-connectivity/avahi/avahi-ui_0.7.bb
@@ -1,31 +1,18 @@
1LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
2 file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \
3 file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \
4 file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \
5 file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf"
6
7require avahi.inc 1require avahi.inc
8 2
9inherit distro_features_check 3inherit distro_features_check
10ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" 4ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
11 5
12SRC_URI[md5sum] = "d76c59d0882ac6c256d70a2a585362a6"
13SRC_URI[sha256sum] = "57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804"
14
15DEPENDS += "avahi" 6DEPENDS += "avahi"
16 7
17AVAHI_GTK = "gtk3" 8AVAHI_GTK = "gtk3"
18 9
19S = "${WORKDIR}/avahi-${PV}" 10S = "${WORKDIR}/avahi-${PV}"
20 11
21PACKAGES = "${PN} ${PN}-utils ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc avahi-discover" 12PACKAGES += "${PN}-utils avahi-discover"
22 13
23FILES_${PN} = "${libdir}/libavahi-ui*.so.*" 14FILES_${PN} = "${libdir}/libavahi-ui*.so.*"
24FILES_${PN}-dev += "${libdir}/libavahi-ui${SOLIBSDEV}"
25FILES_${PN}-staticdev += "${libdir}/libavahi-ui.a"
26
27FILES_${PN}-utils = "${bindir}/b* ${datadir}/applications/b*" 15FILES_${PN}-utils = "${bindir}/b* ${datadir}/applications/b*"
28
29FILES_avahi-discover = "${datadir}/applications/avahi-discover.desktop \ 16FILES_avahi-discover = "${datadir}/applications/avahi-discover.desktop \
30 ${datadir}/avahi/interfaces/avahi-discover.ui \ 17 ${datadir}/avahi/interfaces/avahi-discover.ui \
31 ${bindir}/avahi-discover-standalone \ 18 ${bindir}/avahi-discover-standalone \
@@ -59,4 +46,3 @@ do_install_append () {
59 rm ${D}${libdir}/girepository-1.0/ -rf 46 rm ${D}${libdir}/girepository-1.0/ -rf
60 rm ${D}${datadir}/gir-1.0/ -rf 47 rm ${D}${datadir}/gir-1.0/ -rf
61} 48}
62
diff --git a/meta/recipes-connectivity/avahi/avahi.inc b/meta/recipes-connectivity/avahi/avahi.inc
index ec368de4f4..11846849f0 100644
--- a/meta/recipes-connectivity/avahi/avahi.inc
+++ b/meta/recipes-connectivity/avahi/avahi.inc
@@ -13,15 +13,19 @@ SECTION = "network"
13# major part is under LGPLv2.1+, but several .dtd, .xsl, initscripts and 13# major part is under LGPLv2.1+, but several .dtd, .xsl, initscripts and
14# python scripts are under GPLv2+ 14# python scripts are under GPLv2+
15LICENSE = "GPLv2+ & LGPLv2.1+" 15LICENSE = "GPLv2+ & LGPLv2.1+"
16LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
17 file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \
18 file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \
19 file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \
20 file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf"
16 21
17DEPENDS = "expat libcap libdaemon glib-2.0 intltool-native" 22SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}.tar.gz"
18 23
19SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}.tar.gz \
20 file://00avahi-autoipd \
21 file://99avahi-autoipd \
22 file://initscript.patch \
23 "
24UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/" 24UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/"
25SRC_URI[md5sum] = "d76c59d0882ac6c256d70a2a585362a6"
26SRC_URI[sha256sum] = "57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804"
27
28DEPENDS = "expat libcap libdaemon glib-2.0 intltool-native"
25 29
26# For gtk related PACKAGECONFIGs: gtk, gtk3 30# For gtk related PACKAGECONFIGs: gtk, gtk3
27AVAHI_GTK ?= "" 31AVAHI_GTK ?= ""
@@ -31,18 +35,7 @@ PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
31PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+" 35PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+"
32PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3" 36PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3"
33 37
34USERADD_PACKAGES = "avahi-daemon avahi-autoipd" 38inherit autotools pkgconfig gettext gobject-introspection
35USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \
36 --no-create-home --shell /bin/false \
37 --user-group avahi"
38
39USERADD_PARAM_avahi-autoipd = "--system --home /run/avahi-autoipd \
40 --no-create-home --shell /bin/false \
41 --user-group \
42 -c \"Avahi autoip daemon\" \
43 avahi-autoipd"
44
45inherit autotools pkgconfig update-rc.d gettext useradd gobject-introspection
46 39
47EXTRA_OECONF = "--with-avahi-priv-access-group=adm \ 40EXTRA_OECONF = "--with-avahi-priv-access-group=adm \
48 --disable-stack-protector \ 41 --disable-stack-protector \
@@ -73,67 +66,12 @@ do_compile_prepend() {
73 export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs" 66 export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs"
74} 67}
75 68
76PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-autoipd avahi-utils"
77
78# As avahi doesn't put any files into PN, clear the files list to avoid problems
79# if extra libraries appear.
80FILES_${PN} = ""
81FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
82 ${sysconfdir}/avahi/avahi-autoipd.action \
83 ${sysconfdir}/dhcp/*/avahi-autoipd \
84 ${sysconfdir}/udhcpc.d/00avahi-autoipd \
85 ${sysconfdir}/udhcpc.d/99avahi-autoipd"
86FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
87FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
88FILES_avahi-daemon = "${sbindir}/avahi-daemon \
89 ${sysconfdir}/avahi/avahi-daemon.conf \
90 ${sysconfdir}/avahi/hosts \
91 ${sysconfdir}/avahi/services \
92 ${sysconfdir}/dbus-1 \
93 ${sysconfdir}/init.d/avahi-daemon \
94 ${datadir}/avahi/introspection/*.introspect \
95 ${datadir}/avahi/avahi-service.dtd \
96 ${datadir}/avahi/service-types \
97 ${datadir}/dbus-1/system-services"
98FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
99FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*"
100FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
101 ${sysconfdir}/avahi/avahi-dnsconfd.action \
102 ${sysconfdir}/init.d/avahi-dnsconfd"
103FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
104FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
105FILES_avahi-utils = "${bindir}/avahi-*"
106
107RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})"
108
109RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
110RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns" 69RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
111 70
112CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
113
114INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
115INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
116INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
117INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
118INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
119
120do_install() { 71do_install() {
121 autotools_do_install 72 autotools_do_install
122 rm -rf ${D}/run 73 rm -rf ${D}/run
123 rm -rf ${D}${datadir}/dbus-1/interfaces 74 rm -rf ${D}${datadir}/dbus-1/interfaces
124 test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1 75 test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
125 rm -rf ${D}${libdir}/avahi 76 rm -rf ${D}${libdir}/avahi
126
127 install -d ${D}${sysconfdir}/udhcpc.d
128 install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
129 install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
130}
131
132# At the time the postinst runs, dbus might not be setup so only restart if running
133# Don't exit early, because update-rc.d needs to run subsequently.
134
135pkg_postinst_avahi-daemon () {
136if [ -z "$D" ]; then
137 killall -q -HUP dbus-daemon || true
138fi
139} 77}
diff --git a/meta/recipes-connectivity/avahi/avahi_0.7.bb b/meta/recipes-connectivity/avahi/avahi_0.7.bb
index 7c91f10f11..b695be9130 100644
--- a/meta/recipes-connectivity/avahi/avahi_0.7.bb
+++ b/meta/recipes-connectivity/avahi/avahi_0.7.bb
@@ -1,20 +1,79 @@
1require avahi.inc 1require avahi.inc
2 2
3inherit systemd 3SRC_URI += "file://00avahi-autoipd \
4 file://99avahi-autoipd \
5 file://initscript.patch \
6 "
7
8inherit update-rc.d systemd useradd
9
10PACKAGES =+ "libavahi-gobject avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib avahi-autoipd avahi-utils"
11
12# As avahi doesn't put any files into PN, clear the files list to avoid problems
13# if extra libraries appear.
14FILES_${PN} = ""
15FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
16 ${sysconfdir}/avahi/avahi-autoipd.action \
17 ${sysconfdir}/dhcp/*/avahi-autoipd \
18 ${sysconfdir}/udhcpc.d/00avahi-autoipd \
19 ${sysconfdir}/udhcpc.d/99avahi-autoipd"
20FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
21FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
22FILES_avahi-daemon = "${sbindir}/avahi-daemon \
23 ${sysconfdir}/avahi/avahi-daemon.conf \
24 ${sysconfdir}/avahi/hosts \
25 ${sysconfdir}/avahi/services \
26 ${sysconfdir}/dbus-1 \
27 ${sysconfdir}/init.d/avahi-daemon \
28 ${datadir}/avahi/introspection/*.introspect \
29 ${datadir}/avahi/avahi-service.dtd \
30 ${datadir}/avahi/service-types \
31 ${datadir}/dbus-1/system-services"
32FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
33FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
34 ${sysconfdir}/avahi/avahi-dnsconfd.action \
35 ${sysconfdir}/init.d/avahi-dnsconfd"
36FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
37FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
38FILES_avahi-utils = "${bindir}/avahi-*"
39
40RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})"
41
42RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
43
44CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
45
46USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
47USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \
48 --no-create-home --shell /bin/false \
49 --user-group avahi"
50
51USERADD_PARAM_avahi-autoipd = "--system --home /run/avahi-autoipd \
52 --no-create-home --shell /bin/false \
53 --user-group \
54 -c \"Avahi autoip daemon\" \
55 avahi-autoipd"
56
57INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
58INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
59INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
60INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
61INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
4 62
5SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd" 63SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd"
6SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service" 64SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service"
7SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service" 65SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service"
8 66
9LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \ 67do_install_append() {
10 file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \ 68 install -d ${D}${sysconfdir}/udhcpc.d
11 file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \ 69 install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
12 file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \ 70 install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
13 file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf" 71}
14
15SRC_URI[md5sum] = "d76c59d0882ac6c256d70a2a585362a6"
16SRC_URI[sha256sum] = "57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804"
17
18DEPENDS += "intltool-native"
19 72
20PACKAGES =+ "libavahi-gobject" 73# At the time the postinst runs, dbus might not be setup so only restart if running
74# Don't exit early, because update-rc.d needs to run subsequently.
75pkg_postinst_avahi-daemon () {
76if [ -z "$D" ]; then
77 killall -q -HUP dbus-daemon || true
78fi
79}