diff options
| author | Brian Smyth | 2009-09-09 12:08:32 -0400 |
|---|---|---|
| committer | Max Howell | 2009-09-16 14:49:06 +0100 |
| commit | 4cce63175ad1c46c2e65a58002671f97027b4d38 (patch) | |
| tree | 901f9ed03c4413c58c97f1d888099c37b233d015 /Library/Formula/logrotate.rb | |
| parent | 2b22c47ee1e4c69a2feda191c5d33ff68e4d34b8 (diff) | |
| download | homebrew-4cce63175ad1c46c2e65a58002671f97027b4d38.tar.bz2 | |
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 <max@methylblue.com>
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.
Diffstat (limited to 'Library/Formula/logrotate.rb')
| -rw-r--r-- | Library/Formula/logrotate.rb | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/Library/Formula/logrotate.rb b/Library/Formula/logrotate.rb new file mode 100644 index 000000000..cbd93be2c --- /dev/null +++ b/Library/Formula/logrotate.rb @@ -0,0 +1,85 @@ +require 'brewkit' + +class Logrotate <Formula + @url='http://ftp.de.debian.org/debian/pool/main/l/logrotate/logrotate_3.7.8.orig.tar.gz' + @homepage='http://packages.debian.org/testing/admin/logrotate' + @md5='b3589bea6d8d5afc8a84134fddaae973' + + def deps + LibraryDep.new 'popt' + end + + def patches + # these patches emerge from the logrotate patch. Recursively nice! + debian_patches=['configparse.patch', + 'datehack.patch', + 'compressutime.patch', + 'man-startcount.patch', + 'dst.patch', + 'dateext-504079.patch', + 'rh-toolarge.patch', + 'rh-curdir2.patch', + 'copyloginfo-512152.patch', + 'sharedscripts-519432.patch', + 'chown-484762.patch', + 'create-388608.patch', + 'nofollow.patch', + 'security-388608.patch'].collect {|p| "debian/patches/#{p}"} + { + :p1 => [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 <stdlib.h> + #include <string.h> + #include <sys/stat.h> ++#include <sys/syslimits.h> + #include <time.h> + #include <unistd.h> + #include <assert.h> +diff --git a/logrotate.c b/logrotate.c +index 6427465..f0614a8 100644 +--- a/logrotate.c ++++ b/logrotate.c +@@ -10,6 +10,7 @@ + #include <string.h> + #include <sys/stat.h> + #include <sys/wait.h> ++#include <sys/syslimits.h> + #include <time.h> + #include <unistd.h> + #include <glob.h> +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 |
