summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChema Alonso Josa <nimiux@gentoo.org>2016-08-04 00:03:18 +0200
committerChema Alonso Josa <nimiux@gentoo.org>2016-08-04 00:03:18 +0200
commit563975acb08ae298814c7db17c110ec02e8f66a9 (patch)
tree6de6f4065ee34085f7d571891fa4c7ce0cc0ba32 /app-admin/logrotate
parentdev-java/netbeans-websvccommon: license should be GPL-2-with-classpath-except... (diff)
downloadgentoo-563975acb08ae298814c7db17c110ec02e8f66a9.tar.gz
gentoo-563975acb08ae298814c7db17c110ec02e8f66a9.tar.bz2
gentoo-563975acb08ae298814c7db17c110ec02e8f66a9.zip
app-admin/logrotate: Bump to version 3.10.0
Package-Manager: portage-2.2.28
Diffstat (limited to 'app-admin/logrotate')
-rw-r--r--app-admin/logrotate/Manifest1
-rw-r--r--app-admin/logrotate/files/logrotate-3.10.0-Werror.patch9
-rw-r--r--app-admin/logrotate/files/logrotate-3.10.0-atomic-create.patch43
-rw-r--r--app-admin/logrotate/files/logrotate-3.10.0-fbsd.patch57
-rw-r--r--app-admin/logrotate/files/logrotate-3.10.0-ignore-hidden.patch14
-rw-r--r--app-admin/logrotate/files/logrotate-3.10.0-lfs.patch11
-rw-r--r--app-admin/logrotate/files/logrotate-3.10.0-noasprintf.patch55
-rw-r--r--app-admin/logrotate/logrotate-3.10.0.ebuild90
8 files changed, 280 insertions, 0 deletions
diff --git a/app-admin/logrotate/Manifest b/app-admin/logrotate/Manifest
index e2370a228614..e8d5a2e2a252 100644
--- a/app-admin/logrotate/Manifest
+++ b/app-admin/logrotate/Manifest
@@ -1,2 +1,3 @@
+DIST logrotate-3.10.0.tar.gz 162640 SHA256 dbc76cae5d4912455b5221654bb6114e43d91a3a0879ce3e20a62a157532912e SHA512 ec0328fbf4410c7a2f1386ebb7bd266d2fd7702eb1e3859e7cfb98fd0fcf313140bd1ad46aff1672a6613c0c524b2f98f1e6b9836858961c6e1ecdcd0988b6cd WHIRLPOOL bccf0d434b09f4777e8aca7150cecf81582d85017fc9688f5a652d7373c158a885be6a1d452dc360b3d053065f3522e498a5ea1aa9be36835dec8764215b9996
DIST logrotate-3.9.1.tar.gz 79061 SHA256 022769e3288c80981559a8421703c88e8438b447235e36dd3c8e97cd94c52545 SHA512 e6da7c7f067befaf2441e9c6ce77e53cf5ddb4f56cc3304c3e50873b6f20c68520f4a0e50ec466cbebcbed20bfd77bf6dfc489975a8131e9573fb19856c0fe28 WHIRLPOOL 9b3558bb03c6c95f8f386ea75ca09bfda802ae4c45b9ef8408692e3aa7a2ee57447cf15ce04d0289946b9cae2266acb5509d8151d15ac6ea0ad9113aeb32dc17
DIST logrotate-3.9.2.tar.gz 80711 SHA256 2de00c65e23fa9d7909cae6594e550b9abe9a7eb1553669ddeaca92d30f97009 SHA512 62c84a98ec3373562a5c0ab0abd68e33620787cbbafbcf442cb5c7bdc1a41a7f673ee5dabc5f905ad4dd3fffebcbee0dab2ea8698f20de04cc13950212aaab33 WHIRLPOOL b77338f2cc88e6bd03310cea40c26cd4d890238455b4d9507f64a3f8de1006bf98e0d3b783f6536da963f3d695ab604ab3f9bb0e6aa1ae9575005a665b497ec1
diff --git a/app-admin/logrotate/files/logrotate-3.10.0-Werror.patch b/app-admin/logrotate/files/logrotate-3.10.0-Werror.patch
new file mode 100644
index 000000000000..86b45a4f1061
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.10.0-Werror.patch
@@ -0,0 +1,9 @@
+diff -Nuar a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2016-08-03 12:25:47.000000000 +0200
++++ b/Makefile.am 2016-08-03 23:28:16.420071763 +0200
+@@ -1,4 +1,4 @@
+-AM_CFLAGS = -Wall -Werror
++AM_CFLAGS = -Wall
+ sbin_PROGRAMS = logrotate
+ logrotate_SOURCES = basenames.c config.c log.c logrotate.c \
+ basenames.h config.h log.h logrotate.h queue.h
diff --git a/app-admin/logrotate/files/logrotate-3.10.0-atomic-create.patch b/app-admin/logrotate/files/logrotate-3.10.0-atomic-create.patch
new file mode 100644
index 000000000000..46c36b8deeb5
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.10.0-atomic-create.patch
@@ -0,0 +1,43 @@
+diff -Nuar a/logrotate.c b/logrotate.c
+--- a/logrotate.c 2016-08-03 23:20:52.900062834 +0200
++++ b/logrotate.c 2016-08-03 23:25:18.080068173 +0200
+@@ -368,15 +368,18 @@
+ int createOutputFile(char *fileName, int flags, struct stat *sb, acl_type acl, int force_mode)
+ {
+ int fd;
+- struct stat sb_create;
+- int acl_set = 0;
+-
+- fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
+- (S_IRUSR | S_IWUSR) & sb->st_mode);
++ int acl_set = 0;
++ struct stat sb_create;
++ char template[PATH_MAX + 1];
++ mode_t umask_value;
++ snprintf(template, PATH_MAX, "%s/logrotate_temp.XXXXXX", ourDirName(fileName));
++ umask_value = umask(0000);
++ fd = mkostemp(template, (flags | O_EXCL | O_NOFOLLOW));
++ 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)) {
+@@ -427,6 +430,13 @@
+ }
+ }
+
++ 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/files/logrotate-3.10.0-fbsd.patch b/app-admin/logrotate/files/logrotate-3.10.0-fbsd.patch
new file mode 100644
index 000000000000..4952ab8125fe
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.10.0-fbsd.patch
@@ -0,0 +1,57 @@
+diff -Nuar a/config.c b/config.c
+--- a/config.c 2016-08-03 23:19:33.730061240 +0200
++++ b/config.c 2016-08-03 23:20:31.200062397 +0200
+@@ -1,6 +1,6 @@
+ #include "queue.h"
+ /* Alloca is defined in stdlib.h in NetBSD */
+-#ifndef __NetBSD__
++#if !defined(__NetBSD__) && !defined(__FreeBSD__)
+ #include <alloca.h>
+ #endif
+ #include <limits.h>
+@@ -24,6 +24,10 @@
+ #include <fnmatch.h>
+ #include <sys/mman.h>
+
++#if !defined(PATH_MAX) && defined(__FreeBSD__)
++#include <sys/param.h>
++#endif
++
+ #include "basenames.h"
+ #include "log.h"
+ #include "logrotate.h"
+diff -Nuar a/logrotate.c b/logrotate.c
+--- a/logrotate.c 2016-08-03 12:25:47.000000000 +0200
++++ b/logrotate.c 2016-08-03 23:20:52.900062834 +0200
+@@ -1,6 +1,6 @@
+ #include "queue.h"
+ /* alloca() is defined in stdlib.h in NetBSD */
+-#ifndef __NetBSD__
++#if !defined(__NetBSD__) && !defined(__FreeBSD__)
+ #include <alloca.h>
+ #endif
+ #include <limits.h>
+@@ -26,6 +27,10 @@
+ #include <limits.h>
+ #endif
+
++#if !defined(PATH_MAX) && defined(__FreeBSD__)
++#include <sys/param.h>
++#endif
++
+ #include "basenames.h"
+ #include "log.h"
+ #include "logrotate.h"
+diff -Nuar a/Makefile.legacy b/Makefile.legacy
+--- a/Makefile.legacy 2016-08-03 12:25:47.000000000 +0200
++++ b/Makefile.legacy 2016-08-03 23:21:07.370063125 +0200
+@@ -22,7 +22,9 @@
+
+ ifeq ($(WITH_ACL),yes)
+ CFLAGS += -DWITH_ACL
++ifneq ($(OS_NAME),FreeBSD)
+ LOADLIBES += -lacl
++endif
+ # See pretest
+ TEST_ACL=1
+ else
diff --git a/app-admin/logrotate/files/logrotate-3.10.0-ignore-hidden.patch b/app-admin/logrotate/files/logrotate-3.10.0-ignore-hidden.patch
new file mode 100644
index 000000000000..3496a6d65a34
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.10.0-ignore-hidden.patch
@@ -0,0 +1,14 @@
+diff -Nuar a/config.c b/config.c
+--- a/config.c 2016-08-03 12:25:47.000000000 +0200
++++ b/config.c 2016-08-03 23:19:33.730061240 +0200
+@@ -359,7 +359,9 @@
+ char *pattern;
+
+ /* Check if fname is '.' or '..'; if so, return false */
+- if (fname[0] == '.' && (!fname[1] || (fname[1] == '.' && !fname[2])))
++ /* 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 */
diff --git a/app-admin/logrotate/files/logrotate-3.10.0-lfs.patch b/app-admin/logrotate/files/logrotate-3.10.0-lfs.patch
new file mode 100644
index 000000000000..9c7b3606b2c8
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.10.0-lfs.patch
@@ -0,0 +1,11 @@
+diff -Nuar a/configure.ac b/configure.ac
+--- a/configure.ac 2016-08-03 12:25:47.000000000 +0200
++++ b/configure.ac 2016-08-03 23:29:44.540073537 +0200
+@@ -9,6 +9,7 @@
+ AC_PROG_CC_STDC
+ AC_STRUCT_ST_BLKSIZE
+ AC_STRUCT_ST_BLOCKS
++AC_SYS_LARGEFILE
+
+ AC_CHECK_LIB([popt],[poptParseArgvString],,
+ AC_MSG_ERROR([libpopt required but not found]))
diff --git a/app-admin/logrotate/files/logrotate-3.10.0-noasprintf.patch b/app-admin/logrotate/files/logrotate-3.10.0-noasprintf.patch
new file mode 100644
index 000000000000..608a1095a572
--- /dev/null
+++ b/app-admin/logrotate/files/logrotate-3.10.0-noasprintf.patch
@@ -0,0 +1,55 @@
+diff -Nuar a/config.c b/config.c
+--- a/config.c 2016-08-03 23:20:31.200062397 +0200
++++ b/config.c 2016-08-03 23:22:52.830065248 +0200
+@@ -49,39 +49,6 @@
+ #include "asprintf.c"
+ #endif
+
+-#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
+-#include <stdarg.h>
+-
+-int asprintf(char **string_ptr, const char *format, ...)
+-{
+- va_list arg;
+- char *str;
+- int size;
+- int rv;
+-
+- va_start(arg, format);
+- size = vsnprintf(NULL, 0, format, arg);
+- size++;
+- va_start(arg, format);
+- str = malloc(size);
+- if (str == NULL) {
+- va_end(arg);
+- /*
+- * Strictly speaking, GNU asprintf doesn't do this,
+- * but the caller isn't checking the return value.
+- */
+- fprintf(stderr, "failed to allocate memory\\n");
+- exit(1);
+- }
+- rv = vsnprintf(str, size, format, arg);
+- va_end(arg);
+-
+- *string_ptr = str;
+- return (rv);
+-}
+-
+-#endif
+-
+ #if !defined(strndup)
+ char *strndup(const char *s, size_t n)
+ {
+diff -Nuar a/logrotate.h b/logrotate.h
+--- a/logrotate.h 2016-08-03 12:25:47.000000000 +0200
++++ b/logrotate.h 2016-08-03 23:23:15.220065699 +0200
+@@ -80,8 +80,5 @@
+ extern int debug;
+
+ int readAllConfigPaths(const char **paths);
+-#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
+-int asprintf(char **string_ptr, const char *format, ...);
+-#endif
+
+ #endif
diff --git a/app-admin/logrotate/logrotate-3.10.0.ebuild b/app-admin/logrotate/logrotate-3.10.0.ebuild
new file mode 100644
index 000000000000..6a7ff7416c20
--- /dev/null
+++ b/app-admin/logrotate/logrotate-3.10.0.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="Rotates, compresses, and mails system logs"
+HOMEPAGE="https://github.com/logrotate/logrotate"
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acl +cron selinux"
+
+CDEPEND="
+ >=dev-libs/popt-1.5
+ selinux? (
+ sys-libs/libselinux
+ )
+ acl? ( virtual/acl )"
+
+DEPEND="${CDEPEND}
+ >=sys-apps/sed-4"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-logrotate )
+ cron? ( virtual/cron )"
+
+install_cron_file() {
+ sed -i 's#/usr/sbin/logrotate#/usr/bin/logrotate#' "${S}"/examples/logrotate.cron
+ exeinto /etc/cron.daily
+ newexe "${S}"/examples/logrotate.cron "${PN}"
+}
+
+PATCHES=(
+ "${FILESDIR}"/"${P}"-ignore-hidden.patch \
+ "${FILESDIR}"/"${P}"-fbsd.patch \
+ "${FILESDIR}"/"${P}"-noasprintf.patch \
+ "${FILESDIR}"/"${P}"-atomic-create.patch \
+ "${FILESDIR}"/"${P}"-Werror.patch \
+ "${FILESDIR}"/"${P}"-lfs.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_with acl) $(use_with selinux)
+}
+
+src_compile() {
+ emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}"
+}
+
+src_test() {
+ emake test
+}
+
+src_install() {
+ insinto /usr
+ dobin logrotate
+ doman logrotate.8
+ dodoc CHANGES examples/logrotate*
+
+ insinto /etc
+ doins "${FILESDIR}"/logrotate.conf
+
+ use cron && install_cron_file
+
+ keepdir /etc/logrotate.d
+}
+
+pkg_postinst() {
+ elog "The ${PN} binary is now installed under /usr/bin. Please"
+ elog "update your links"
+ elog
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ 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."
+ fi
+}