blob: ec368de4f4a8b5ad7957a825472e3f3a9f087609 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Avahi IPv4LL network address configuration daemon"
2DESCRIPTION = 'Avahi is a fully LGPL framework for Multicast DNS Service Discovery. It \
3allows programs to publish and discover services and hosts running on a local network \
4with no specific configuration. This tool implements IPv4LL, "Dynamic Configuration of \
5IPv4 Link-Local Addresses" (IETF RFC3927), a protocol for automatic IP address \
6configuration from the link-local 169.254.0.0/16 range without the need for a central \
7server.'
8AUTHOR = "Lennart Poettering <lennart@poettering.net>"
9HOMEPAGE = "http://avahi.org"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050010BUGTRACKER = "https://github.com/lathiat/avahi/issues"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011SECTION = "network"
12
13# major part is under LGPLv2.1+, but several .dtd, .xsl, initscripts and
14# python scripts are under GPLv2+
15LICENSE = "GPLv2+ & LGPLv2.1+"
16
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050017DEPENDS = "expat libcap libdaemon glib-2.0 intltool-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}.tar.gz \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020 file://00avahi-autoipd \
21 file://99avahi-autoipd \
22 file://initscript.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023 "
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050024UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/"
25
Brad Bishop316dfdd2018-06-25 12:45:53 -040026# For gtk related PACKAGECONFIGs: gtk, gtk3
Patrick Williamsc0f7c042017-02-23 20:41:17 -060027AVAHI_GTK ?= ""
28
29PACKAGECONFIG ??= "dbus ${AVAHI_GTK}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060031PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+"
32PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033
34USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
Brad Bishop316dfdd2018-06-25 12:45:53 -040035USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036 --no-create-home --shell /bin/false \
37 --user-group avahi"
38
Brad Bishop316dfdd2018-06-25 12:45:53 -040039USERADD_PARAM_avahi-autoipd = "--system --home /run/avahi-autoipd \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040 --no-create-home --shell /bin/false \
41 --user-group \
42 -c \"Avahi autoip daemon\" \
43 avahi-autoipd"
44
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050045inherit autotools pkgconfig update-rc.d gettext useradd gobject-introspection
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050047EXTRA_OECONF = "--with-avahi-priv-access-group=adm \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048 --disable-stack-protector \
49 --disable-gdbm \
50 --disable-mono \
51 --disable-monodoc \
52 --disable-qt3 \
53 --disable-qt4 \
54 --disable-python \
55 --disable-doxygen-doc \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050056 --enable-manpages \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057 ${EXTRA_OECONF_SYSVINIT} \
58 ${EXTRA_OECONF_SYSTEMD} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059 "
60
61# The distro choice determines what init scripts are installed
62EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
63EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}"
64
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065do_configure_prepend() {
66 sed 's:AM_CHECK_PYMOD:echo "no pymod" #AM_CHECK_PYMOD:g' -i ${S}/configure.ac
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050067
68 # This m4 file will get in the way of our introspection.m4 with special cross-compilation fixes
69 rm "${S}/common/introspection.m4" || true
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070}
71
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050072do_compile_prepend() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060073 export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050074}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075
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.*"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050087FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088FILES_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.*"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500104FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500105FILES_avahi-utils = "${bindir}/avahi-*"
106
107RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})"
108
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500109RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
110RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
111
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500112CONFFILES_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() {
121 autotools_do_install
Brad Bishop316dfdd2018-06-25 12:45:53 -0400122 rm -rf ${D}/run
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123 rm -rf ${D}${datadir}/dbus-1/interfaces
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500124 test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500125 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}