summaryrefslogtreecommitdiff
path: root/sysutils/logrotate
diff options
context:
space:
mode:
authorsbd <sbd@pkgsrc.org>2012-03-06 04:53:24 +0000
committersbd <sbd@pkgsrc.org>2012-03-06 04:53:24 +0000
commit96a6435b1c0c79fab75b1db7648951acf787cc19 (patch)
tree18809fe18f5ca9be7d8641c92b6ee501166abcdf /sysutils/logrotate
parent301eab70fa269807d7413ef68e9d4c2be1287fcf (diff)
downloadpkgsrc-96a6435b1c0c79fab75b1db7648951acf787cc19.tar.gz
Add logrotate-3.8.1 as sysutils/logrotate
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.
Diffstat (limited to 'sysutils/logrotate')
-rw-r--r--sysutils/logrotate/DESCR6
-rw-r--r--sysutils/logrotate/MESSAGE13
-rw-r--r--sysutils/logrotate/Makefile56
-rw-r--r--sysutils/logrotate/PLIST10
-rw-r--r--sysutils/logrotate/distinfo11
-rw-r--r--sysutils/logrotate/patches/patch-config.c17
-rw-r--r--sysutils/logrotate/patches/patch-config.h22
-rw-r--r--sysutils/logrotate/patches/patch-examples_logrotate-default31
-rw-r--r--sysutils/logrotate/patches/patch-examples_logrotate.cron14
-rw-r--r--sysutils/logrotate/patches/patch-logrotate.828
-rw-r--r--sysutils/logrotate/patches/patch-logrotate.c17
11 files changed, 225 insertions, 0 deletions
diff --git a/sysutils/logrotate/DESCR b/sysutils/logrotate/DESCR
new file mode 100644
index 00000000000..b16a265f89d
--- /dev/null
+++ b/sysutils/logrotate/DESCR
@@ -0,0 +1,6 @@
+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.
diff --git a/sysutils/logrotate/MESSAGE b/sysutils/logrotate/MESSAGE
new file mode 100644
index 00000000000..9d2338e35a5
--- /dev/null
+++ b/sysutils/logrotate/MESSAGE
@@ -0,0 +1,13 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+To set up ${PKGNAME}:
+
+1/ modify ${PKG_SYSCONFDIR}/logrotate.conf to your needs,
+or better, add your own configuration files in
+${PKG_SYSCONFDIR}/logrotate.d/
+
+2/ set up a daily cron job for logrotate in ${ROOT_USER}'s crontab;
+this can be done with one of the following line:
+0 0 * * * /bin/sh ${EGDIR}/logrotate.cron
+0 0 * * * ${PREFIX}/bin/logrotate ${PKG_SYSCONFDIR}/logrotate.conf
+===========================================================================
diff --git a/sysutils/logrotate/Makefile b/sysutils/logrotate/Makefile
new file mode 100644
index 00000000000..d29dba8a853
--- /dev/null
+++ b/sysutils/logrotate/Makefile
@@ -0,0 +1,56 @@
+# $NetBSD: Makefile,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+#
+
+DISTNAME= logrotate-3.8.1
+CATEGORIES= sysutils
+MASTER_SITES= ${MASTER_SITE_GENTOO:=distfiles/}
+MASTER_SITES+= ${MASTER_SITE_FREEBSD:=distfiles/}
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= https://fedorahosted.org/logrotate/
+COMMENT= Daemon to rotate, compress, remove and mail system log files
+LICENSE= gnu-gpl-v2
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+USE_TOOLS+= gmake gzip:run gunzip:run mail:run
+NO_EXPORT_CPP= yes
+
+CFLAGS+= -DSTATEFILE=\"${VARBASE}/db/logrotate.status\"
+CFLAGS+= -DDEFAULT_MAIL_COMMAND=\"${MAIL_CMD}\"
+CFLAGS+= -DCOMPRESS_COMMAND=\"${GZIP_CMD:[1]}\"
+CFLAGS+= -DUNCOMPRESS_COMMAND=\"${GUNZIP_CMD:[1]}\"
+
+MAKE_ENV+= RPM_OPT_FLAGS=${CFLAGS:Q}
+
+BUILD_DEFS+= VARBASE
+EGDIR= ${PREFIX}/share/examples/logrotate
+CONF_FILES= ${EGDIR}/logrotate.conf ${PKG_SYSCONFDIR}/logrotate.conf
+OWN_DIRS= ${PKG_SYSCONFDIR}/logrotate.d
+MESSAGE_SUBST+= EGDIR=${EGDIR}
+
+AUTO_MKDIRS= yes
+
+SUBST_CLASSES+= paths
+SUBST_STAGE.paths= pre-build
+SUBST_MESSAGE.paths= Substituting paths variables.
+SUBST_FILES.paths= examples/logrotate-default
+SUBST_FILES.paths+= examples/logrotate.cron
+SUBST_FILES.paths+= logrotate.8
+SUBST_VARS.paths= PREFIX
+SUBST_VARS.paths+= VARBASE
+SUBST_VARS.paths+= PKG_SYSCONFDIR
+
+DOCDIR= share/doc/logrotate
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/logrotate ${DESTDIR}${PREFIX}/sbin
+ ${INSTALL_DATA} ${WRKSRC}/examples/logrotate-default ${DESTDIR}${EGDIR}/logrotate.conf
+ ${INSTALL_DATA} ${WRKSRC}/examples/logrotate.cron ${DESTDIR}/${EGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README.* ${DESTDIR}${PREFIX}/${DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/CHANGES ${DESTDIR}${PREFIX}/${DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/COPYING ${DESTDIR}${PREFIX}/${DOCDIR}
+ ${INSTALL_MAN} ${WRKSRC}/logrotate.conf.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5
+ ${INSTALL_MAN} ${WRKSRC}/logrotate.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
+
+.include "../../devel/popt/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/logrotate/PLIST b/sysutils/logrotate/PLIST
new file mode 100644
index 00000000000..e8385a6977b
--- /dev/null
+++ b/sysutils/logrotate/PLIST
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+man/man5/logrotate.conf.5
+man/man8/logrotate.8
+sbin/logrotate
+share/doc/logrotate/CHANGES
+share/doc/logrotate/COPYING
+share/doc/logrotate/README.HPUX
+share/doc/logrotate/README.Solaris
+share/examples/logrotate/logrotate.conf
+share/examples/logrotate/logrotate.cron
diff --git a/sysutils/logrotate/distinfo b/sysutils/logrotate/distinfo
new file mode 100644
index 00000000000..df0afee79fa
--- /dev/null
+++ b/sysutils/logrotate/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+
+SHA1 (logrotate-3.8.1.tar.gz) = 1df36cee76a9c4c7438f35ca3599a7bdd68a09b5
+RMD160 (logrotate-3.8.1.tar.gz) = cec3bc6a4cb4226b31696977935818695027b0f8
+Size (logrotate-3.8.1.tar.gz) = 48827 bytes
+SHA1 (patch-config.c) = 4f0f173a193c290578d427b96625f44ceb6ba5e4
+SHA1 (patch-config.h) = f0b52b984d0711e2250326805c2a3f7582807d48
+SHA1 (patch-examples_logrotate-default) = 01fedd4e0f62231c670dd0c023776136c006f2d8
+SHA1 (patch-examples_logrotate.cron) = 02981cb2b49e3f3f500fcb3db9b5dcb5fe62bddc
+SHA1 (patch-logrotate.8) = f37f746a3cccfd81e322ca5ef52c6fcb67d337d9
+SHA1 (patch-logrotate.c) = b5a3bb73329f30608edc5c73b00956492fc81637
diff --git a/sysutils/logrotate/patches/patch-config.c b/sysutils/logrotate/patches/patch-config.c
new file mode 100644
index 00000000000..1e2ae421248
--- /dev/null
+++ b/sysutils/logrotate/patches/patch-config.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-config.c,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+
+Compatibility patch for systems not using alloca.h .
+Patch commited upstream
+
+--- config.c.orig 2011-08-31 12:39:04.000000000 +0000
++++ config.c
+@@ -1,6 +1,9 @@
+ #include <sys/queue.h>
++#ifdef _ALLOCA_H
+ #include <alloca.h>
++#else
+ #include <limits.h>
++#endif
+ #include <ctype.h>
+ #include <dirent.h>
+ #include <errno.h>
diff --git a/sysutils/logrotate/patches/patch-config.h b/sysutils/logrotate/patches/patch-config.h
new file mode 100644
index 00000000000..3fd5c09e45a
--- /dev/null
+++ b/sysutils/logrotate/patches/patch-config.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-config.h,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+
+Values will be passed from pkgsrc.
+
+--- config.h.orig 2011-08-31 12:39:04.000000000 +0000
++++ config.h
+@@ -4,6 +4,7 @@
+
+ #define ROOT_UID 0
+
++/*
+ #ifdef __hpux
+ #define DEFAULT_MAIL_COMMAND "/usr/bin/mailx"
+ #define COMPRESS_COMMAND "/usr/contrib/bin/gzip"
+@@ -24,6 +25,7 @@
+ #define UNCOMPRESS_COMMAND "/usr/bin/gunzip"
+ #define STATEFILE "/var/log/logrotate.status"
+ #endif
++*/
+
+ /*
+ * Default settings for Linux - leave these last.
diff --git a/sysutils/logrotate/patches/patch-examples_logrotate-default b/sysutils/logrotate/patches/patch-examples_logrotate-default
new file mode 100644
index 00000000000..ed1a1d17e9c
--- /dev/null
+++ b/sysutils/logrotate/patches/patch-examples_logrotate-default
@@ -0,0 +1,31 @@
+$NetBSD: patch-examples_logrotate-default,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+
+Add pkgsrc paths compatibility.
+
+--- examples/logrotate-default.orig 2011-08-31 12:39:04.000000000 +0000
++++ examples/logrotate-default
+@@ -14,22 +14,7 @@ dateext
+ # uncomment this if you want your log files compressed
+ #compress
+
+-# RPM packages drop log rotation information into this directory
+-include /etc/logrotate.d
+-
+-# no packages own wtmp and btmp -- we'll rotate them here
+-/var/log/wtmp {
+- monthly
+- create 0664 root utmp
+- minsize 1M
+- rotate 1
+-}
+-
+-/var/log/btmp {
+- missingok
+- monthly
+- create 0600 root utmp
+- rotate 1
+-}
++# Packages drop log rotation information into this directory
++include @PKG_SYSCONFDIR@/etc/logrotate.d
+
+ # system-specific logs may be also be configured here.
diff --git a/sysutils/logrotate/patches/patch-examples_logrotate.cron b/sysutils/logrotate/patches/patch-examples_logrotate.cron
new file mode 100644
index 00000000000..490c6e0a5d8
--- /dev/null
+++ b/sysutils/logrotate/patches/patch-examples_logrotate.cron
@@ -0,0 +1,14 @@
+$NetBSD: patch-examples_logrotate.cron,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+
+Add pkgsrc paths compatibility
+
+--- examples/logrotate.cron.orig 2011-08-31 12:39:04.000000000 +0000
++++ examples/logrotate.cron
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+
+-/usr/sbin/logrotate /etc/logrotate.conf
++@PREFIX@/sbin/logrotate @PKG_SYSCONFDIR@/logrotate.conf
+ EXITVALUE=$?
+ if [ $EXITVALUE != 0 ]; then
+ /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
diff --git a/sysutils/logrotate/patches/patch-logrotate.8 b/sysutils/logrotate/patches/patch-logrotate.8
new file mode 100644
index 00000000000..a84e5158d0a
--- /dev/null
+++ b/sysutils/logrotate/patches/patch-logrotate.8
@@ -0,0 +1,28 @@
+$NetBSD: patch-logrotate.8,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+
+Add pkgsrc paths compatibility
+
+--- logrotate.8.orig 2011-08-31 12:39:04.000000000 +0000
++++ logrotate.8
+@@ -59,7 +59,7 @@ and mail it to the recipient. The defaul
+ \fB-s, -\-state <statefile>\fR
+ Tells \fBlogrotate\fR to use an alternate state file. This is useful
+ if logrotate is being run as a different user for various sets of
+-log files. The default state file is \fI/var/lib/logrotate.status\fR.
++log files. The default state file is \fI@VARBASE@/log/logrotate.status\fR.
+
+ .TP
+ \fB-\-usage\fR
+@@ -499,10 +499,10 @@ Log files are rotated if the current yea
+ .SH FILES
+ .PD 0
+ .TP 27
+-\fI/var/lib/logrotate.status\fR
++\fI@VARBASE@/log/logrotate.status\fR
+ Default state file.
+ .TP 27
+-\fI/etc/logrotate.conf\fR
++\fI@PKG_SYSCONFDIR@/logrotate.conf\fR
+ Configuration options.
+
+ .SH SEE ALSO
diff --git a/sysutils/logrotate/patches/patch-logrotate.c b/sysutils/logrotate/patches/patch-logrotate.c
new file mode 100644
index 00000000000..aab0a4103cb
--- /dev/null
+++ b/sysutils/logrotate/patches/patch-logrotate.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-logrotate.c,v 1.1.1.1 2012/03/06 04:53:24 sbd Exp $
+
+Compatibility patch for systems not using alloca.h .
+Patch commited upstream.
+
+--- logrotate.c.orig 2011-08-31 12:39:04.000000000 +0000
++++ logrotate.c
+@@ -1,6 +1,9 @@
+ #include <sys/queue.h>
++#ifdef _ALLOCA_H
+ #include <alloca.h>
++#else
+ #include <limits.h>
++#endif
+ #include <ctype.h>
+ #include <dirent.h>
+ #include <errno.h>