summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2007-05-09 13:38:37 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2007-05-09 13:38:37 +0000
commit24cb67ca98a060adcf38eb4b56012fdf98198fe1 (patch)
tree300d656527219cefe4f00a062e84c5a01cb4bc3c
parent39b88e3691017d7ea44211dad98f316480d4676a (diff)
avahi-daemon support
-rw-r--r--package/avahi/Config.in27
-rw-r--r--package/avahi/S50avahi-daemon20
-rw-r--r--package/avahi/avahi.mk46
3 files changed, 87 insertions, 6 deletions
diff --git a/package/avahi/Config.in b/package/avahi/Config.in
index 7ee466213..b4657ee40 100644
--- a/package/avahi/Config.in
+++ b/package/avahi/Config.in
@@ -2,7 +2,30 @@ config BR2_PACKAGE_AVAHI
bool "avahi"
default n
help
- Avahi is a system which facilitates service
- discovery on a local network.
+ Avahi is a system which facilitates service
+ discovery on a local network.
http://www.avahi.org/
+
+config BR2_PACKAGE_AVAHI_AUTOIPD
+ bool " IPv4LL network address configuration daemon"
+ default y
+ depends on BR2_PACKAGE_AVAHI
+ help
+ Avahi-autoipd implements IPv4LL, "Dynamic Configuration of
+ IPv4 Link-Local Addresses" (IETF RFC3927), a protocol for
+ automatic IP address configuration from the link-local
+ 169.254.0.0/16 range without the need for a central server.
+ It is primarily intended to be used in ad-hoc networks which
+ lack a DHCP server.
+
+config BR2_PACKAGE_AVAHI_DAEMON
+ bool " mDNS/DNS-SD daemon"
+ default n
+ depends on BR2_PACKAGE_AVAHI
+ select BR2_PACKAGE_EXPAT
+ help
+ The Avahi mDNS/DNS-SD daemon implementing Apple's ZeroConf
+ architecture (also known as "Rendezvous" or "Bonjour").
+ The daemon registers local IP addresses and services using
+ mDNS/DNS-SD.
diff --git a/package/avahi/S50avahi-daemon b/package/avahi/S50avahi-daemon
new file mode 100644
index 000000000..81ac51316
--- /dev/null
+++ b/package/avahi/S50avahi-daemon
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# avahi-daemon init script
+
+DAEMON=/usr/sbin/avahi-daemon
+case "$1" in
+ start)
+ $DAEMON -c || $DAEMON -D
+ ;;
+ stop)
+ $DAEMON -c && $DAEMON -k
+ ;;
+ reload)
+ $DAEMON -c && $DAEMON -r
+ ;;
+ *)
+ echo "Usage: S50avahi-daemon {start|stop|reload}" >&2
+ exit 1
+ ;;
+esac
diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
index ad86c8f97..4b0f306b8 100644
--- a/package/avahi/avahi.mk
+++ b/package/avahi/avahi.mk
@@ -16,6 +16,23 @@ AVAHI_SITE:=http://www.avahi.org/download/
AVAHI_SOURCE:=avahi-$(AVAHI_VER).tar.gz
AVAHI_CAT:=$(ZCAT)
+AVAHI_TARGETS:=
+
+ifeq ($(strip $(BR2_PACKAGE_AVAHI_AUTOIPD)),y)
+AVAHI_TARGETS+=$(TARGET_DIR)/usr/sbin/avahi-autoipd
+endif
+
+ifeq ($(strip $(BR2_PACKAGE_AVAHI_DAEMON)),y)
+AVAHI_TARGETS+=$(TARGET_DIR)/usr/sbin/avahi-daemon
+AVAHI_DISABLE_EXPAT:=
+# depend on the exact library file instead of expat so avahi isn't always
+# considered out-of-date
+AVAHI_EXPAT_DEP:=$(STAGING_DIR)/lib/libexpat.so.1
+else
+AVAHI_DISABLE_EXPAT:=--disable-expat
+AVAHI_EXPAT_DEP:=
+endif
+
$(DL_DIR)/$(AVAHI_SOURCE):
$(WGET) -P $(DL_DIR) $(AVAHI_SITE)/$(AVAHI_SOURCE)
@@ -26,7 +43,7 @@ $(AVAHI_DIR)/.unpacked: $(DL_DIR)/$(AVAHI_SOURCE)
toolchain/patch-kernel.sh $(AVAHI_DIR) package/avahi/ \*.patch
touch $(AVAHI_DIR)/.unpacked
-$(AVAHI_DIR)/.configured: $(AVAHI_DIR)/.unpacked
+$(AVAHI_DIR)/.configured: $(AVAHI_DIR)/.unpacked $(AVAHI_EXPAT_DEP)
(cd $(AVAHI_DIR) && rm -rf config.cache && autoconf)
( \
cd $(AVAHI_DIR) && \
@@ -111,7 +128,7 @@ $(AVAHI_DIR)/.configured: $(AVAHI_DIR)/.unpacked
--disable-qt4 \
--disable-gtk \
--disable-dbus \
- --disable-expat \
+ $(AVAHI_DISABLE_EXPAT) \
--disable-gdbm \
--disable-python \
--disable-python-dbus \
@@ -132,7 +149,7 @@ $(AVAHI_DIR)/.compiled: $(AVAHI_DIR)/.configured
$(STAGING_DIR)/usr/sbin/avahi-autoipd: $(AVAHI_DIR)/.compiled
$(MAKE) DESTDIR=$(STAGING_DIR) -C $(AVAHI_DIR)/avahi-autoipd install
- touch -c $(STAGING_DIR)/usr/sbin/avahi-autoipd
+ touch -c $@
$(TARGET_DIR)/usr/sbin/avahi-autoipd: $(STAGING_DIR)/usr/sbin/avahi-autoipd
cp $^ $@
@@ -145,13 +162,34 @@ $(TARGET_DIR)/usr/sbin/avahi-autoipd: $(STAGING_DIR)/usr/sbin/avahi-autoipd
chmod 0755 $(TARGET_DIR)/usr/share/udhcpc/default.script
$(STRIP) --strip-unneeded $@
-avahi: uclibc busybox libdaemon $(TARGET_DIR)/usr/sbin/avahi-autoipd
+$(STAGING_DIR)/usr/lib/libavahi-common.so: $(AVAHI_DIR)/.compiled
+ $(MAKE) DESTDIR=$(STAGING_DIR) -C $(AVAHI_DIR)/avahi-common install
+ touch -c $@
+
+$(STAGING_DIR)/usr/lib/libavahi-core.so: $(AVAHI_DIR)/.compiled $(STAGING_DIR)/usr/lib/libavahi-common.so
+ $(MAKE) DESTDIR=$(STAGING_DIR) -C $(AVAHI_DIR)/avahi-core install
+ touch -c $@
+
+$(STAGING_DIR)/usr/sbin/avahi-daemon: $(AVAHI_DIR)/.compiled $(STAGING_DIR)/usr/lib/libavahi-core.so $(STAGING_DIR)/usr/lib/libavahi-common.so
+ $(MAKE) DESTDIR=$(STAGING_DIR) -C $(AVAHI_DIR)/avahi-daemon install
+ touch -c $@
+
+$(TARGET_DIR)/usr/sbin/avahi-daemon: $(STAGING_DIR)/usr/sbin/avahi-daemon
+ cp $^ $@
+ cp -dpf $(STAGING_DIR)/lib/libavahi-*.so* $(TARGET_DIR)/usr/lib/
+ mkdir -p $(TARGET_DIR)/etc/avahi/services
+ cp -af $(BASE_DIR)/package/avahi/S50avahi-daemon $(TARGET_DIR)/etc/init.d/
+ $(STRIP) --strip-unneeded $@
+ $(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libavahi-*.so*
+
+avahi: uclibc busybox libdaemon $(AVAHI_TARGETS)
avahi-clean:
$(MAKE) -C $(AVAHI_DIR) distclean
rm -rf $(TARGET_DIR)/etc/avahi
rm -f $(TARGET_DIR)/var/lib/avahi-autoipd
rm -f $(TARGET_DIR)/etc/init.d/S*avahi*
+ rm -f $(TARGET_DIR)/usr/sbin/avahi-*
avahi-dirclean:
rm -rf $(AVAHI_DIR)