diff options
Diffstat (limited to 'meta/recipes-connectivity/avahi/avahi.inc')
-rw-r--r-- | meta/recipes-connectivity/avahi/avahi.inc | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/avahi/avahi.inc b/meta/recipes-connectivity/avahi/avahi.inc new file mode 100644 index 0000000000..6f894417fc --- /dev/null +++ b/meta/recipes-connectivity/avahi/avahi.inc | |||
@@ -0,0 +1,152 @@ | |||
1 | SUMMARY = "Avahi IPv4LL network address configuration daemon" | ||
2 | DESCRIPTION = 'Avahi is a fully LGPL framework for Multicast DNS Service Discovery. It \ | ||
3 | allows programs to publish and discover services and hosts running on a local network \ | ||
4 | with no specific configuration. This tool implements IPv4LL, "Dynamic Configuration of \ | ||
5 | IPv4 Link-Local Addresses" (IETF RFC3927), a protocol for automatic IP address \ | ||
6 | configuration from the link-local 169.254.0.0/16 range without the need for a central \ | ||
7 | server.' | ||
8 | AUTHOR = "Lennart Poettering <lennart@poettering.net>" | ||
9 | HOMEPAGE = "http://avahi.org" | ||
10 | BUGTRACKER = "http://avahi.org/report" | ||
11 | SECTION = "network" | ||
12 | |||
13 | # major part is under LGPLv2.1+, but several .dtd, .xsl, initscripts and | ||
14 | # python scripts are under GPLv2+ | ||
15 | LICENSE = "GPLv2+ & LGPLv2.1+" | ||
16 | |||
17 | INC_PR = "r11" | ||
18 | |||
19 | DEPENDS = "expat libcap libdaemon dbus glib-2.0" | ||
20 | |||
21 | SRC_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 | |||
32 | USERADD_PACKAGES = "avahi-daemon avahi-autoipd" | ||
33 | USERADD_PARAM_avahi-daemon = "--system --home /var/run/avahi-daemon \ | ||
34 | --no-create-home --shell /bin/false \ | ||
35 | --user-group avahi" | ||
36 | |||
37 | USERADD_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 | |||
43 | inherit autotools pkgconfig update-rc.d gettext useradd | ||
44 | |||
45 | EXTRA_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 | ||
61 | EXTRA_OECONF_SYSVINIT = "${@base_contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}" | ||
62 | EXTRA_OECONF_SYSTEMD = "${@base_contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}" | ||
63 | |||
64 | AVAHI_GTK ?= "--disable-gtk --disable-gtk3" | ||
65 | |||
66 | LDFLAGS_append_libc-uclibc = " -lintl" | ||
67 | LDFLAGS_append_uclinux-uclibc = " -lintl" | ||
68 | |||
69 | do_configure_prepend() { | ||
70 | sed 's:AM_CHECK_PYMOD:echo "no pymod" #AM_CHECK_PYMOD:g' -i ${S}/configure.ac | ||
71 | } | ||
72 | |||
73 | |||
74 | PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-autoipd avahi-utils" | ||
75 | |||
76 | FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \ | ||
77 | ${sysconfdir}/avahi/avahi-autoipd.action \ | ||
78 | ${sysconfdir}/dhcp/*/avahi-autoipd \ | ||
79 | ${sysconfdir}/udhcpc.d/00avahi-autoipd \ | ||
80 | ${sysconfdir}/udhcpc.d/99avahi-autoipd" | ||
81 | FILES_libavahi-common = "${libdir}/libavahi-common.so.*" | ||
82 | FILES_libavahi-core = "${libdir}/libavahi-core.so.*" | ||
83 | FILES_avahi-daemon = "${sbindir}/avahi-daemon \ | ||
84 | ${sysconfdir}/avahi/avahi-daemon.conf \ | ||
85 | ${sysconfdir}/avahi/hosts \ | ||
86 | ${sysconfdir}/avahi/services \ | ||
87 | ${sysconfdir}/dbus-1 \ | ||
88 | ${sysconfdir}/init.d/avahi-daemon \ | ||
89 | ${datadir}/avahi/introspection/*.introspect \ | ||
90 | ${datadir}/avahi/avahi-service.dtd \ | ||
91 | ${datadir}/avahi/service-types \ | ||
92 | ${datadir}/dbus-1/system-services" | ||
93 | FILES_libavahi-client = "${libdir}/libavahi-client.so.*" | ||
94 | FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*" | ||
95 | FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \ | ||
96 | ${sysconfdir}/avahi/avahi-dnsconfd.action \ | ||
97 | ${sysconfdir}/init.d/avahi-dnsconfd" | ||
98 | FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*" | ||
99 | FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.*" | ||
100 | FILES_avahi-utils = "${bindir}/avahi-*" | ||
101 | |||
102 | # uclibc has no nss | ||
103 | RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns" | ||
104 | RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns" | ||
105 | |||
106 | RRECOMMENDS_avahi-dev = "expat-dev libcap-dev libdaemon-dev dbus-dev glib-2.0-dev update-rc.d-dev" | ||
107 | RRECOMMENDS_avahi-dev_append_libc-glibc = " gettext-dev" | ||
108 | |||
109 | RRECOMMENDS_avahi-dev[nodeprrecs] = "1" | ||
110 | |||
111 | CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf" | ||
112 | |||
113 | INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd" | ||
114 | INITSCRIPT_NAME_avahi-daemon = "avahi-daemon" | ||
115 | INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19" | ||
116 | INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd" | ||
117 | INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19" | ||
118 | |||
119 | do_install() { | ||
120 | autotools_do_install | ||
121 | |||
122 | # don't install /var/run when populating rootfs. Do it through volatile | ||
123 | # /var/run of current version is empty, so just remove it. | ||
124 | # if /var/run become non-empty in the future, need to install it via volatile | ||
125 | rm -rf ${D}/var/run | ||
126 | rm -rf ${D}${datadir}/dbus-1/interfaces | ||
127 | rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1 | ||
128 | rm -rf ${D}${libdir}/avahi | ||
129 | |||
130 | install -d ${D}${sysconfdir}/udhcpc.d | ||
131 | install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d | ||
132 | install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d | ||
133 | } | ||
134 | |||
135 | # At the time the postinst runs, dbus might not be setup so only restart if running | ||
136 | # Don't exit early, because update-rc.d needs to run subsequently. | ||
137 | |||
138 | pkg_postinst_avahi-daemon () { | ||
139 | if [ -z "$D" ]; then | ||
140 | killall -q -HUP dbus-daemon || true | ||
141 | fi | ||
142 | } | ||
143 | |||
144 | pkg_postrm_avahi-daemon () { | ||
145 | deluser avahi || true | ||
146 | delgroup avahi || true | ||
147 | } | ||
148 | |||
149 | pkg_postrm_avahi-autoipd () { | ||
150 | deluser avahi-autoipd || true | ||
151 | delgroup avahi-autoipd || true | ||
152 | } | ||