diff options
Diffstat (limited to 'app-admin/logrotate')
22 files changed, 933 insertions, 0 deletions
diff --git a/app-admin/logrotate/Manifest b/app-admin/logrotate/Manifest new file mode 100644 index 00000000000..d4275529c9f --- /dev/null +++ b/app-admin/logrotate/Manifest @@ -0,0 +1,3 @@ +DIST logrotate-3.8.8.tar.gz 72014 SHA256 46a1510ef4a1f4359edd5f361112cfd1523942e85ff28e6cbb0c81bad1829d0f SHA512 2b7b5fe587b3a5cbe98b8035a541b5e272e6e4c40669f65ff6c43d1524b686eca9abc0b93bc00c8eb6da4d189f14a9b79905fcc0fadb914276d884ad7493bb4b WHIRLPOOL b145d51cdcf0214e4f4b6a97aed7b9e1375c2848efecbc16181eaa6e1105ac8892c57248c89b92eb080d6cd6b23958085f39a894df7f5dce0bea6516e2d583c4 +DIST logrotate-3.8.9.tar.gz 77408 SHA256 700ed7ce9072a1cca324779a74797dfaefdae37ac50a817134b947c4ded1dfa7 SHA512 342533f321a1d77c0ca389fd0a393377ba73f10654aae163cbd35f8d5df25673f1aa6e44d0af42be5419d152a7dae11024d9005076bce0a3b3dad1f0e12b9c0d WHIRLPOOL 005621b5dc7f6954e505876eece76e3adf03b9b89b724e5c28b845c8af3ebb8e978d20e3a82c8a503c32bfd8758517625207e23518d6d08068e237c22fe7212d +DIST logrotate-3.9.1.tar.gz 79061 SHA256 022769e3288c80981559a8421703c88e8438b447235e36dd3c8e97cd94c52545 SHA512 e6da7c7f067befaf2441e9c6ce77e53cf5ddb4f56cc3304c3e50873b6f20c68520f4a0e50ec466cbebcbed20bfd77bf6dfc489975a8131e9573fb19856c0fe28 WHIRLPOOL 9b3558bb03c6c95f8f386ea75ca09bfda802ae4c45b9ef8408692e3aa7a2ee57447cf15ce04d0289946b9cae2266acb5509d8151d15ac6ea0ad9113aeb32dc17 diff --git a/app-admin/logrotate/files/logrotate-3.8.8-Werror.patch b/app-admin/logrotate/files/logrotate-3.8.8-Werror.patch new file mode 100644 index 00000000000..db965296d9e --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.8-Werror.patch @@ -0,0 +1,11 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,7 +1,7 @@ + MAN = logrotate.8 + MAN5 = logrotate.conf.5 + +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + sbin_PROGRAMS = logrotate + logrotate_SOURCES = logrotate.c log.c config.c basenames.c + diff --git a/app-admin/logrotate/files/logrotate-3.8.8-atomic-create.patch b/app-admin/logrotate/files/logrotate-3.8.8-atomic-create.patch new file mode 100644 index 00000000000..28161253126 --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.8-atomic-create.patch @@ -0,0 +1,45 @@ +diff -Nuar a/logrotate.c b/logrotate.c +--- a/logrotate.c 2014-10-16 13:12:35.000000000 +0200 ++++ b/logrotate.c 2014-11-04 20:26:46.080067315 +0100 +@@ -359,15 +359,20 @@ + 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]; ++ char *fname; ++ mode_t umask_value; ++ snprintf(template, PATH_MAX, "%s/logrotate_temp.XXXXXX", ourDirName(fileName)); ++ 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)) { +@@ -418,6 +423,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.8.8-fbsd.patch b/app-admin/logrotate/files/logrotate-3.8.8-fbsd.patch new file mode 100644 index 00000000000..ff10211de83 --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.8-fbsd.patch @@ -0,0 +1,57 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2014-10-16 13:12:35.000000000 +0200 ++++ b/config.c 2014-11-04 19:22:31.750055957 +0100 +@@ -1,6 +1,6 @@ + #include <sys/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 2014-10-16 13:12:35.000000000 +0200 ++++ b/logrotate.c 2014-11-04 19:25:35.440056498 +0100 +@@ -1,6 +1,6 @@ + #include <sys/queue.h> + /* alloca() is defined in stdlib.h in NetBSD */ +-#ifndef __NetBSD__ ++#if !defined(__NetBSD__) && !defined(__FreeBSD__) + #include <alloca.h> + #endif + #include <limits.h> +@@ -25,6 +25,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 b/Makefile +--- a/Makefile 2014-10-16 13:12:35.000000000 +0200 ++++ b/Makefile 2014-11-04 19:26:07.850056594 +0100 +@@ -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.8.8-ignore-hidden.patch b/app-admin/logrotate/files/logrotate-3.8.8-ignore-hidden.patch new file mode 100644 index 00000000000..bdd0fbd9f55 --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.8-ignore-hidden.patch @@ -0,0 +1,14 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2014-10-16 13:12:35.000000000 +0200 ++++ b/config.c 2014-11-04 19:19:55.200055496 +0100 +@@ -255,7 +255,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.8.8-noasprintf.patch b/app-admin/logrotate/files/logrotate-3.8.8-noasprintf.patch new file mode 100644 index 00000000000..31ad70717bb --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.8-noasprintf.patch @@ -0,0 +1,55 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2014-10-16 13:12:35.000000000 +0200 ++++ b/config.c 2014-11-04 19:28:58.110057096 +0100 +@@ -45,39 +45,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 2014-10-16 13:12:35.000000000 +0200 ++++ b/logrotate.h 2014-11-04 19:29:15.610057147 +0100 +@@ -75,8 +75,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/files/logrotate-3.8.9-Werror.patch b/app-admin/logrotate/files/logrotate-3.8.9-Werror.patch new file mode 100644 index 00000000000..53570e1124a --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.9-Werror.patch @@ -0,0 +1,12 @@ +diff -Nuar a/Makefile.am b/Makefile.am +--- a/Makefile.am 2015-02-13 07:11:21.000000000 +0100 ++++ b/Makefile.am 2015-03-01 11:19:47.279999912 +0100 +@@ -1,7 +1,7 @@ + MAN = logrotate.8 + MAN5 = logrotate.conf.5 + +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + sbin_PROGRAMS = logrotate + logrotate_SOURCES = logrotate.c log.c config.c basenames.c + diff --git a/app-admin/logrotate/files/logrotate-3.8.9-atomic-create.patch b/app-admin/logrotate/files/logrotate-3.8.9-atomic-create.patch new file mode 100644 index 00000000000..dbb2063a476 --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.9-atomic-create.patch @@ -0,0 +1,43 @@ +diff -Nuar a/logrotate.c b/logrotate.c +--- a/logrotate.c 2015-03-01 11:50:36.569999862 +0100 ++++ b/logrotate.c 2015-03-01 11:56:26.329999853 +0100 +@@ -372,15 +372,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)) { +@@ -431,6 +434,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.8.9-fbsd.patch b/app-admin/logrotate/files/logrotate-3.8.9-fbsd.patch new file mode 100644 index 00000000000..4c6c8cf7e27 --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.9-fbsd.patch @@ -0,0 +1,57 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2015-03-01 11:25:37.489999902 +0100 ++++ b/config.c 2015-03-01 11:26:31.129999901 +0100 +@@ -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 2015-02-13 07:11:21.000000000 +0100 ++++ b/logrotate.c 2015-03-01 11:27:05.769999900 +0100 +@@ -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> +@@ -25,6 +25,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 b/Makefile +--- a/Makefile 2015-02-13 07:11:21.000000000 +0100 ++++ b/Makefile 2015-03-01 11:27:27.209999900 +0100 +@@ -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.8.9-ignore-hidden.patch b/app-admin/logrotate/files/logrotate-3.8.9-ignore-hidden.patch new file mode 100644 index 00000000000..d09266895cc --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.9-ignore-hidden.patch @@ -0,0 +1,14 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2015-02-13 07:11:21.000000000 +0100 ++++ b/config.c 2015-03-01 10:51:09.669999958 +0100 +@@ -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.8.9-noasprintf.patch b/app-admin/logrotate/files/logrotate-3.8.9-noasprintf.patch new file mode 100644 index 00000000000..aee570250f4 --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.8.9-noasprintf.patch @@ -0,0 +1,55 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2015-03-01 10:58:18.689999946 +0100 ++++ b/config.c 2015-03-01 11:04:20.899999937 +0100 +@@ -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 2015-02-13 07:11:21.000000000 +0100 ++++ b/logrotate.h 2015-03-01 11:04:55.739999936 +0100 +@@ -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/files/logrotate-3.9.1-Werror.patch b/app-admin/logrotate/files/logrotate-3.9.1-Werror.patch new file mode 100644 index 00000000000..b8cecc4ebfb --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.9.1-Werror.patch @@ -0,0 +1,12 @@ +diff -Nuar a/Makefile.am b/Makefile.am +--- a/Makefile.am 2015-04-03 09:39:35.000000000 +0200 ++++ b/Makefile.am 2015-06-28 14:03:12.429999875 +0200 +@@ -1,7 +1,7 @@ + MAN = logrotate.8 + MAN5 = logrotate.conf.5 + +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + sbin_PROGRAMS = logrotate + logrotate_SOURCES = logrotate.c log.c config.c basenames.c + diff --git a/app-admin/logrotate/files/logrotate-3.9.1-atomic-create.patch b/app-admin/logrotate/files/logrotate-3.9.1-atomic-create.patch new file mode 100644 index 00000000000..fdad8b6ea00 --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.9.1-atomic-create.patch @@ -0,0 +1,43 @@ +diff -Nuar a/logrotate.c b/logrotate.c +--- a/logrotate.c 2015-06-28 13:57:18.449999884 +0200 ++++ b/logrotate.c 2015-06-28 14:02:20.799999876 +0200 +@@ -371,15 +371,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)) { +@@ -430,6 +433,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.9.1-fbsd.patch b/app-admin/logrotate/files/logrotate-3.9.1-fbsd.patch new file mode 100644 index 00000000000..6e329d6149f --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.9.1-fbsd.patch @@ -0,0 +1,57 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2015-06-28 13:54:18.309999889 +0200 ++++ b/config.c 2015-06-28 13:56:49.599999885 +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 2015-04-03 09:39:35.000000000 +0200 ++++ b/logrotate.c 2015-06-28 13:57:18.449999884 +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 +26,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 b/Makefile +--- a/Makefile 2015-04-03 09:39:35.000000000 +0200 ++++ b/Makefile 2015-06-28 13:58:05.729999883 +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.9.1-ignore-hidden.patch b/app-admin/logrotate/files/logrotate-3.9.1-ignore-hidden.patch new file mode 100644 index 00000000000..31d9298779c --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.9.1-ignore-hidden.patch @@ -0,0 +1,15 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2015-04-03 09:39:35.000000000 +0200 ++++ b/config.c 2015-06-28 13:54:18.309999889 +0200 +@@ -359,7 +359,10 @@ + 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.9.1-noasprintf.patch b/app-admin/logrotate/files/logrotate-3.9.1-noasprintf.patch new file mode 100644 index 00000000000..7983943ca89 --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.9.1-noasprintf.patch @@ -0,0 +1,55 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2015-06-28 13:56:49.599999885 +0200 ++++ b/config.c 2015-06-28 13:59:34.799999880 +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 2015-04-03 09:39:35.000000000 +0200 ++++ b/logrotate.h 2015-06-28 13:59:47.429999880 +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/files/logrotate.conf b/app-admin/logrotate/files/logrotate.conf new file mode 100644 index 00000000000..b6292ec1c42 --- /dev/null +++ b/app-admin/logrotate/files/logrotate.conf @@ -0,0 +1,43 @@ +# $Id$ +# +# Default logrotate(8) configuration file for Gentoo Linux. +# See "man logrotate" for details. + +# rotate log files weekly. +weekly +#daily + +# keep 4 weeks worth of backlogs. +rotate 4 + +# create new (empty) log files after rotating old ones. +create + +# use date as a suffix of the rotated file. +dateext + +# compress rotated log files. +compress + +notifempty +nomail +noolddir + +# packages can 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 +} + +# system-specific logs may be also be configured here. diff --git a/app-admin/logrotate/logrotate-3.8.8.ebuild b/app-admin/logrotate/logrotate-3.8.8.ebuild new file mode 100644 index 00000000000..1085ce9e497 --- /dev/null +++ b/app-admin/logrotate/logrotate-3.8.8.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit autotools 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 arm64 hppa ia64 m68k ~mips ppc ~ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd" +IUSE="acl 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 ) +" + +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-ignore-hidden.patch \ + "${FILESDIR}"/${P}-fbsd.patch \ + "${FILESDIR}"/${P}-noasprintf.patch \ + "${FILESDIR}"/${P}-atomic-create.patch \ + "${FILESDIR}"/${P}-Werror.patch + eautoreconf +} + +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}" +} + +src_install() { + insinto /usr + dosbin logrotate + doman logrotate.8 + dodoc CHANGES examples/logrotate* + + exeinto /etc/cron.daily + newexe "${S}"/examples/logrotate.cron "${PN}" + + insinto /etc + doins "${FILESDIR}"/logrotate.conf + + keepdir /etc/logrotate.d +} + +pkg_postinst() { + 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 +} diff --git a/app-admin/logrotate/logrotate-3.8.9-r1.ebuild b/app-admin/logrotate/logrotate-3.8.9-r1.ebuild new file mode 100644 index 00000000000..8a3dd158d60 --- /dev/null +++ b/app-admin/logrotate/logrotate-3.8.9-r1.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit autotools 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 ~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() { + exeinto /etc/cron.daily + newexe "${S}"/examples/logrotate.cron "${PN}" +} + +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-ignore-hidden.patch \ + "${FILESDIR}"/${P}-fbsd.patch \ + "${FILESDIR}"/${P}-noasprintf.patch \ + "${FILESDIR}"/${P}-atomic-create.patch \ + "${FILESDIR}"/${P}-Werror.patch + 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 + dosbin 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() { + 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 +} diff --git a/app-admin/logrotate/logrotate-3.8.9.ebuild b/app-admin/logrotate/logrotate-3.8.9.ebuild new file mode 100644 index 00000000000..8b6a7e4d55b --- /dev/null +++ b/app-admin/logrotate/logrotate-3.8.9.ebuild @@ -0,0 +1,78 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit autotools 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 ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd" +IUSE="acl 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 ) + virtual/cron" + +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-ignore-hidden.patch \ + "${FILESDIR}"/${P}-fbsd.patch \ + "${FILESDIR}"/${P}-noasprintf.patch \ + "${FILESDIR}"/${P}-atomic-create.patch \ + "${FILESDIR}"/${P}-Werror.patch + eautoreconf +} + +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}" +} + +src_test() { + emake test +} + +src_install() { + insinto /usr + dosbin logrotate + doman logrotate.8 + dodoc CHANGES examples/logrotate* + + exeinto /etc/cron.daily + newexe "${S}"/examples/logrotate.cron "${PN}" + + insinto /etc + doins "${FILESDIR}"/logrotate.conf + + keepdir /etc/logrotate.d +} + +pkg_postinst() { + 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 +} diff --git a/app-admin/logrotate/logrotate-3.9.1.ebuild b/app-admin/logrotate/logrotate-3.9.1.ebuild new file mode 100644 index 00000000000..5450528e1c8 --- /dev/null +++ b/app-admin/logrotate/logrotate-3.9.1.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit autotools 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 ~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() { + exeinto /etc/cron.daily + newexe "${S}"/examples/logrotate.cron "${PN}" +} + +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-ignore-hidden.patch \ + "${FILESDIR}"/${P}-fbsd.patch \ + "${FILESDIR}"/${P}-noasprintf.patch \ + "${FILESDIR}"/${P}-atomic-create.patch \ + "${FILESDIR}"/${P}-Werror.patch + 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 + dosbin 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() { + 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 +} diff --git a/app-admin/logrotate/metadata.xml b/app-admin/logrotate/metadata.xml new file mode 100644 index 00000000000..f92e835578b --- /dev/null +++ b/app-admin/logrotate/metadata.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>nimiux@gentoo.org</email> + <name>Chema Alonso</name> + </maintainer> + <longdescription lang="en"> + 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. + </longdescription> + <longdescription lang="es"> + Logrotate permite la rotación, compresión, eliminación y + notificación por correo electrónico de forma automática de ficheros + de registro (logs). Logrotate se puede configurar para gestionar + estos ficheros diariamente, semanalmente, mensualmente o cuando + su tamaño alcanza cierto valor. + </longdescription> + <use> + <flag name="acl">Installs acl support</flag> + <flag name="cron">Installs cron file</flag> + <flag name="selinux">Installs Security Enhanced Linux support</flag> + </use> +</pkgmetadata> |