* Fix compilation with GCC, based on https://github.com/joyent/pkgsrc/pull/470. * Use proper Github support, use tagged releases. * Use upstream install target. * Cleanup and legibility.diff -r1.2 -r1.3 pkgsrc/sysutils/logrotate/MESSAGE
(fhajny)
@@ -1,13 +1,13 @@ | @@ -1,13 +1,13 @@ | |||
1 | =========================================================================== | 1 | =========================================================================== | |
2 | $NetBSD: MESSAGE,v 1.2 2013/01/10 18:16:29 wiz Exp $ | 2 | $NetBSD: MESSAGE,v 1.3 2017/03/06 12:59:53 fhajny Exp $ | |
3 | To set up ${PKGNAME}: | 3 | To set up ${PKGNAME}: | |
4 | 4 | |||
5 | 1/ modify ${PKG_SYSCONFDIR}/logrotate.conf to your needs, | 5 | 1/ modify ${PKG_SYSCONFDIR}/logrotate.conf to your needs, | |
6 | or better, add your own configuration files in | 6 | or better, add your own configuration files in | |
7 | ${PKG_SYSCONFDIR}/logrotate.d/ | 7 | ${PKG_SYSCONFDIR}/logrotate.d/ | |
8 | 8 | |||
9 | 2/ set up a daily cron job for logrotate in ${ROOT_USER}'s crontab; | 9 | 2/ set up a daily cron job for logrotate in ${ROOT_USER}'s crontab; | |
10 | this can be done with one of the following line: | 10 | this can be done with one of the following line: | |
11 | 0 0 * * * /bin/sh ${EGDIR}/logrotate.cron | 11 | 0 0 * * * /bin/sh ${PREFIX}/${EGDIR}/logrotate.cron | |
12 | 0 0 * * * ${PREFIX}/sbin/logrotate ${PKG_SYSCONFDIR}/logrotate.conf | 12 | 0 0 * * * ${PREFIX}/sbin/logrotate ${PKG_SYSCONFDIR}/logrotate.conf | |
13 | =========================================================================== | 13 | =========================================================================== |
@@ -1,61 +1,50 @@ | @@ -1,61 +1,50 @@ | |||
1 | # $NetBSD: Makefile,v 1.15 2017/01/26 20:12:32 nils Exp $ | 1 | # $NetBSD: Makefile,v 1.16 2017/03/06 12:59:53 fhajny Exp $ | |
2 | 2 | |||
3 | DISTNAME= ${GHCOMMIT} | 3 | DISTNAME= logrotate-3.11.0 | |
4 | PKGNAME= logrotate-3.11.0 | 4 | PKGREVISION= 1 | |
5 | CATEGORIES= sysutils | 5 | CATEGORIES= sysutils | |
6 | MASTER_SITES= ${MASTER_SITE_GITHUB:=logrotate/logrotate/archive/} | 6 | MASTER_SITES= ${MASTER_SITE_GITHUB:=logrotate/} | |
7 | 7 | |||
8 | MAINTAINER= nils@NetBSD.org | 8 | MAINTAINER= nils@NetBSD.org | |
9 | HOMEPAGE= https://github.com/logrotate/logrotate/ | 9 | HOMEPAGE= https://github.com/logrotate/logrotate/ | |
10 | COMMENT= Daemon to rotate, compress, remove and mail system log files | 10 | COMMENT= Daemon to rotate, compress, remove and mail system log files | |
11 | LICENSE= gnu-gpl-v2 | 11 | LICENSE= gnu-gpl-v2 | |
12 | 12 | |||
13 | GHCOMMIT= f16495b3e5f3e5f333956a384fdc9917fc8ec81a | 13 | GITHUB_RELEASE= ${PKGVERSION_NOREV} | |
14 | USE_TOOLS+= gmake gzip:run gunzip:run mail:run automake autoconf | 14 | ||
15 | USE_TOOLS+= gmake gzip:run gunzip:run mail:run | |||
15 | USE_LIBTOOL= yes | 16 | USE_LIBTOOL= yes | |
16 | GNU_CONFIGURE= yes | 17 | GNU_CONFIGURE= yes | |
17 | HAS_CONFIGURE= yes | |||
18 | NO_EXPORT_CPP= yes | 18 | NO_EXPORT_CPP= yes | |
19 | 19 | |||
20 | WRKSRC= ${WRKDIR}/logrotate-${GHCOMMIT} | |||
21 | CONFIGURE_ENV+= STATEFILE=\"${VARBASE}/db/logrotate.status\" | 20 | CONFIGURE_ENV+= STATEFILE=\"${VARBASE}/db/logrotate.status\" | |
22 | CONFIGURE_ENV+= DEFAULT_MAIL_COMMAND=\"${MAIL_CMD:Q}\" | 21 | CONFIGURE_ENV+= DEFAULT_MAIL_COMMAND=\"${MAIL_CMD:Q}\" | |
23 | CONFIGURE_ENV+= COMPRESS_COMMAND=\"${GZIP_CMD:[1]:Q}\" | 22 | CONFIGURE_ENV+= COMPRESS_COMMAND=\"${GZIP_CMD:[1]:Q}\" | |
24 | CONFIGURE_ENV+= UNCOMPRESS_COMMAND=\"${GUNZIP_CMD:[1]:Q}\" | 23 | CONFIGURE_ENV+= UNCOMPRESS_COMMAND=\"${GUNZIP_CMD:[1]:Q}\" | |
25 | CONFIGURE_ARGS+= --with-state-file-path="${VARBASE}/db/logrotate.status" | 24 | CONFIGURE_ARGS+= --with-state-file-path="${VARBASE}/db/logrotate.status" | |
26 | 25 | |||
27 | BUILD_DEFS+= VARBASE | 26 | BUILD_DEFS+= VARBASE | |
28 | EGDIR= ${PREFIX}/share/examples/logrotate | |||
29 | CONF_FILES= ${EGDIR}/logrotate.conf ${PKG_SYSCONFDIR}/logrotate.conf | |||
30 | OWN_DIRS= ${PKG_SYSCONFDIR}/logrotate.d | |||
31 | MESSAGE_SUBST+= EGDIR=${EGDIR} | |||
32 | INSTALLATION_DIRS+= ${EGDIR} ${PKG_SYSCONFDIR} ${OWN_DIRS} | |||
33 | AUTO_MKDIRS= yes | |||
34 | 27 | |||
28 | MESSAGE_SUBST+= EGDIR=${EGDIR} | |||
35 | SUBST_CLASSES+= paths | 29 | SUBST_CLASSES+= paths | |
36 | SUBST_STAGE.paths= pre-build | 30 | SUBST_STAGE.paths= pre-build | |
37 | SUBST_MESSAGE.paths= Substituting paths variables. | 31 | SUBST_MESSAGE.paths= Substituting paths variables. | |
38 | SUBST_FILES.paths= examples/logrotate-default | 32 | SUBST_FILES.paths= examples/logrotate-default | |
39 | SUBST_FILES.paths+= examples/logrotate.cron | 33 | SUBST_FILES.paths+= examples/logrotate.cron | |
40 | SUBST_VARS.paths= PREFIX | 34 | SUBST_VARS.paths= PREFIX PKG_SYSCONFDIR | |
41 | SUBST_VARS.paths+= VARBASE | 35 | ||
42 | SUBST_VARS.paths+= PKG_SYSCONFDIR | 36 | CONF_FILES= ${EGDIR}/logrotate.conf ${PKG_SYSCONFDIR}/logrotate.conf | |
43 | 37 | OWN_DIRS= ${PKG_SYSCONFDIR}/logrotate.d | ||
44 | DOCDIR= share/doc/logrotate | 38 | ||
45 | 39 | EGDIR= share/examples/logrotate | ||
46 | pre-configure: | 40 | ||
47 | cd ${WRKSRC} && \ | 41 | INSTALLATION_DIRS+= ${EGDIR} | |
48 | ${SETENV} ${CONFIGURE_ENV} ./autogen.sh | 42 | ||
49 | 43 | post-install: | ||
50 | do-install: | 44 | ${INSTALL_DATA} ${WRKSRC}/examples/logrotate-default \ | |
51 | ${INSTALL_PROGRAM} ${WRKSRC}/logrotate ${DESTDIR}${PREFIX}/sbin | 45 | ${DESTDIR}${PREFIX}/${EGDIR}/logrotate.conf | |
52 | ${INSTALL_DATA} ${WRKSRC}/examples/logrotate-default ${DESTDIR}${EGDIR}/logrotate.conf | 46 | ${INSTALL_DATA} ${WRKSRC}/examples/logrotate.cron \ | |
53 | ${INSTALL_DATA} ${WRKSRC}/examples/logrotate.cron ${DESTDIR}/${EGDIR} | 47 | ${DESTDIR}${PREFIX}/${EGDIR} | |
54 | ${INSTALL_DATA} ${WRKSRC}/README.* ${DESTDIR}${PREFIX}/${DOCDIR} | |||
55 | ${INSTALL_DATA} ${WRKSRC}/ChangeLog.md ${DESTDIR}${PREFIX}/${DOCDIR} | |||
56 | ${INSTALL_DATA} ${WRKSRC}/COPYING ${DESTDIR}${PREFIX}/${DOCDIR} | |||
57 | ${INSTALL_MAN} ${WRKSRC}/logrotate.conf.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5 | |||
58 | ${INSTALL_MAN} ${WRKSRC}/logrotate.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8 | |||
59 | 48 | |||
60 | .include "../../devel/popt/buildlink3.mk" | 49 | .include "../../devel/popt/buildlink3.mk" | |
61 | .include "../../mk/bsd.pkg.mk" | 50 | .include "../../mk/bsd.pkg.mk" |
@@ -1,12 +1,6 @@ | @@ -1,12 +1,6 @@ | |||
1 | @comment $NetBSD: PLIST,v 1.4 2017/01/26 20:12:32 nils Exp $ | 1 | @comment $NetBSD: PLIST,v 1.5 2017/03/06 12:59:53 fhajny Exp $ | |
2 | man/man5/logrotate.conf.5 | 2 | man/man5/logrotate.conf.5 | |
3 | man/man8/logrotate.8 | 3 | man/man8/logrotate.8 | |
4 | sbin/logrotate | 4 | sbin/logrotate | |
5 | share/doc/logrotate/COPYING | |||
6 | share/doc/logrotate/ChangeLog.md | |||
7 | share/doc/logrotate/README.HPUX | |||
8 | share/doc/logrotate/README.Solaris | |||
9 | share/doc/logrotate/README.md | |||
10 | share/examples/logrotate/logrotate.conf | 5 | share/examples/logrotate/logrotate.conf | |
11 | share/examples/logrotate/logrotate.cron | 6 | share/examples/logrotate/logrotate.cron | |
12 | @pkgdir etc/logrotate.d |
@@ -1,9 +1,10 @@ | @@ -1,9 +1,10 @@ | |||
1 | $NetBSD: distinfo,v 1.13 2017/01/26 20:12:32 nils Exp $ | 1 | $NetBSD: distinfo,v 1.14 2017/03/06 12:59:53 fhajny Exp $ | |
2 | 2 | |||
3 | SHA1 (f16495b3e5f3e5f333956a384fdc9917fc8ec81a.tar.gz) = 895fb10b66008c54fa49e7159bfbaed4eeb7f52c | 3 | SHA1 (logrotate-3.11.0.tar.gz) = 6891c1024320d211386cdd400668435db47e4c18 | |
4 | RMD160 (f16495b3e5f3e5f333956a384fdc9917fc8ec81a.tar.gz) = 70308f6d985b95c89d8ead8021c62265e870b21b | 4 | RMD160 (logrotate-3.11.0.tar.gz) = 6aec3505fde3b59a1ca95c0f9d66747884417bee | |
5 | SHA512 (f16495b3e5f3e5f333956a384fdc9917fc8ec81a.tar.gz) = f6a6c23a114e8e56cd0b432a2d41e5e85a568510cfa61482316b9bce63e88ecce5a388c5b485a118bbe14ff26f5b15ef8a9fa10dda34c6688c9c65a57d5cc797 | 5 | SHA512 (logrotate-3.11.0.tar.gz) = 67ceb2e18c175a5935c81e7699af7a5e6625cef50a3f52e993d49d6c10d9c433f6c7354a8dd05cb35ab28e4393d1db198f2e46e5f6eafd3e6f040b6518438cc1 | |
6 | Size (f16495b3e5f3e5f333956a384fdc9917fc8ec81a.tar.gz) = 84155 bytes | 6 | Size (logrotate-3.11.0.tar.gz) = 176488 bytes | |
7 | SHA1 (patch-config.c) = a6c775599857f01fa11bb99113795794f46664f5 | 7 | SHA1 (patch-config.c) = a6c775599857f01fa11bb99113795794f46664f5 | |
8 | SHA1 (patch-examples_logrotate-default) = 6d3f575cc6563dd8c00dad4b1baa4e9d5eadae3b | 8 | SHA1 (patch-examples_logrotate-default) = 16bb2350115e36aa3ed3f8ebf9625e3aadbb5950 | |
9 | SHA1 (patch-examples_logrotate.cron) = e7e7a3f0ff77b3ee5fbf69ee2acecac136b0be8f | 9 | SHA1 (patch-examples_logrotate.cron) = 31a19e1b697e945299bbbe6701674d886379a49c | |
10 | SHA1 (patch-logrotate.c) = ad13f4a4e1ae61e66fb937b92bbc41769deaf86a |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | $NetBSD: patch-examples_logrotate-default,v 1.4 2017/01/26 20:12:32 nils Exp $ | 1 | $NetBSD: patch-examples_logrotate-default,v 1.5 2017/03/06 12:59:53 fhajny Exp $ | |
2 | 2 | |||
3 | Add pkgsrc paths compatibility. | 3 | Add pkgsrc paths compatibility. | |
4 | 4 | |||
5 | --- examples/logrotate-default.orig 2016-12-02 13:12:33.000000000 +0000 | 5 | --- examples/logrotate-default.orig 2016-12-02 13:12:33.000000000 +0000 | |
6 | +++ examples/logrotate-default | 6 | +++ examples/logrotate-default | |
7 | @@ -14,22 +14,7 @@ dateext | 7 | @@ -14,22 +14,7 @@ dateext | |
8 | # uncomment this if you want your log files compressed | 8 | # uncomment this if you want your log files compressed | |
9 | #compress | 9 | #compress | |
10 | 10 | |||
11 | -# RPM packages drop log rotation information into this directory | 11 | -# RPM packages drop log rotation information into this directory | |
12 | -include /etc/logrotate.d | 12 | -include /etc/logrotate.d | |
13 | - | 13 | - | |
14 | -# no packages own wtmp and btmp -- we'll rotate them here | 14 | -# no packages own wtmp and btmp -- we'll rotate them here | |
@@ -16,16 +16,16 @@ Add pkgsrc paths compatibility. | @@ -16,16 +16,16 @@ Add pkgsrc paths compatibility. | |||
16 | - monthly | 16 | - monthly | |
17 | - create 0664 root utmp | 17 | - create 0664 root utmp | |
18 | - minsize 1M | 18 | - minsize 1M | |
19 | - rotate 1 | 19 | - rotate 1 | |
20 | -} | 20 | -} | |
21 | - | 21 | - | |
22 | -/var/log/btmp { | 22 | -/var/log/btmp { | |
23 | - missingok | 23 | - missingok | |
24 | - monthly | 24 | - monthly | |
25 | - create 0600 root utmp | 25 | - create 0600 root utmp | |
26 | - rotate 1 | 26 | - rotate 1 | |
27 | -} | 27 | -} | |
28 | +# Packages drop log rotation information into this directory | 28 | +# Packages drop log rotation information into this directory | |
29 | +include /usr/pkg/etc/logrotate.d | 29 | +include @PKG_SYSCONFDIR@/logrotate.d | |
30 | 30 | |||
31 | # system-specific logs may be also be configured here. | 31 | # system-specific logs may be also be configured here. |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | $NetBSD: patch-examples_logrotate.cron,v 1.2 2017/01/26 20:12:32 nils Exp $ | 1 | $NetBSD: patch-examples_logrotate.cron,v 1.3 2017/03/06 12:59:53 fhajny Exp $ | |
2 | 2 | |||
3 | Add pkgsrc paths compatibility | 3 | Add pkgsrc paths compatibility | |
4 | 4 | |||
5 | --- examples/logrotate.cron.orig 2016-12-02 13:12:33.000000000 +0000 | 5 | --- examples/logrotate.cron.orig 2016-12-02 13:12:33.000000000 +0000 | |
6 | +++ examples/logrotate.cron | 6 | +++ examples/logrotate.cron | |
7 | @@ -1,6 +1,6 @@ | 7 | @@ -1,6 +1,6 @@ | |
8 | #!/bin/sh | 8 | #!/bin/sh | |
9 | 9 | |||
10 | -/usr/sbin/logrotate /etc/logrotate.conf | 10 | -/usr/sbin/logrotate /etc/logrotate.conf | |
11 | +/usr/pkg/sbin/logrotate /usr/pkg/etc/logrotate.conf | 11 | +@PREFIX@/sbin/logrotate @PKG_SYSCONFDIR@/logrotate.conf | |
12 | EXITVALUE=$? | 12 | EXITVALUE=$? | |
13 | if [ $EXITVALUE != 0 ]; then | 13 | if [ $EXITVALUE != 0 ]; then | |
14 | /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" | 14 | /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" |
$NetBSD: patch-logrotate.c,v 1.3 2017/03/06 12:59:53 fhajny Exp $
Fixes GCC error:
"error: missing sentinel in function call [-Werror=format=]"
--- logrotate.c.orig 2016-11-30 13:07:15.000000000 +0000
+++ logrotate.c
@@ -440,7 +440,7 @@ static int runScript(struct logInfo *log
DOEXIT(1);
}
}
- execl("/bin/sh", "sh", "-c", script, "logrotate_script", logfn, NULL);
+ execl("/bin/sh", "sh", "-c", script, "logrotate_script", logfn, (char *)NULL);
DOEXIT(1);
}
@@ -800,7 +800,7 @@ static int mailLog(struct logInfo *log,
DOEXIT(1);
}
- execlp(uncompressCommand, uncompressCommand, NULL);
+ execlp(uncompressCommand, uncompressCommand, (char *)NULL);
DOEXIT(1);
}