avahi: convert old-style hook to new-style hook
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 1 Sep 2010 15:10:57 +0000 (17:10 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 12 Sep 2010 17:24:58 +0000 (19:24 +0200)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/avahi/avahi.mk

index 8e2d14f6e08c5cb4bd9457693d1119e49b979056..e1bebd9149a47fbb94e49acdb5f576ae3008412f 100644 (file)
@@ -137,19 +137,31 @@ AVAHI_DEPENDENCIES += libintl
 AVAHI_MAKE_OPT = LIBS=-lintl
 endif
 
-$(eval $(call AUTOTARGETS,package,avahi))
-
-$(AVAHI_HOOK_POST_INSTALL):
+define AVAHI_REMOVE_INITSCRIPT
        rm -rf $(TARGET_DIR)/etc/init.d/avahi-*
-ifeq ($(BR2_PACKAGE_AVAHI_AUTOIPD),y)
+endef
+
+AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_REMOVE_INITSCRIPT
+
+define AVAHI_INSTALL_AUTOIPD
        rm -rf $(TARGET_DIR)/etc/dhcp3/
        $(INSTALL) -D -m 0755 package/avahi/busybox-udhcpc-default.script $(TARGET_DIR)/usr/share/udhcpc/default.script
        $(INSTALL) -m 0755 package/avahi/S05avahi-setup.sh $(TARGET_DIR)/etc/init.d/
        rm -f $(TARGET_DIR)/var/lib/avahi-autoipd
        $(INSTALL) -d -m 0755 $(TARGET_DIR)/var/lib
        ln -sf /tmp/avahi-autoipd $(TARGET_DIR)/var/lib/avahi-autoipd
+endef
+
+ifeq ($(BR2_PACKAGE_AVAHI_AUTOIPD),y)
+AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_INSTALL_AUTOIPD
 endif
-ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
+
+define AVAHI_INSTALL_DAEMON_INITSCRIPT
        $(INSTALL) -m 0755 package/avahi/S50avahi-daemon $(TARGET_DIR)/etc/init.d/
+endef
+
+ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
+AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_INSTALL_DAEMON_INITSCRIPT
 endif
-       touch $@
+
+$(eval $(call AUTOTARGETS,package,avahi))