blob: 81aad7935a709ee69aee243bbd58456ca141d3a4 [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
26PACKAGECONFIG ??= "dbus"
27PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028
29USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
30USERADD_PARAM_avahi-daemon = "--system --home /var/run/avahi-daemon \
31 --no-create-home --shell /bin/false \
32 --user-group avahi"
33
34USERADD_PARAM_avahi-autoipd = "--system --home /var/run/avahi-autoipd \
35 --no-create-home --shell /bin/false \
36 --user-group \
37 -c \"Avahi autoip daemon\" \
38 avahi-autoipd"
39
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050040inherit autotools pkgconfig update-rc.d gettext useradd gobject-introspection
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050042EXTRA_OECONF = "--with-avahi-priv-access-group=adm \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043 --disable-stack-protector \
44 --disable-gdbm \
45 --disable-mono \
46 --disable-monodoc \
47 --disable-qt3 \
48 --disable-qt4 \
49 --disable-python \
50 --disable-doxygen-doc \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050051 --disable-manpages \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052 ${EXTRA_OECONF_SYSVINIT} \
53 ${EXTRA_OECONF_SYSTEMD} \
54 ${AVAHI_GTK} \
55 "
56
57# The distro choice determines what init scripts are installed
58EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
59EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}"
60
61AVAHI_GTK ?= "--disable-gtk --disable-gtk3"
62
63LDFLAGS_append_libc-uclibc = " -lintl"
64LDFLAGS_append_uclinux-uclibc = " -lintl"
65
66do_configure_prepend() {
67 sed 's:AM_CHECK_PYMOD:echo "no pymod" #AM_CHECK_PYMOD:g' -i ${S}/configure.ac
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050068
69 # This m4 file will get in the way of our introspection.m4 with special cross-compilation fixes
70 rm "${S}/common/introspection.m4" || true
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071}
72
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050073do_compile_prepend() {
74 export GIR_EXTRA_LIBS_PATH="${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs"
75}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076
77PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-autoipd avahi-utils"
78
79# As avahi doesn't put any files into PN, clear the files list to avoid problems
80# if extra libraries appear.
81FILES_${PN} = ""
82FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
83 ${sysconfdir}/avahi/avahi-autoipd.action \
84 ${sysconfdir}/dhcp/*/avahi-autoipd \
85 ${sysconfdir}/udhcpc.d/00avahi-autoipd \
86 ${sysconfdir}/udhcpc.d/99avahi-autoipd"
87FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050088FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050089FILES_avahi-daemon = "${sbindir}/avahi-daemon \
90 ${sysconfdir}/avahi/avahi-daemon.conf \
91 ${sysconfdir}/avahi/hosts \
92 ${sysconfdir}/avahi/services \
93 ${sysconfdir}/dbus-1 \
94 ${sysconfdir}/init.d/avahi-daemon \
95 ${datadir}/avahi/introspection/*.introspect \
96 ${datadir}/avahi/avahi-service.dtd \
97 ${datadir}/avahi/service-types \
98 ${datadir}/dbus-1/system-services"
99FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
100FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*"
101FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
102 ${sysconfdir}/avahi/avahi-dnsconfd.action \
103 ${sysconfdir}/init.d/avahi-dnsconfd"
104FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500105FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500106FILES_avahi-utils = "${bindir}/avahi-*"
107
108RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})"
109
110# uclibc has no nss
111RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
112RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
113
114RRECOMMENDS_avahi-dev = "expat-dev libcap-dev libdaemon-dev dbus-dev glib-2.0-dev update-rc.d-dev"
115RRECOMMENDS_avahi-dev_append_libc-glibc = " gettext-dev"
116
117RRECOMMENDS_avahi-dev[nodeprrecs] = "1"
118
119CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
120
121INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
122INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
123INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
124INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
125INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
126
127do_install() {
128 autotools_do_install
129
130 # don't install /var/run when populating rootfs. Do it through volatile
131 # /var/run of current version is empty, so just remove it.
132 # if /var/run become non-empty in the future, need to install it via volatile
133 rm -rf ${D}${localstatedir}/run
134 rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
135 rm -rf ${D}${datadir}/dbus-1/interfaces
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500136 test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500137 rm -rf ${D}${libdir}/avahi
138
139 install -d ${D}${sysconfdir}/udhcpc.d
140 install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
141 install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
142}
143
144# At the time the postinst runs, dbus might not be setup so only restart if running
145# Don't exit early, because update-rc.d needs to run subsequently.
146
147pkg_postinst_avahi-daemon () {
148if [ -z "$D" ]; then
149 killall -q -HUP dbus-daemon || true
150fi
151}
152
153pkg_postrm_avahi-daemon () {
154 deluser avahi || true
155 delgroup avahi || true
156}
157
158pkg_postrm_avahi-autoipd () {
159 deluser avahi-autoipd || true
160 delgroup avahi-autoipd || true
161}