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

index e93738e35cc33df267c1f671e709c1e838e0b68f..141cf69ffcbcbe1b200452c2c245c7df2c068c18 100644 (file)
@@ -49,6 +49,29 @@ else
 DBUS_CONF_OPT += --without-x
 endif
 
+# fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
+define DBUS_REMOVE_VAR_LIB_DBUS
+       rm -rf $(TARGET_DIR)/var/lib/dbus
+endef
+
+DBUS_POST_BUILD_HOOKS += DBUS_REMOVE_VAR_LIB_DBUS
+
+define DBUS_REMOVE_DEVFILES
+       rm -rf $(TARGET_DIR)/usr/lib/dbus-1.0
+endef
+
+ifneq ($(BR2_HAVE_DEVFILES),y)
+DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_REMOVE_DEVFILES
+endif
+
+define DBUS_INSTALL_TARGET_FIXUP
+       rm -rf $(TARGET_DIR)/var/lib/dbus
+       ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
+       $(INSTALL) -m 0755 package/dbus/S30dbus $(TARGET_DIR)/etc/init.d
+endef
+
+DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_INSTALL_TARGET_FIXUP
+
 HOST_DBUS_DEPENDENCIES = host-pkg-config host-expat
 HOST_DBUS_CONF_OPT = \
                --with-dbus-user=dbus \
@@ -73,17 +96,3 @@ HOST_DBUS_POST_INSTALL_HOOKS += HOST_DBUS_GEN_INTROSPECT
 
 $(eval $(call AUTOTARGETS,package,dbus))
 $(eval $(call AUTOTARGETS,package,dbus,host))
-
-# fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
-$(DBUS_HOOK_POST_BUILD): $(DBUS_TARGET_BUILD)
-       rm -rf $(TARGET_DIR)/var/lib/dbus
-       touch $@
-
-$(DBUS_HOOK_POST_INSTALL): $(DBUS_TARGET_INSTALL_TARGET)
-ifneq ($(BR2_HAVE_DEVFILES),y)
-       rm -rf $(TARGET_DIR)/usr/lib/dbus-1.0
-endif
-       rm -rf $(TARGET_DIR)/var/lib/dbus
-       ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
-       $(INSTALL) -m 0755 package/dbus/S30dbus $(TARGET_DIR)/etc/init.d
-       touch $@