diff options
author | Philipp Zabel <philipp.zabel@gmail.com> | 2007-03-28 09:24:20 +0000 |
---|---|---|
committer | Philipp Zabel <philipp.zabel@gmail.com> | 2007-03-28 09:24:20 +0000 |
commit | 2fbac633f4f49ee742e8ff18a788ed6bb2031749 (patch) | |
tree | 0a6c37a34b964206c383857f98fc441fe82cea42 | |
parent | 90f4b2907d7755fb16f89d4184202b8278ff2cfd (diff) |
avahi: add scripts to start avahi-autoipd from udhcpc
-rw-r--r-- | packages/avahi/avahi.inc | 28 | ||||
-rw-r--r-- | packages/avahi/files/.mtn2git_empty | 0 | ||||
-rwxr-xr-x | packages/avahi/files/00avahi-autoipd | 10 | ||||
-rwxr-xr-x | packages/avahi/files/99avahi-autoipd | 10 |
4 files changed, 46 insertions, 2 deletions
diff --git a/packages/avahi/avahi.inc b/packages/avahi/avahi.inc index 3a0b28cc53..fb71361a1d 100644 --- a/packages/avahi/avahi.inc +++ b/packages/avahi/avahi.inc @@ -4,12 +4,14 @@ HOMEPAGE = "http://avahi.org" SECTION = "network" PRIORITY = "optional" LICENSE = "GPL" +PR="r1" DEPENDS = "expat libdaemon dbus glib-2.0" RRECOMMENDS = "libnss-mdns" RRECOMMENDS_avahi-daemon = "libnss-mdns" -SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz" +SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \ + file://00avahi-autoipd file://99avahi-autoipd" inherit autotools pkgconfig update-rc.d @@ -35,7 +37,8 @@ FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \ FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*" FILES_avahi-utils = "${bindir}/avahi-*" FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \ - ${sysconfdir}/avahi/avahi-autoipd.action" + ${sysconfdir}/avahi/avahi-autoipd.action \ + ${sysconfdir}/udhcpc.d/*avahi-autoipd" CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf" @@ -62,11 +65,32 @@ pkg_postinst_avahi-daemon () { fi } +pkg_postinst_avahi-autoipd () { + # can't do this offline + if [ "x$D" != "x" ]; then + exit 1 + fi + grep avahi-autoipd /etc/group || addgroup avahi-autoipd + grep avahi-autoipd /etc/passwd || adduser --disabled-password --system --home /var/lib/avahi-autoipd --no-create-home avahi-autoipd --ingroup avahi-autoipd -g "Avahi autoip daemon" +} + pkg_postrm_avahi-daemon () { deluser avahi || true delgroup avahi || true } +pkg_postrm_avahi-autoipd () { + deluser avahi-autoipd || true + delgroup avahi-autoipd || true +} + +do_install() { + autotools_do_install + install -d ${D}${sysconfdir}/udhcpc.d + install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d + install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d +} + do_stage() { autotools_stage_all } diff --git a/packages/avahi/files/.mtn2git_empty b/packages/avahi/files/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/avahi/files/.mtn2git_empty diff --git a/packages/avahi/files/00avahi-autoipd b/packages/avahi/files/00avahi-autoipd new file mode 100755 index 0000000000..a0ab814603 --- /dev/null +++ b/packages/avahi/files/00avahi-autoipd @@ -0,0 +1,10 @@ +#!/bin/sh + +[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 + +case "$1" in + + deconfig|renew|bound) + /usr/sbin/avahi-autoipd -k $interface 2> /dev/null + ;; +esac diff --git a/packages/avahi/files/99avahi-autoipd b/packages/avahi/files/99avahi-autoipd new file mode 100755 index 0000000000..234cdaa3eb --- /dev/null +++ b/packages/avahi/files/99avahi-autoipd @@ -0,0 +1,10 @@ +#!/bin/sh + +[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 + +case "$1" in + + leasefail) + /usr/sbin/avahi-autoipd -wD $interface 2> /dev/null + ;; +esac |