logrotate:
authorWade Berrier <wberrier@gmail.com>
Mon, 6 Oct 2008 20:41:12 +0000 (20:41 -0000)
committerWade Berrier <wberrier@gmail.com>
Mon, 6 Oct 2008 20:41:12 +0000 (20:41 -0000)
-new package

package/Config.in
package/logrotate/Config.in [new file with mode: 0644]
package/logrotate/logrotate.conf [new file with mode: 0644]
package/logrotate/logrotate.mk [new file with mode: 0644]

index c845d929520e04c9b2db44144525a8e74194b022..bc5e62044548c3e8a5c8ec8a597ca763ad873530 100644 (file)
@@ -89,6 +89,7 @@ source "package/libiconv/Config.in"
 source "package/liblockfile/Config.in"
 source "package/libsysfs/Config.in"
 source "package/lockfile-progs/Config.in"
+source "package/logrotate/Config.in"
 source "package/lsof/Config.in"
 source "package/ltp-testsuite/Config.in"
 source "package/ltrace/Config.in"
diff --git a/package/logrotate/Config.in b/package/logrotate/Config.in
new file mode 100644 (file)
index 0000000..8e61a44
--- /dev/null
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_LOGROTATE
+       bool "logrotate"
+       select BR2_PACKAGE_POPT
+       depends on BR2_USE_WCHAR
+       help
+         A simple program to rotate logs.
+
+         https://fedorahosted.org/logrotate/
+
+comment "logrotate     - disabled (requires wchar support)"
+       depends on !BR2_USE_WCHAR
+
diff --git a/package/logrotate/logrotate.conf b/package/logrotate/logrotate.conf
new file mode 100644 (file)
index 0000000..6d829dc
--- /dev/null
@@ -0,0 +1,14 @@
+compress
+
+include /etc/logrotate.d
+
+/var/log/messages /var/log/auth.log /var/log/user.log {
+       rotate 7
+       daily
+       delaycompress
+       missingok
+       sharedscripts
+       postrotate
+               /usr/bin/killall -HUP syslogd
+       endscript
+}
diff --git a/package/logrotate/logrotate.mk b/package/logrotate/logrotate.mk
new file mode 100644 (file)
index 0000000..37097a8
--- /dev/null
@@ -0,0 +1,38 @@
+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):
+       $(WGET) -P $(DL_DIR) $(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/ *.patch   
+       touch $@
+
+$(LOGROTATE_DIR)/$(LOGROTATE_BINARY): $(LOGROTATE_DIR)/.source
+       $(MAKE) CC=$(TARGET_CC) -C $(LOGROTATE_DIR)
+
+$(TARGET_DIR)/$(LOGROTATE_TARGET_BINARY): $(LOGROTATE_DIR)/$(LOGROTATE_BINARY)
+       $(MAKE) PREFIX=$(TARGET_DIR) -C $(LOGROTATE_DIR) install
+       $(INSTALL) -m 0644 package/logrotate/logrotate.conf $(TARGET_DIR)/etc/logrotate.conf
+       $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/logrotate.d
+
+logrotate: uclibc busybox popt $(TARGET_DIR)/$(LOGROTATE_TARGET_BINARY)
+
+logrotate-source: $(DL_DIR)/$(LOGROTATE_SOURCE)
+
+logrotate-clean:
+       rm -f $(TARGET_DIR)/$(LOGROTATE_TARGET_BINARY)
+       -$(MAKE) -C $(LOGROTATE_DIR) clean
+
+logrotate-dirclean:
+       rm -Rf $(LOGROTATE_DIR)
+
+ifeq ($(strip $(BR2_PACKAGE_LOGROTATE)),y)
+TARGETS+=logrotate
+endif
+