From 14037f255d48c9664e2b61fc2f9f84a708f9aaef Mon Sep 17 00:00:00 2001 From: Brian Smyth Date: Wed, 9 Sep 2009 12:08:32 -0400 Subject: [PATCH] Logrotate formula The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. Logrotate allows for the automatic rotation compression, removal and mailing of log files. Logrotate can be set to handle a log file daily, weekly, monthly or when the log file gets to a certain size. Normally, logrotate runs as a daily cron job. The package is not buildable on Darwin without including an additional header, nor is it installable without teaching the Makefile what INSTALL is on Darwin. Signed-off-by: Max Howell I made a number of modifications, including comma separating the make call so that the prefix doesn't need to be escaped if it has spaces in it. Also setting LDFLAGS to /usr/local/lib is done in brewkit.rb already. The POPT_DIR var shouldn't be necessary either, but I haven't tested that yet. --- Formula/logrotate.rb | 85 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Formula/logrotate.rb diff --git a/Formula/logrotate.rb b/Formula/logrotate.rb new file mode 100644 index 0000000000..cbd93be2c9 --- /dev/null +++ b/Formula/logrotate.rb @@ -0,0 +1,85 @@ +require 'brewkit' + +class Logrotate [DATA, + "http://ftp.de.debian.org/debian/pool/main/l/logrotate/logrotate_3.7.8-4.diff.gz", + *debian_patches] + } + end + + def install + system "make" + system "make", "install", "BASEDIR=#{prefix}" + end +end + + +__END__ +diff --git a/config.c b/config.c +index 4e650f1..be7905a 100644 +--- a/config.c ++++ b/config.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/logrotate.c b/logrotate.c +index 6427465..f0614a8 100644 +--- a/logrotate.c ++++ b/logrotate.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/Makefile b/Makefile +index f110ab5..8e17dea 100644 +--- a/Makefile ++++ b/Makefile +@@ -45,6 +45,14 @@ ifeq ($(OS_NAME),SunOS) + endif + endif + ++# Darwin ++ifeq ($(OS_NAME),Darwin) ++ INSTALL = install ++ ifeq ($(BASEDIR),) ++ BASEDIR = /usr/local ++ endif ++endif ++ + # Red Hat Linux + ifeq ($(OS_NAME),Linux) + INSTALL = install