summaryrefslogtreecommitdiff
path: root/package/logrotate/logrotate.mk
diff options
context:
space:
mode:
authorMartin Banky <martin.banky@gmail.com>2010-09-26 00:14:09 -0700
committerPeter Korsgaard <jacmet@sunsite.dk>2010-09-26 22:53:22 +0200
commitf09275968cac629ea964474b7184be2dad3f1a36 (patch)
tree7851f046e792989e8a6ca8eb300f0f54a4aefef3 /package/logrotate/logrotate.mk
parent231449e1d5615f7092b49fab65a88f898bc16de3 (diff)
logrotate: convert to gentargets and bump to 3.7.9
[Peter: pass LDFLAGS, remove manpages, get rid _BINARY vars only used once] Signed-off-by: Martin Banky <Martin.Banky@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/logrotate/logrotate.mk')
-rw-r--r--package/logrotate/logrotate.mk62
1 files changed, 28 insertions, 34 deletions
diff --git a/package/logrotate/logrotate.mk b/package/logrotate/logrotate.mk
index 337fd8eb1..0e41d6a72 100644
--- a/package/logrotate/logrotate.mk
+++ b/package/logrotate/logrotate.mk
@@ -1,42 +1,36 @@
-LOGROTATE_VERSION:=3.7.7
-LOGROTATE_SOURCE:=logrotate-$(LOGROTATE_VERSION).tar.gz
-LOGROTATE_SITE:=https://fedorahosted.org/releases/l/o/logrotate/
-LOGROTATE_DIR:=$(BUILD_DIR)/logrotate-$(LOGROTATE_VERSION)
-LOGROTATE_BINARY:=logrotate
-LOGROTATE_TARGET_BINARY:=usr/sbin/$(LOGROTATE_BINARY)
-
-$(DL_DIR)/$(LOGROTATE_SOURCE):
- $(call DOWNLOAD,$(LOGROTATE_SITE),$(LOGROTATE_SOURCE))
-
-$(LOGROTATE_DIR)/.source: $(DL_DIR)/$(LOGROTATE_SOURCE)
- $(ZCAT) $(DL_DIR)/$(LOGROTATE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(LOGROTATE_DIR) package/logrotate/ logrotate\*.patch
- touch $@
-
-$(LOGROTATE_DIR)/$(LOGROTATE_BINARY): $(LOGROTATE_DIR)/.source
- $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS)" -C $(LOGROTATE_DIR)
-
-$(TARGET_DIR)/$(LOGROTATE_TARGET_BINARY): $(LOGROTATE_DIR)/$(LOGROTATE_BINARY)
- $(MAKE) PREFIX=$(TARGET_DIR) -C $(LOGROTATE_DIR) install
+#############################################################
+#
+# logrotate
+#
+#############################################################
+LOGROTATE_VERSION = 3.7.9
+LOGROTATE_SOURCE = logrotate-$(LOGROTATE_VERSION).tar.gz
+LOGROTATE_SITE = https://fedorahosted.org/releases/l/o/logrotate/
+
+LOGROTATE_DEPENDENCIES = popt
+
+define LOGROTATE_BUILD_CMDS
+ $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS)" LDFLAGS="$(LDFLAGS)" -C $(@D)
+endef
+
+define LOGROTATE_INSTALL_TARGET_CMDS
+ $(MAKE) PREFIX=$(TARGET_DIR) -C $(@D) install
if [ ! -f $(TARGET_DIR)/etc/logrotate.conf ]; then \
$(INSTALL) -m 0644 package/logrotate/logrotate.conf $(TARGET_DIR)/etc/logrotate.conf; \
fi
$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/logrotate.d
+endef
-logrotate: popt $(TARGET_DIR)/$(LOGROTATE_TARGET_BINARY)
-
-logrotate-source: $(DL_DIR)/$(LOGROTATE_SOURCE)
-
-logrotate-clean:
- rm -f $(TARGET_DIR)/$(LOGROTATE_TARGET_BINARY)
+define LOGROTATE_UNINSTALL_TARGET_CMDS
+ rm -f $(TARGET_DIR)/usr/sbin/logrotate
rm -f $(TARGET_DIR)/etc/logrotate.conf
- -rmdir $(TARGET_DIR)/etc/logrotate.d
- -$(MAKE) -C $(LOGROTATE_DIR) clean
-
-logrotate-dirclean:
- rm -rf $(LOGROTATE_DIR)
+ rm -f $(TARGET_DIR)/usr/man/man5/logrotate.conf.5
+ rm -f $(TARGET_DIR)/usr/man/man8/logrotate.8
+ rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/etc/logrotate.d
+endef
-ifeq ($(BR2_PACKAGE_LOGROTATE),y)
-TARGETS+=logrotate
-endif
+define LOGROTATE_CLEAN_CMDS
+ -$(MAKE) -C $(@D) clean
+endef
+$(eval $(call GENTARGETS,package,logrotate))