Import logrotate-3.8.8nb20150211 as wip/logrotate-svn.

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.

This is the development version.
This commit is contained in:
Nils Ratusznik 2015-02-11 16:23:39 +00:00 committed by Thomas Klausner
parent b075586294
commit 96a34164ed
8 changed files with 161 additions and 0 deletions

6
logrotate-svn/DESCR Normal file
View file

@ -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.

13
logrotate-svn/MESSAGE Normal file
View file

@ -0,0 +1,13 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1 2015/02/11 16:23:39 ahp-nils 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}/sbin/logrotate ${PKG_SYSCONFDIR}/logrotate.conf
===========================================================================

56
logrotate-svn/Makefile Normal file
View file

@ -0,0 +1,56 @@
# $NetBSD: Makefile,v 1.1 2015/02/11 16:23:39 ahp-nils Exp $
DISTNAME= logrotate-3.8.8
CATEGORIES= sysutils
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
SVN_ROOT.logrotate= http://svn.fedorahosted.org/svn/logrotate/trunk
SVN_REPOSITORIES= logrotate
WRKSRC= ${WRKDIR}/logrotate
PKGREVISION= ${_SVN_PKGVERSION:S/.//g}
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:Q}\"
CFLAGS+= -DCOMPRESS_COMMAND=\"${GZIP_CMD:[1]:Q}\"
CFLAGS+= -DUNCOMPRESS_COMMAND=\"${GUNZIP_CMD:[1]:Q}\"
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}
INSTALLATION_DIRS+= ${EGDIR} ${PKG_SYSCONFDIR} ${OWN_DIRS}
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 "../../wip/mk/svn-package.mk"
.include "../../mk/bsd.pkg.mk"

10
logrotate-svn/PLIST Normal file
View file

@ -0,0 +1,10 @@
@comment $NetBSD: PLIST,v 1.1 2015/02/11 16:23:40 ahp-nils 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

5
logrotate-svn/distinfo Normal file
View file

@ -0,0 +1,5 @@
$NetBSD: distinfo,v 1.1 2015/02/11 16:23:40 ahp-nils Exp $
SHA1 (patch-examples_logrotate-default) = 6e6f1b7e9c7ea038e49f60bfb31ae39d03541eef
SHA1 (patch-examples_logrotate.cron) = d42a7a84c0ff43799a743598b3b31fac3acc3df1
SHA1 (patch-logrotate.8) = 68e125d67062777dd6262ae647689569fbae85f6

View file

@ -0,0 +1,29 @@
$NetBSD: patch-examples_logrotate-default,v 1.1 2015/02/11 16:23:40 ahp-nils Exp $
Add pkgsrc paths compatibility.
--- examples/logrotate-default.orig 2015-02-10 18:18:39.000000000 +0000
+++ examples/logrotate-default
@@ -15,21 +15,6 @@ dateext
#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
-}
+include @PKG_SYSCONFDIR@/logrotate.d
# system-specific logs may be also be configured here.

View file

@ -0,0 +1,14 @@
$NetBSD: patch-examples_logrotate.cron,v 1.1 2015/02/11 16:23:40 ahp-nils Exp $
Add pkgsrc paths compatibility
--- examples/logrotate.cron.orig 2015-02-10 18:18:39.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]"

View file

@ -0,0 +1,28 @@
$NetBSD: patch-logrotate.8,v 1.1 2015/02/11 16:23:40 ahp-nils Exp $
Add pkgsrc paths compatibility
--- logrotate.8.orig 2015-02-10 18:18:39.000000000 +0000
+++ logrotate.8
@@ -59,7 +59,7 @@ and mail it to the recipient. The defaul
\fB\-s\fR, \fB\-\-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@/db/logrotate.status\fR.
.TP
\fB\-\-usage\fR
@@ -550,10 +550,10 @@ Log files are rotated if the current yea
.SH FILES
.PD 0
.TP 27
-\fI/var/lib/logrotate.status\fR
+\fI@VARBASE@/db/logrotate.status\fR
Default state file.
.TP 27
-\fI/etc/logrotate.conf\fR
+\fI@PKG_SYSCONFDIR@/logrotate.conf\fR
Configuration options.
.SH SEE ALSO