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