blob: 825197d6108399da1bdd4dd452e9a9b3d50ab1c7 [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"
10BUGTRACKER = "http://avahi.org/report"
11SECTION = "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
17INC_PR = "r11"
18
19DEPENDS = "expat libcap libdaemon dbus glib-2.0"
20
21SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \
22 file://00avahi-autoipd \
23 file://99avahi-autoipd \
24 file://initscript.patch \
25 file://avahi_fix_install_issue.patch \
26 file://fix_for_automake_1.12.x.patch \
27 file://out-of-tree.patch \
28 file://0001-avahi-fix-avahi-status-command-error-prompt.patch \
29 file://reuseport-check.patch \
30 "
31
32USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
33USERADD_PARAM_avahi-daemon = "--system --home /var/run/avahi-daemon \
34 --no-create-home --shell /bin/false \
35 --user-group avahi"
36
37USERADD_PARAM_avahi-autoipd = "--system --home /var/run/avahi-autoipd \
38 --no-create-home --shell /bin/false \
39 --user-group \
40 -c \"Avahi autoip daemon\" \
41 avahi-autoipd"
42
43inherit autotools pkgconfig update-rc.d gettext useradd
44
45EXTRA_OECONF = "--disable-introspection \
46 --with-avahi-priv-access-group=adm \
47 --disable-stack-protector \
48 --disable-gdbm \
49 --disable-mono \
50 --disable-monodoc \
51 --disable-qt3 \
52 --disable-qt4 \
53 --disable-python \
54 --disable-doxygen-doc \
55 ${EXTRA_OECONF_SYSVINIT} \
56 ${EXTRA_OECONF_SYSTEMD} \
57 ${AVAHI_GTK} \
58 "
59
60# The distro choice determines what init scripts are installed
61EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
62EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}"
63
64AVAHI_GTK ?= "--disable-gtk --disable-gtk3"
65
66LDFLAGS_append_libc-uclibc = " -lintl"
67LDFLAGS_append_uclinux-uclibc = " -lintl"
68
69do_configure_prepend() {
70 sed 's:AM_CHECK_PYMOD:echo "no pymod" #AM_CHECK_PYMOD:g' -i ${S}/configure.ac
71}
72
73
74PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-autoipd avahi-utils"
75
76# As avahi doesn't put any files into PN, clear the files list to avoid problems
77# if extra libraries appear.
78FILES_${PN} = ""
79FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
80 ${sysconfdir}/avahi/avahi-autoipd.action \
81 ${sysconfdir}/dhcp/*/avahi-autoipd \
82 ${sysconfdir}/udhcpc.d/00avahi-autoipd \
83 ${sysconfdir}/udhcpc.d/99avahi-autoipd"
84FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
85FILES_libavahi-core = "${libdir}/libavahi-core.so.*"
86FILES_avahi-daemon = "${sbindir}/avahi-daemon \
87 ${sysconfdir}/avahi/avahi-daemon.conf \
88 ${sysconfdir}/avahi/hosts \
89 ${sysconfdir}/avahi/services \
90 ${sysconfdir}/dbus-1 \
91 ${sysconfdir}/init.d/avahi-daemon \
92 ${datadir}/avahi/introspection/*.introspect \
93 ${datadir}/avahi/avahi-service.dtd \
94 ${datadir}/avahi/service-types \
95 ${datadir}/dbus-1/system-services"
96FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
97FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*"
98FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
99 ${sysconfdir}/avahi/avahi-dnsconfd.action \
100 ${sysconfdir}/init.d/avahi-dnsconfd"
101FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
102FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.*"
103FILES_avahi-utils = "${bindir}/avahi-*"
104
105RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})"
106
107# uclibc has no nss
108RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
109RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
110
111RRECOMMENDS_avahi-dev = "expat-dev libcap-dev libdaemon-dev dbus-dev glib-2.0-dev update-rc.d-dev"
112RRECOMMENDS_avahi-dev_append_libc-glibc = " gettext-dev"
113
114RRECOMMENDS_avahi-dev[nodeprrecs] = "1"
115
116CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
117
118INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
119INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
120INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
121INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
122INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
123
124do_install() {
125 autotools_do_install
126
127 # don't install /var/run when populating rootfs. Do it through volatile
128 # /var/run of current version is empty, so just remove it.
129 # if /var/run become non-empty in the future, need to install it via volatile
130 rm -rf ${D}${localstatedir}/run
131 rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
132 rm -rf ${D}${datadir}/dbus-1/interfaces
133 rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
134 rm -rf ${D}${libdir}/avahi
135
136 install -d ${D}${sysconfdir}/udhcpc.d
137 install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
138 install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
139}
140
141# At the time the postinst runs, dbus might not be setup so only restart if running
142# Don't exit early, because update-rc.d needs to run subsequently.
143
144pkg_postinst_avahi-daemon () {
145if [ -z "$D" ]; then
146 killall -q -HUP dbus-daemon || true
147fi
148}
149
150pkg_postrm_avahi-daemon () {
151 deluser avahi || true
152 delgroup avahi || true
153}
154
155pkg_postrm_avahi-autoipd () {
156 deluser avahi-autoipd || true
157 delgroup avahi-autoipd || true
158}