blob: faa8741dc5bab6ad1fdc5f5d5b8773b93cbef6c9 [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
Patrick Williamsc0f7c042017-02-23 20:41:17 -060026# For gtk related PACKAGECONFIGs: gtk, gtk3 and pygtk
27AVAHI_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"
33PACKAGECONFIG[pygtk] = "--enable-pygtk,--disable-pygtk,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
35USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
36USERADD_PARAM_avahi-daemon = "--system --home /var/run/avahi-daemon \
37 --no-create-home --shell /bin/false \
38 --user-group avahi"
39
40USERADD_PARAM_avahi-autoipd = "--system --home /var/run/avahi-autoipd \
41 --no-create-home --shell /bin/false \
42 --user-group \
43 -c \"Avahi autoip daemon\" \
44 avahi-autoipd"
45
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050046inherit autotools pkgconfig update-rc.d gettext useradd gobject-introspection
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048EXTRA_OECONF = "--with-avahi-priv-access-group=adm \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049 --disable-stack-protector \
50 --disable-gdbm \
51 --disable-mono \
52 --disable-monodoc \
53 --disable-qt3 \
54 --disable-qt4 \
55 --disable-python \
56 --disable-doxygen-doc \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050057 --enable-manpages \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058 ${EXTRA_OECONF_SYSVINIT} \
59 ${EXTRA_OECONF_SYSTEMD} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050060 "
61
62# The distro choice determines what init scripts are installed
63EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
64EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}"
65
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066
67LDFLAGS_append_libc-uclibc = " -lintl"
68LDFLAGS_append_uclinux-uclibc = " -lintl"
69
70do_configure_prepend() {
71 sed 's:AM_CHECK_PYMOD:echo "no pymod" #AM_CHECK_PYMOD:g' -i ${S}/configure.ac
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050072
73 # This m4 file will get in the way of our introspection.m4 with special cross-compilation fixes
74 rm "${S}/common/introspection.m4" || true
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075}
76
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050077do_compile_prepend() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060078 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 -050079}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050080
81PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-autoipd avahi-utils"
82
83# As avahi doesn't put any files into PN, clear the files list to avoid problems
84# if extra libraries appear.
85FILES_${PN} = ""
86FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
87 ${sysconfdir}/avahi/avahi-autoipd.action \
88 ${sysconfdir}/dhcp/*/avahi-autoipd \
89 ${sysconfdir}/udhcpc.d/00avahi-autoipd \
90 ${sysconfdir}/udhcpc.d/99avahi-autoipd"
91FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050092FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093FILES_avahi-daemon = "${sbindir}/avahi-daemon \
94 ${sysconfdir}/avahi/avahi-daemon.conf \
95 ${sysconfdir}/avahi/hosts \
96 ${sysconfdir}/avahi/services \
97 ${sysconfdir}/dbus-1 \
98 ${sysconfdir}/init.d/avahi-daemon \
99 ${datadir}/avahi/introspection/*.introspect \
100 ${datadir}/avahi/avahi-service.dtd \
101 ${datadir}/avahi/service-types \
102 ${datadir}/dbus-1/system-services"
103FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
104FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*"
105FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
106 ${sysconfdir}/avahi/avahi-dnsconfd.action \
107 ${sysconfdir}/init.d/avahi-dnsconfd"
108FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500109FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500110FILES_avahi-utils = "${bindir}/avahi-*"
111
112RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})"
113
114# uclibc has no nss
115RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
116RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
117
118RRECOMMENDS_avahi-dev = "expat-dev libcap-dev libdaemon-dev dbus-dev glib-2.0-dev update-rc.d-dev"
119RRECOMMENDS_avahi-dev_append_libc-glibc = " gettext-dev"
120
121RRECOMMENDS_avahi-dev[nodeprrecs] = "1"
122
123CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
124
125INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
126INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
127INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
128INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
129INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
130
131do_install() {
132 autotools_do_install
133
134 # don't install /var/run when populating rootfs. Do it through volatile
135 # /var/run of current version is empty, so just remove it.
136 # if /var/run become non-empty in the future, need to install it via volatile
137 rm -rf ${D}${localstatedir}/run
138 rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
139 rm -rf ${D}${datadir}/dbus-1/interfaces
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500140 test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500141 rm -rf ${D}${libdir}/avahi
142
143 install -d ${D}${sysconfdir}/udhcpc.d
144 install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
145 install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
146}
147
148# At the time the postinst runs, dbus might not be setup so only restart if running
149# Don't exit early, because update-rc.d needs to run subsequently.
150
151pkg_postinst_avahi-daemon () {
152if [ -z "$D" ]; then
153 killall -q -HUP dbus-daemon || true
154fi
155}