summaryrefslogtreecommitdiff
path: root/package/bind/bind.mk
diff options
context:
space:
mode:
Diffstat (limited to 'package/bind/bind.mk')
-rw-r--r--package/bind/bind.mk24
1 files changed, 14 insertions, 10 deletions
diff --git a/package/bind/bind.mk b/package/bind/bind.mk
index e57f26707..243408636 100644
--- a/package/bind/bind.mk
+++ b/package/bind/bind.mk
@@ -8,7 +8,6 @@ BIND_VERSION = 9.5.2-P2
BIND_SITE = ftp://ftp.isc.org/isc/bind9/$(BIND_VERSION)
BIND_LIBTOOL_PATCH = NO
BIND_INSTALL_STAGING = NO
-BIND_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
BIND_TARGET_SBINS = lwresd named named-checkconf named-checkzone
BIND_TARGET_SBINS += named-compilezone rndc rndc-confgen
BIND_TARGET_SBINS += dnssec-keygen dnssec-signzone
@@ -27,21 +26,26 @@ BIND_CONF_OPT = \
--disable-epoll \
--disable-threads
-$(eval $(call AUTOTARGETS,package,bind))
-
-$(BIND_HOOK_POST_INSTALL):
+define BIND_TARGET_INSTALL_FIXES
rm -f $(TARGET_DIR)/usr/bin/isc-config.sh
-ifneq ($(BR2_PACKAGE_BIND_TOOLS),y)
+ $(INSTALL) -m 0755 -D package/bind/bind.sysvinit $(TARGET_DIR)/etc/init.d/S81named
+endef
+
+BIND_POST_INSTALL_TARGET_HOOKS += BIND_TARGET_INSTALL_FIXES
+
+define BIND_TARGET_REMOVE_TOOLS
rm -rf $(addprefix $(TARGET_DIR)/usr/bin/, $(BIND_TARGET_BINS))
+endef
+
+ifneq ($(BR2_PACKAGE_BIND_TOOLS),y)
+BIND_POST_INSTALL_TARGET_HOOKS += BIND_TARGET_REMOVE_TOOLS
endif
- $(INSTALL) -m 0755 -D package/bind/bind.sysvinit $(TARGET_DIR)/etc/init.d/S81named
- touch $@
-$(BIND_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define BIND_UNINSTALL_TARGET_CMDS
rm -rf $(addprefix $(TARGET_DIR)/usr/sbin/, $(BIND_TARGET_SBINS))
rm -rf $(addprefix $(TARGET_DIR)/usr/bin/, $(BIND_TARGET_BINS))
rm -rf $(addprefix $(TARGET_DIR)/usr/lib/, $(BIND_TARGET_LIBS))
rm -f $(TARGET_DIR)/etc/init.d/S81named
- rm -f $(BIND_TARGET_INSTALL_TARGET) $(BIND_HOOK_POST_INSTALL)
+endef
+$(eval $(call AUTOTARGETS,package,bind))