Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[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 DEPENDS = "expat virtual/libintl libdaemon dbus glib-2.0"
8 DEPENDS_append_opendreambox = " libnss-mdns"
9
10 # uclibc has no nss
11 RRECOMMENDS_avahi-daemon_append_linux = " ${@base_conditional('DISTRO', 'opendreambox', 'libavahi-client zeroconf', 'libnss-mdns', d)}"
12 RDEPENDS_avahi-daemon += "sysvinit-pidof update-rc.d"
13 RDEPENDS_avahi-autoipd += "update-rc.d"
14
15 SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \
16            file://00avahi-autoipd file://99avahi-autoipd"
17
18 inherit autotools pkgconfig update-rc.d
19 # handle update-rc.d RDEPENDS manually, we don't need it on
20 # anything but avahi-daemon and avahi-autoipd
21 RDEPENDS_append = ""
22
23 # TODO: build and enable all the extra stuff avahi offers
24 EXTRA_OECONF = "--with-distro=debian  --disable-stack-protector --disable-nls --disable-gdbm ${AVAHI_GTK} --disable-mono --disable-monodoc --disable-qt3 --disable-qt4 ${AVAHI_PYTHON}"
25 AVAHI_PYTHON = "--disable-python"
26 AVAHI_GTK = "--disable-gtk"
27
28 LDFLAGS_append_linux-uclibc = " -lintl"
29 LDFLAGS_append_linux-uclibcgnueabi = " -lintl "
30 LDFLAGS_append_uclinux-uclibc = " -lintl"
31
32 PACKAGES =+ "avahi-daemon avahi-discover libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-discover-standalone avahi-autoipd avahi-utils"
33
34 FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
35 FILES_libavahi-core = "${libdir}/libavahi-core.so.*"
36 FILES_avahi-daemon = "${sbindir}/avahi-daemon \
37                       ${sysconfdir}/avahi/avahi-daemon.conf \
38                       ${sysconfdir}/avahi/hosts \
39                       ${sysconfdir}/avahi/services \
40                       ${sysconfdir}/dbus-1 \
41                       ${sysconfdir}/init.d/avahi-daemon \
42                       ${datadir}/avahi/introspection/*.introspect \
43                       ${datadir}/avahi/avahi-service.dtd \
44                       ${datadir}/avahi/service-types"
45 FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
46 FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*"
47 FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
48                         ${sysconfdir}/avahi/avahi-dnsconfd.action \
49                         ${sysconfdir}/init.d/avahi-dnsconfd"
50 FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
51 FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.*"
52 FILES_avahi-utils = "${bindir}/avahi-*"
53 FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
54                        ${sysconfdir}/avahi/avahi-autoipd.action \
55                        ${sysconfdir}/udhcpc.d/*avahi-autoipd"
56 FILES_python-avahi = "${libdir}/python*/site-packages/avahi/*"
57 FILES_avahi-discover = "${bindir}/avahi-discover \
58                         ${datadir}/applications/avahi-discover.desktop \
59                         ${datadir}/avahi/interfaces/avahi-discover.glade"
60 FILES_avahi-discover-standalone = "${bindir}/avahi-discover-standalone \
61                                    ${datadir}/avahi/interfaces/avahi-discover.glade"
62 CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
63
64 INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
65 INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
66 INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
67 INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
68 INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
69
70 # At the time the postinst runs, dbus might not be setup so only restart if running
71
72 pkg_postinst_avahi-daemon () {
73         # can't do this offline
74         if [ "x$D" != "x" ]; then
75                 exit 1
76         fi
77         grep "^avahi:" /etc/group > /dev/null || addgroup avahi
78         grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
79
80         DBUSPID="/var/run/dbus/pid"
81         if [ -f $DBUSPID ]; then
82                 if ps `cat $DBUSPID` > /dev/null; then
83                         /etc/init.d/dbus-1 force-reload
84                 fi
85         fi
86 }
87
88 pkg_postinst_avahi-autoipd () {
89         # can't do this offline
90         if [ "x$D" != "x" ]; then
91                 exit 1
92         fi
93         grep "^avahi-autoipd:" /etc/group > /dev/null || addgroup avahi-autoipd
94         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"
95 }
96
97 pkg_postrm_avahi-daemon () {
98         deluser avahi || true
99         delgroup avahi || true
100 }
101
102 pkg_postrm_avahi-autoipd () {
103         deluser avahi-autoipd || true
104         delgroup avahi-autoipd || true
105 }
106
107 do_install() {
108         autotools_do_install
109         install -d ${D}${sysconfdir}/udhcpc.d
110         install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
111         install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
112 }
113
114 do_stage() {
115         autotools_stage_all
116 }