summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gryniewicz <dang@gentoo.org>2008-12-24 20:49:12 +0000
committerDaniel Gryniewicz <dang@gentoo.org>2008-12-24 20:49:12 +0000
commit778b1c69e12b9a6e034809e82da15933273ae65a (patch)
treee92ba9b6e96282df98da1d606b2457e1d5321e66 /app-admin/logrotate
parentAdded dev-python/python-docs:2.6 (diff)
downloadgentoo-2-778b1c69e12b9a6e034809e82da15933273ae65a.tar.gz
gentoo-2-778b1c69e12b9a6e034809e82da15933273ae65a.tar.bz2
gentoo-2-778b1c69e12b9a6e034809e82da15933273ae65a.zip
Bump to 3.7.7; now considering fedora as upstream
(Portage version: 2.2_rc17/cvs/Linux 2.6.27-gentoo-r6 x86_64)
Diffstat (limited to 'app-admin/logrotate')
-rw-r--r--app-admin/logrotate/ChangeLog11
-rw-r--r--app-admin/logrotate/files/logrotate-3.7.7-datehack.patch12
-rw-r--r--app-admin/logrotate/files/logrotate-3.7.7-ignore-hidden.patch15
-rw-r--r--app-admin/logrotate/files/logrotate-3.7.7-weekly.patch28
-rw-r--r--app-admin/logrotate/files/logrotate.conf12
-rw-r--r--app-admin/logrotate/logrotate-3.7.7.ebuild70
6 files changed, 146 insertions, 2 deletions
diff --git a/app-admin/logrotate/ChangeLog b/app-admin/logrotate/ChangeLog
index b48bec036ec1..eac94b72fe7f 100644
--- a/app-admin/logrotate/ChangeLog
+++ b/app-admin/logrotate/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for app-admin/logrotate
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/ChangeLog,v 1.72 2008/12/15 17:30:51 dang Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/ChangeLog,v 1.73 2008/12/24 20:49:12 dang Exp $
+
+*logrotate-3.7.7 (24 Dec 2008)
+
+ 24 Dec 2008; Daniel Gryniewicz <dang@gentoo.org>
+ +files/logrotate-3.7.7-datehack.patch,
+ +files/logrotate-3.7.7-ignore-hidden.patch,
+ +files/logrotate-3.7.7-weekly.patch, files/logrotate.conf,
+ +logrotate-3.7.7.ebuild:
+ Bump to 3.7.7; now considering fedora as upstream
15 Dec 2008; Daniel Gryniewicz <dang@gentoo.org> logrotate-3.7.2.ebuild:
Strip cflags; bug #250960
diff --git a/app-admin/logrotate/files/logrotate-3.7.7-datehack.patch b/app-admin/logrotate/files/logrotate-3.7.7-datehack.patch
new file mode 100644
index 000000000000..c023cba0b7a5
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.7.7-datehack.patch
@@ -0,0 +1,12 @@
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN logrotate-3.7.7.orig/logrotate.c logrotate-3.7.7/logrotate.c
+--- logrotate-3.7.7.orig/logrotate.c 2008-05-14 06:31:35.000000000 -0400
++++ logrotate-3.7.7/logrotate.c 2008-12-23 11:09:09.000000000 -0500
+@@ -1443,7 +1443,7 @@ static int readState(char *stateFilename
+ }
+
+ /* Hack to hide earlier bug */
+- if ((year != 1900) && (year < 1996 || year > 2100)) {
++ if ((year != 1900) && (year < 1970 || year > 2100)) {
+ message(MESS_ERROR,
+ "bad year %d for file %s in state file %s\n", year,
+ argv[0], stateFilename);
diff --git a/app-admin/logrotate/files/logrotate-3.7.7-ignore-hidden.patch b/app-admin/logrotate/files/logrotate-3.7.7-ignore-hidden.patch
new file mode 100644
index 000000000000..28581f142587
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.7.7-ignore-hidden.patch
@@ -0,0 +1,15 @@
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN logrotate-3.7.7.orig/config.c logrotate-3.7.7/config.c
+--- logrotate-3.7.7.orig/config.c 2008-05-09 03:28:59.000000000 -0400
++++ logrotate-3.7.7/config.c 2008-12-23 11:11:18.000000000 -0500
+@@ -164,6 +164,11 @@ static int checkFile(const char *fname)
+ if (fname[0] == '.' && (!fname[1] || (fname[1] == '.' && !fname[2])))
+ return 0;
+
++ /* Don't include 'hidden' files either; this breaks Gentoo
++ portage config file management http://bugs.gentoo.org/87683 */
++ if (fname[0] == '.')
++ return 0;
++
+ /* Check if fname is ending in a taboo-extension; if so, return false */
+ for (i = 0; i < tabooCount; i++) {
+ snprintf(pattern, sizeof(pattern), "*%s", tabooExts[i]);
diff --git a/app-admin/logrotate/files/logrotate-3.7.7-weekly.patch b/app-admin/logrotate/files/logrotate-3.7.7-weekly.patch
new file mode 100644
index 000000000000..cd817558aa56
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.7.7-weekly.patch
@@ -0,0 +1,28 @@
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN logrotate-3.7.7.orig/logrotate.c logrotate-3.7.7/logrotate.c
+--- logrotate-3.7.7.orig/logrotate.c 2008-05-14 06:31:35.000000000 -0400
++++ logrotate-3.7.7/logrotate.c 2008-12-23 11:14:55.000000000 -0500
+@@ -512,16 +512,17 @@ int findNeedRotating(struct logInfo *log
+ switch (log->criterium) {
+ case ROT_WEEKLY:
+ /* rotate if:
+- 1) the current weekday is before the weekday of the
+- last rotation
++ 1) the day of the week is the same as the day of the week of
++ the previous rotation but not the same day of the year
++ this will rotate it on the same day every week, but not
++ twice a day.
+ 2) more then a week has passed since the last
+ rotation */
+- state->doRotate = ((now.tm_wday < state->lastRotated.tm_wday)
+- ||
+- ((mktime(&now) -
+- mktime(&state->lastRotated)) >
++ state->doRotate = ((now.tm_wday == state->lastRotated.tm_wday &&
++ now.tm_yday != state->lastRotated.tm_yday) ||
++ ((mktime(&now) - mktime(&state->lastRotated)) >
+ (7 * 24 * 3600)));
+- break;
++ break;
+ case ROT_MONTHLY:
+ /* rotate if the logs haven't been rotated this month or
+ this year */
diff --git a/app-admin/logrotate/files/logrotate.conf b/app-admin/logrotate/files/logrotate.conf
index f8fb039fbb46..25dd13495e13 100644
--- a/app-admin/logrotate/files/logrotate.conf
+++ b/app-admin/logrotate/files/logrotate.conf
@@ -1,4 +1,4 @@
-# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v 1.2 2004/07/18 01:58:24 dragonheart Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v 1.3 2008/12/24 20:49:10 dang Exp $
#
# Logrotate default configuration file for Gentoo Linux
#
@@ -14,6 +14,9 @@ rotate 4
# create new (empty) log files after rotating old ones
create
+# use date as a suffix of the rotated file
+dateext
+
# uncomment this if you want your log files compressed
compress
@@ -31,4 +34,11 @@ noolddir
rotate 1
}
+/var/log/btmp {
+ missingok
+ monthly
+ create 0600 root utmp
+ rotate 1
+}
+
# system-specific logs may be also be configured here.
diff --git a/app-admin/logrotate/logrotate-3.7.7.ebuild b/app-admin/logrotate/logrotate-3.7.7.ebuild
new file mode 100644
index 000000000000..a7c0963d8cc0
--- /dev/null
+++ b/app-admin/logrotate/logrotate-3.7.7.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/logrotate-3.7.7.ebuild,v 1.1 2008/12/24 20:49:12 dang Exp $
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="Rotates, compresses, and mails system logs"
+HOMEPAGE="http://www.gentoo.org"
+SRC_URI="https://fedorahosted.org/releases/l/o/logrotate/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="selinux"
+
+RDEPEND="
+ >=dev-libs/popt-1.5
+ selinux? ( sys-libs/libselinux )"
+
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4
+ selinux? ( sec-policy/selinux-logrotate )"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+
+ cd ${S}
+
+ strip-flags
+
+ sed -i \
+ -e "s:CFLAGS += -g:CFLAGS += -g ${CFLAGS}:" \
+ -e "/CVSROOT =/d" \
+ Makefile || die "sed failed"
+
+ epatch ${FILESDIR}/${P}-datehack.patch
+ epatch ${FILESDIR}/${P}-ignore-hidden.patch
+ epatch ${FILESDIR}/${P}-weekly.patch
+}
+
+src_compile() {
+ local myconf
+ myconf="CC=$(tc-getCC)"
+ useq selinux && myconf="${myconf} WITH_SELINUX=yes"
+ emake ${myconf} || die "emake failed"
+}
+
+src_install() {
+ insinto /usr
+ dosbin logrotate
+ doman logrotate.8
+ dodoc examples/logrotate*
+
+ exeinto /etc/cron.daily
+ doexe ${FILESDIR}/logrotate.cron
+
+ insinto /etc
+ doins ${FILESDIR}/logrotate.conf
+
+ keepdir /etc/logrotate.d
+}
+
+pkg_postinst() {
+ elog "If you wish to have logrotate e-mail you updates, please"
+ elog "emerge virtual/mailx and configure logrotate in"
+ elog "/etc/logrotate.conf appropriately"
+ elog
+ elog "Additionally, /etc/logrotate.conf may need to be modified"
+ elog "for your particular needs. See man logrotate for details."
+}