merge of '246b0146c14e51a55e58803f7d5d1db831a78ee0'
[vuplus_openembedded] / packages / avahi / avahi.inc
1 DESCRIPTION = "Avahi implements the DNS-SD over Multicast DNS"
2 AUTHOR = "Lennart Poettering <lennart@poettering.net>"
3 HOMEPAGE = "http://avahi.org"
4 SECTION = "network"
5 PRIORITY = "optional"
6 LICENSE = "GPL"
7 PR="r4"
8
9 DEPENDS = "expat libdaemon dbus glib-2.0"
10 RRECOMMENDS = "libnss-mdns"
11 RRECOMMENDS_avahi-daemon = "libnss-mdns"
12 RDEPENDS_avahi-daemon = "sysvinit-pidof"
13
14 SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \
15            file://00avahi-autoipd file://99avahi-autoipd"
16
17 inherit autotools pkgconfig update-rc.d
18
19 EXTRA_OECONF = "--with-distro=debian --disable-gdbm --disable-gtk --disable-mono --disable-monodoc --disable-qt3 --disable-qt4 --disable-python"
20
21 PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib avahi-autoipd avahi-utils"
22
23 FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
24 FILES_libavahi-core = "${libdir}/libavahi-core.so.*"
25 FILES_avahi-daemon = "${sbindir}/avahi-daemon \
26                       ${sysconfdir}/avahi/avahi-daemon.conf \
27                       ${sysconfdir}/avahi/hosts \
28                       ${sysconfdir}/avahi/services \
29                       ${sysconfdir}/dbus-1 \
30                       ${sysconfdir}/init.d/avahi-daemon \
31                       ${datadir}/avahi/introspection/*.introspect \
32                       ${datadir}/avahi/avahi-service.dtd \
33                       ${datadir}/avahi/service-types"
34 FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
35 FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
36                         ${sysconfdir}/avahi/avahi-dnsconfd.action \
37                         ${sysconfdir}/init.d/avahi-dnsconfd"
38 FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
39 FILES_avahi-utils = "${bindir}/avahi-*"
40 FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
41                        ${sysconfdir}/avahi/avahi-autoipd.action \
42                        ${sysconfdir}/udhcpc.d/*avahi-autoipd"
43
44 CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
45
46 INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
47 INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
48 INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
49 INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
50 INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
51
52 # At the time the postinst runs, dbus might not be setup so only restart if running
53
54 pkg_postinst_avahi-daemon () {
55         # can't do this offline
56         if [ "x$D" != "x" ]; then
57                 exit 1
58         fi
59         grep "^avahi:" /etc/group > /dev/null || addgroup avahi
60         grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
61
62         DBUSPID=`pidof dbus-daemon`
63
64         if [ "x$DBUSPID" != "x" ]; then
65                 /etc/init.d/dbus-1 force-reload
66         fi
67 }
68
69 pkg_postinst_avahi-autoipd () {
70         # can't do this offline
71         if [ "x$D" != "x" ]; then
72                 exit 1
73         fi
74         grep "^avahi-autoipd:" /etc/group > /dev/null || addgroup avahi-autoipd
75         grep "^avahi-autoipd:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/lib/avahi-autoipd --no-create-home avahi-autoipd --ingroup avahi-autoipd -g "Avahi autoip daemon"
76 }
77
78 pkg_postrm_avahi-daemon () {
79         deluser avahi || true
80         delgroup avahi || true
81 }
82
83 pkg_postrm_avahi-autoipd () {
84         deluser avahi-autoipd || true
85         delgroup avahi-autoipd || true
86 }
87
88 do_install() {
89         autotools_do_install
90         install -d ${D}${sysconfdir}/udhcpc.d
91         install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
92         install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
93 }
94
95 do_stage() {
96         autotools_stage_all
97 }