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