summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé María Alonso <nimiux@gentoo.org>2012-08-02 18:10:04 +0000
committerJosé María Alonso <nimiux@gentoo.org>2012-08-02 18:10:04 +0000
commit5c65f6488faf5b862803065551c017aac081431b (patch)
tree3b194d2d32a3726b5f61502dfe886418457506e3 /app-admin/logrotate
parentKeyword amd64-linux and x86-linux (diff)
downloadgentoo-2-5c65f6488faf5b862803065551c017aac081431b.tar.gz
gentoo-2-5c65f6488faf5b862803065551c017aac081431b.tar.bz2
gentoo-2-5c65f6488faf5b862803065551c017aac081431b.zip
[app-admin/logrotate] Version bump.
(Portage version: 2.1.10.65/cvs/Linux i686)
Diffstat (limited to 'app-admin/logrotate')
-rw-r--r--app-admin/logrotate/ChangeLog8
-rw-r--r--app-admin/logrotate/files/logrotate-3.8.2-atomic-create.patch40
-rw-r--r--app-admin/logrotate/logrotate-3.8.2.ebuild74
3 files changed, 121 insertions, 1 deletions
diff --git a/app-admin/logrotate/ChangeLog b/app-admin/logrotate/ChangeLog
index 6450e30083da..90fd3676bc65 100644
--- a/app-admin/logrotate/ChangeLog
+++ b/app-admin/logrotate/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-admin/logrotate
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/ChangeLog,v 1.117 2012/06/10 21:24:21 nimiux Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/ChangeLog,v 1.118 2012/08/02 18:10:04 nimiux Exp $
+
+*logrotate-3.8.2 (02 Aug 2012)
+
+ 02 Aug 2012; Chema Alonso <nimiux@gentoo.org> +logrotate-3.8.2.ebuild,
+ +files/logrotate-3.8.2-atomic-create.patch:
+ Version bump.
10 Jun 2012; Chema Alonso <nimiux@gentoo.org> metadata.xml:
Add myself as maintainer. Add description and use flags to metadata.
diff --git a/app-admin/logrotate/files/logrotate-3.8.2-atomic-create.patch b/app-admin/logrotate/files/logrotate-3.8.2-atomic-create.patch
new file mode 100644
index 000000000000..e0d3f5e26cf6
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.8.2-atomic-create.patch
@@ -0,0 +1,40 @@
+diff -Nuar a/logrotate.c b/logrotate.c
+--- a/logrotate.c 2012-08-01 12:56:47.000000000 +0200
++++ b/logrotate.c 2012-08-02 18:01:20.960383277 +0200
+@@ -293,13 +293,19 @@
+ {
+ int fd;
+ struct stat sb_create;
++ char template[PATH_MAX + 1];
++ char *fname;
++ mode_t umask_value;
++ snprintf(template, PATH_MAX, "%s/logrotate_temp.XXXXXX", ourDirName(fileName));
+
+- fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
+- (S_IRUSR | S_IWUSR) & sb->st_mode);
++ umask_value = umask(0000);
++ fname = mktemp(template);
++ fd = open(fname, (flags | O_EXCL | O_NOFOLLOW), (S_IRUSR | S_IWUSR) & sb->st_mode);
++ umask(umask_value);
+
+ if (fd < 0) {
+- message(MESS_ERROR, "error creating output file %s: %s\n",
+- fileName, strerror(errno));
++ message(MESS_ERROR, "error creating unique temp file: %s\n",
++ strerror(errno));
+ return -1;
+ }
+ if (fchmod(fd, (S_IRUSR | S_IWUSR) & sb->st_mode)) {
+@@ -328,6 +334,12 @@
+ close(fd);
+ return -1;
+ }
++ if (rename(template, fileName)) {
++ message(MESS_ERROR, "error renaming temp file to %s: %s\n",
++ fileName, strerror(errno));
++ close(fd);
++ return -1;
++ }
+ return fd;
+ }
+
diff --git a/app-admin/logrotate/logrotate-3.8.2.ebuild b/app-admin/logrotate/logrotate-3.8.2.ebuild
new file mode 100644
index 000000000000..4f15d93fcadf
--- /dev/null
+++ b/app-admin/logrotate/logrotate-3.8.2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/logrotate-3.8.2.ebuild,v 1.1 2012/08/02 18:10:04 nimiux Exp $
+
+EAPI="2"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="Rotates, compresses, and mails system logs"
+HOMEPAGE="https://fedorahosted.org/logrotate/"
+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="acl selinux"
+
+RDEPEND="
+ >=dev-libs/popt-1.5
+ selinux? (
+ sys-libs/libselinux
+ sec-policy/selinux-logrotate
+ )
+ acl? ( virtual/acl )"
+
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4"
+
+src_prepare() {
+ strip-flags
+
+ epatch \
+ "${FILESDIR}"/${PN}-3.7.7-datehack.patch \
+ "${FILESDIR}"/${PN}-3.8.0-ignore-hidden.patch \
+ "${FILESDIR}"/${PN}-3.8.0-fbsd.patch \
+ "${FILESDIR}"/${PN}-3.8.1-noasprintf.patch \
+ "${FILESDIR}"/${PN}-3.8.2-atomic-create.patch
+}
+
+src_configure() {
+ return
+}
+
+src_compile() {
+ local myconf
+ myconf="CC=$(tc-getCC)"
+ use selinux && myconf="${myconf} WITH_SELINUX=yes"
+ use acl && myconf="${myconf} WITH_ACL=yes"
+ emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}" || die "emake failed"
+}
+
+src_install() {
+ insinto /usr
+ dosbin logrotate
+ doman logrotate.8
+ dodoc CHANGES 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."
+}