diff options
| author | Chen Qi <Qi.Chen@windriver.com> | 2018-06-21 14:00:22 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-27 13:55:21 +0100 |
| commit | 2b152d36581053b2fa9e81b2cd1664b885c951f0 (patch) | |
| tree | 861368084dd1c9860c5fdcd58eb88b28a4878a14 | |
| parent | 19c22fc08a9ca778bcf79690cf7f27c3bf372211 (diff) | |
| download | poky-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>
| -rw-r--r-- | meta/recipes-connectivity/avahi/avahi-ui_0.7.bb | 16 | ||||
| -rw-r--r-- | meta/recipes-connectivity/avahi/avahi.inc | 84 | ||||
| -rw-r--r-- | meta/recipes-connectivity/avahi/avahi_0.7.bb | 83 |
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 @@ | |||
| 1 | LIC_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 | |||
| 7 | require avahi.inc | 1 | require avahi.inc |
| 8 | 2 | ||
| 9 | inherit distro_features_check | 3 | inherit distro_features_check |
| 10 | ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" | 4 | ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" |
| 11 | 5 | ||
| 12 | SRC_URI[md5sum] = "d76c59d0882ac6c256d70a2a585362a6" | ||
| 13 | SRC_URI[sha256sum] = "57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804" | ||
| 14 | |||
| 15 | DEPENDS += "avahi" | 6 | DEPENDS += "avahi" |
| 16 | 7 | ||
| 17 | AVAHI_GTK = "gtk3" | 8 | AVAHI_GTK = "gtk3" |
| 18 | 9 | ||
| 19 | S = "${WORKDIR}/avahi-${PV}" | 10 | S = "${WORKDIR}/avahi-${PV}" |
| 20 | 11 | ||
| 21 | PACKAGES = "${PN} ${PN}-utils ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc avahi-discover" | 12 | PACKAGES += "${PN}-utils avahi-discover" |
| 22 | 13 | ||
| 23 | FILES_${PN} = "${libdir}/libavahi-ui*.so.*" | 14 | FILES_${PN} = "${libdir}/libavahi-ui*.so.*" |
| 24 | FILES_${PN}-dev += "${libdir}/libavahi-ui${SOLIBSDEV}" | ||
| 25 | FILES_${PN}-staticdev += "${libdir}/libavahi-ui.a" | ||
| 26 | |||
| 27 | FILES_${PN}-utils = "${bindir}/b* ${datadir}/applications/b*" | 15 | FILES_${PN}-utils = "${bindir}/b* ${datadir}/applications/b*" |
| 28 | |||
| 29 | FILES_avahi-discover = "${datadir}/applications/avahi-discover.desktop \ | 16 | FILES_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+ |
| 15 | LICENSE = "GPLv2+ & LGPLv2.1+" | 15 | LICENSE = "GPLv2+ & LGPLv2.1+" |
| 16 | LIC_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 | ||
| 17 | DEPENDS = "expat libcap libdaemon glib-2.0 intltool-native" | 22 | SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}.tar.gz" |
| 18 | 23 | ||
| 19 | SRC_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 | " | ||
| 24 | UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/" | 24 | UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/" |
| 25 | SRC_URI[md5sum] = "d76c59d0882ac6c256d70a2a585362a6" | ||
| 26 | SRC_URI[sha256sum] = "57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804" | ||
| 27 | |||
| 28 | DEPENDS = "expat libcap libdaemon glib-2.0 intltool-native" | ||
| 25 | 29 | ||
| 26 | # For gtk related PACKAGECONFIGs: gtk, gtk3 | 30 | # For gtk related PACKAGECONFIGs: gtk, gtk3 |
| 27 | AVAHI_GTK ?= "" | 31 | AVAHI_GTK ?= "" |
| @@ -31,18 +35,7 @@ PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" | |||
| 31 | PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+" | 35 | PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+" |
| 32 | PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3" | 36 | PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3" |
| 33 | 37 | ||
| 34 | USERADD_PACKAGES = "avahi-daemon avahi-autoipd" | 38 | inherit autotools pkgconfig gettext gobject-introspection |
| 35 | USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \ | ||
| 36 | --no-create-home --shell /bin/false \ | ||
| 37 | --user-group avahi" | ||
| 38 | |||
| 39 | USERADD_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 | |||
| 45 | inherit autotools pkgconfig update-rc.d gettext useradd gobject-introspection | ||
| 46 | 39 | ||
| 47 | EXTRA_OECONF = "--with-avahi-priv-access-group=adm \ | 40 | EXTRA_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 | ||
| 76 | PACKAGES =+ "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. | ||
| 80 | FILES_${PN} = "" | ||
| 81 | FILES_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" | ||
| 86 | FILES_libavahi-common = "${libdir}/libavahi-common.so.*" | ||
| 87 | FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib" | ||
| 88 | FILES_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" | ||
| 98 | FILES_libavahi-client = "${libdir}/libavahi-client.so.*" | ||
| 99 | FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*" | ||
| 100 | FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \ | ||
| 101 | ${sysconfdir}/avahi/avahi-dnsconfd.action \ | ||
| 102 | ${sysconfdir}/init.d/avahi-dnsconfd" | ||
| 103 | FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*" | ||
| 104 | FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib" | ||
| 105 | FILES_avahi-utils = "${bindir}/avahi-*" | ||
| 106 | |||
| 107 | RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})" | ||
| 108 | |||
| 109 | RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns" | ||
| 110 | RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns" | 69 | RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns" |
| 111 | 70 | ||
| 112 | CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf" | ||
| 113 | |||
| 114 | INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd" | ||
| 115 | INITSCRIPT_NAME_avahi-daemon = "avahi-daemon" | ||
| 116 | INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19" | ||
| 117 | INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd" | ||
| 118 | INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19" | ||
| 119 | |||
| 120 | do_install() { | 71 | do_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 | |||
| 135 | pkg_postinst_avahi-daemon () { | ||
| 136 | if [ -z "$D" ]; then | ||
| 137 | killall -q -HUP dbus-daemon || true | ||
| 138 | fi | ||
| 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 @@ | |||
| 1 | require avahi.inc | 1 | require avahi.inc |
| 2 | 2 | ||
| 3 | inherit systemd | 3 | SRC_URI += "file://00avahi-autoipd \ |
| 4 | file://99avahi-autoipd \ | ||
| 5 | file://initscript.patch \ | ||
| 6 | " | ||
| 7 | |||
| 8 | inherit update-rc.d systemd useradd | ||
| 9 | |||
| 10 | PACKAGES =+ "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. | ||
| 14 | FILES_${PN} = "" | ||
| 15 | FILES_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" | ||
| 20 | FILES_libavahi-common = "${libdir}/libavahi-common.so.*" | ||
| 21 | FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib" | ||
| 22 | FILES_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" | ||
| 32 | FILES_libavahi-client = "${libdir}/libavahi-client.so.*" | ||
| 33 | FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \ | ||
| 34 | ${sysconfdir}/avahi/avahi-dnsconfd.action \ | ||
| 35 | ${sysconfdir}/init.d/avahi-dnsconfd" | ||
| 36 | FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*" | ||
| 37 | FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib" | ||
| 38 | FILES_avahi-utils = "${bindir}/avahi-*" | ||
| 39 | |||
| 40 | RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})" | ||
| 41 | |||
| 42 | RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns" | ||
| 43 | |||
| 44 | CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf" | ||
| 45 | |||
| 46 | USERADD_PACKAGES = "avahi-daemon avahi-autoipd" | ||
| 47 | USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \ | ||
| 48 | --no-create-home --shell /bin/false \ | ||
| 49 | --user-group avahi" | ||
| 50 | |||
| 51 | USERADD_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 | |||
| 57 | INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd" | ||
| 58 | INITSCRIPT_NAME_avahi-daemon = "avahi-daemon" | ||
| 59 | INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19" | ||
| 60 | INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd" | ||
| 61 | INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19" | ||
| 4 | 62 | ||
| 5 | SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd" | 63 | SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd" |
| 6 | SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service" | 64 | SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service" |
| 7 | SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service" | 65 | SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service" |
| 8 | 66 | ||
| 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \ | 67 | do_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 | |||
| 15 | SRC_URI[md5sum] = "d76c59d0882ac6c256d70a2a585362a6" | ||
| 16 | SRC_URI[sha256sum] = "57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804" | ||
| 17 | |||
| 18 | DEPENDS += "intltool-native" | ||
| 19 | 72 | ||
| 20 | PACKAGES =+ "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. | ||
| 75 | pkg_postinst_avahi-daemon () { | ||
| 76 | if [ -z "$D" ]; then | ||
| 77 | killall -q -HUP dbus-daemon || true | ||
| 78 | fi | ||
| 79 | } | ||
