Gentoo Archives: gentoo-commits

From: "José María Alonso" <nimiux@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/logrotate/files/, app-admin/logrotate/
Date: Fri, 02 Dec 2016 22:57:48
Message-Id: 1480719458.3c29e6efb3b7d074d21985f0c4e7b4ce3a08461f.nimiux@gentoo
1 commit: 3c29e6efb3b7d074d21985f0c4e7b4ce3a08461f
2 Author: Chema Alonso Josa <nimiux <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 2 22:57:09 2016 +0000
4 Commit: José María Alonso <nimiux <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 2 22:57:38 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c29e6ef
7
8 app-admin/logrotate: Bumps version to 3.11.0
9
10 Package-Manager: portage-2.3.0
11
12 app-admin/logrotate/Manifest | 1 +
13 .../logrotate/files/logrotate-3.11.0-Werror.patch | 12 +++
14 .../logrotate/files/logrotate-3.11.0-fbsd.patch | 57 ++++++++++++++
15 .../files/logrotate-3.11.0-ignore-hidden.patch | 14 ++++
16 .../logrotate/files/logrotate-3.11.0-lfs.patch | 11 +++
17 .../files/logrotate-3.11.0-noasprintf.patch | 55 +++++++++++++
18 app-admin/logrotate/logrotate-3.11.0.ebuild | 89 ++++++++++++++++++++++
19 7 files changed, 239 insertions(+)
20
21 diff --git a/app-admin/logrotate/Manifest b/app-admin/logrotate/Manifest
22 index e8d5a2e..3731e2d 100644
23 --- a/app-admin/logrotate/Manifest
24 +++ b/app-admin/logrotate/Manifest
25 @@ -1,3 +1,4 @@
26 DIST logrotate-3.10.0.tar.gz 162640 SHA256 dbc76cae5d4912455b5221654bb6114e43d91a3a0879ce3e20a62a157532912e SHA512 ec0328fbf4410c7a2f1386ebb7bd266d2fd7702eb1e3859e7cfb98fd0fcf313140bd1ad46aff1672a6613c0c524b2f98f1e6b9836858961c6e1ecdcd0988b6cd WHIRLPOOL bccf0d434b09f4777e8aca7150cecf81582d85017fc9688f5a652d7373c158a885be6a1d452dc360b3d053065f3522e498a5ea1aa9be36835dec8764215b9996
27 +DIST logrotate-3.11.0.tar.gz 176488 SHA256 7dcb440ed2f1937459e1e06f841c6af1e564b77b2df8009147b56c8649197910 SHA512 67ceb2e18c175a5935c81e7699af7a5e6625cef50a3f52e993d49d6c10d9c433f6c7354a8dd05cb35ab28e4393d1db198f2e46e5f6eafd3e6f040b6518438cc1 WHIRLPOOL 0a581aa5922386b84a7c40a9490364287f4e162f7180fd0e15bf191694294168b663947c7081e92755406fe4f0b3b8792b6f0c5f0e646afa5505a17995a86858
28 DIST logrotate-3.9.1.tar.gz 79061 SHA256 022769e3288c80981559a8421703c88e8438b447235e36dd3c8e97cd94c52545 SHA512 e6da7c7f067befaf2441e9c6ce77e53cf5ddb4f56cc3304c3e50873b6f20c68520f4a0e50ec466cbebcbed20bfd77bf6dfc489975a8131e9573fb19856c0fe28 WHIRLPOOL 9b3558bb03c6c95f8f386ea75ca09bfda802ae4c45b9ef8408692e3aa7a2ee57447cf15ce04d0289946b9cae2266acb5509d8151d15ac6ea0ad9113aeb32dc17
29 DIST logrotate-3.9.2.tar.gz 80711 SHA256 2de00c65e23fa9d7909cae6594e550b9abe9a7eb1553669ddeaca92d30f97009 SHA512 62c84a98ec3373562a5c0ab0abd68e33620787cbbafbcf442cb5c7bdc1a41a7f673ee5dabc5f905ad4dd3fffebcbee0dab2ea8698f20de04cc13950212aaab33 WHIRLPOOL b77338f2cc88e6bd03310cea40c26cd4d890238455b4d9507f64a3f8de1006bf98e0d3b783f6536da963f3d695ab604ab3f9bb0e6aa1ae9575005a665b497ec1
30
31 diff --git a/app-admin/logrotate/files/logrotate-3.11.0-Werror.patch b/app-admin/logrotate/files/logrotate-3.11.0-Werror.patch
32 new file mode 100644
33 index 00000000..43c0eba
34 --- /dev/null
35 +++ b/app-admin/logrotate/files/logrotate-3.11.0-Werror.patch
36 @@ -0,0 +1,12 @@
37 +diff -Nuar a/Makefile.am b/Makefile.am
38 +--- a/Makefile.am 2016-11-30 13:05:55.000000000 +0100
39 ++++ b/Makefile.am 2016-12-02 23:46:15.288908073 +0100
40 +@@ -8,7 +8,7 @@
41 + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 + # GNU General Public License for more details.
43 + #
44 +-AM_CFLAGS = -Wall -Werror
45 ++AM_CFLAGS = -Wall
46 + sbin_PROGRAMS = logrotate
47 + logrotate_SOURCES = basenames.c config.c log.c logrotate.c \
48 + basenames.h config.h log.h logrotate.h queue.h
49
50 diff --git a/app-admin/logrotate/files/logrotate-3.11.0-fbsd.patch b/app-admin/logrotate/files/logrotate-3.11.0-fbsd.patch
51 new file mode 100644
52 index 00000000..f5aa652
53 --- /dev/null
54 +++ b/app-admin/logrotate/files/logrotate-3.11.0-fbsd.patch
55 @@ -0,0 +1,57 @@
56 +diff -Nuar a/config.c b/config.c
57 +--- a/config.c 2016-12-02 23:33:36.768905615 +0100
58 ++++ b/config.c 2016-12-02 23:36:15.568906130 +0100
59 +@@ -1,6 +1,6 @@
60 + #include "queue.h"
61 + /* Alloca is defined in stdlib.h in NetBSD */
62 +-#ifndef __NetBSD__
63 ++#if !defined(__NetBSD__) && !defined(__FreeBSD__)
64 + #include <alloca.h>
65 + #endif
66 + #include <limits.h>
67 +@@ -24,6 +24,10 @@
68 + #include <fnmatch.h>
69 + #include <sys/mman.h>
70 +
71 ++#if !defined(PATH_MAX) && defined(__FreeBSD__)
72 ++#include <sys/param.h>
73 ++#endif
74 ++
75 + #include "basenames.h"
76 + #include "log.h"
77 + #include "logrotate.h"
78 +diff -Nuar a/logrotate.c b/logrotate.c
79 +--- a/logrotate.c 2016-11-30 14:07:15.000000000 +0100
80 ++++ b/logrotate.c 2016-12-02 23:36:44.218906223 +0100
81 +@@ -1,6 +1,6 @@
82 + #include "queue.h"
83 + /* alloca() is defined in stdlib.h in NetBSD */
84 +-#ifndef __NetBSD__
85 ++#if !defined(__NetBSD__) && !defined(__FreeBSD__)
86 + #include <alloca.h>
87 + #endif
88 + #include <limits.h>
89 +@@ -26,6 +26,10 @@
90 + #include <limits.h>
91 + #endif
92 +
93 ++#if !defined(PATH_MAX) && defined(__FreeBSD__)
94 ++#include <sys/param.h>
95 ++#endif
96 ++
97 + #include "basenames.h"
98 + #include "log.h"
99 + #include "logrotate.h"
100 +diff -Nuar a/Makefile.legacy b/Makefile.legacy
101 +--- a/Makefile.legacy 2016-11-30 13:05:55.000000000 +0100
102 ++++ b/Makefile.legacy 2016-12-02 23:37:33.938906384 +0100
103 +@@ -22,7 +22,9 @@
104 +
105 + ifeq ($(WITH_ACL),yes)
106 + CFLAGS += -DWITH_ACL
107 ++ifneq ($(OS_NAME),FreeBSD)
108 + LOADLIBES += -lacl
109 ++endif
110 + # See pretest
111 + TEST_ACL=1
112 + else
113
114 diff --git a/app-admin/logrotate/files/logrotate-3.11.0-ignore-hidden.patch b/app-admin/logrotate/files/logrotate-3.11.0-ignore-hidden.patch
115 new file mode 100644
116 index 00000000..104f202
117 --- /dev/null
118 +++ b/app-admin/logrotate/files/logrotate-3.11.0-ignore-hidden.patch
119 @@ -0,0 +1,14 @@
120 +diff -Nuar a/config.c b/config.c
121 +--- a/config.c 2016-11-30 13:05:55.000000000 +0100
122 ++++ b/config.c 2016-12-02 23:33:36.768905615 +0100
123 +@@ -383,7 +383,9 @@
124 + int i;
125 +
126 + /* Check if fname is '.' or '..'; if so, return false */
127 +- if (fname[0] == '.' && (!fname[1] || (fname[1] == '.' && !fname[2])))
128 ++ /* Don't include 'hidden' files either; this breaks Gentoo
129 ++ portage config file management http://bugs.gentoo.org/87683 */
130 ++ if (fname[0] == '.')
131 + return 0;
132 +
133 + /* Check if fname is ending in a taboo-extension; if so, return false */
134
135 diff --git a/app-admin/logrotate/files/logrotate-3.11.0-lfs.patch b/app-admin/logrotate/files/logrotate-3.11.0-lfs.patch
136 new file mode 100644
137 index 00000000..9cd5745
138 --- /dev/null
139 +++ b/app-admin/logrotate/files/logrotate-3.11.0-lfs.patch
140 @@ -0,0 +1,11 @@
141 +diff -Nuar a/configure.ac b/configure.ac
142 +--- a/configure.ac 2016-12-02 14:08:40.000000000 +0100
143 ++++ b/configure.ac 2016-12-02 23:48:03.878908425 +0100
144 +@@ -12,6 +12,7 @@
145 + AC_PROG_CC_STDC
146 + AC_STRUCT_ST_BLKSIZE
147 + AC_STRUCT_ST_BLOCKS
148 ++AC_SYS_LARGEFILE
149 +
150 + dnl Use 64-bit file offsets on 32-bit systems (defines C macros if necessary)
151 + AC_SYS_LARGEFILE
152
153 diff --git a/app-admin/logrotate/files/logrotate-3.11.0-noasprintf.patch b/app-admin/logrotate/files/logrotate-3.11.0-noasprintf.patch
154 new file mode 100644
155 index 00000000..36733a2
156 --- /dev/null
157 +++ b/app-admin/logrotate/files/logrotate-3.11.0-noasprintf.patch
158 @@ -0,0 +1,55 @@
159 +diff -Nuar a/config.c b/config.c
160 +--- a/config.c 2016-12-02 23:36:15.568906130 +0100
161 ++++ b/config.c 2016-12-02 23:41:17.438907108 +0100
162 +@@ -49,39 +49,6 @@
163 + #include "asprintf.c"
164 + #endif
165 +
166 +-#if !defined(HAVE_ASPRINTF) && !defined(_FORTIFY_SOURCE)
167 +-#include <stdarg.h>
168 +-
169 +-int asprintf(char **string_ptr, const char *format, ...)
170 +-{
171 +- va_list arg;
172 +- char *str;
173 +- int size;
174 +- int rv;
175 +-
176 +- va_start(arg, format);
177 +- size = vsnprintf(NULL, 0, format, arg);
178 +- size++;
179 +- va_start(arg, format);
180 +- str = malloc(size);
181 +- if (str == NULL) {
182 +- va_end(arg);
183 +- /*
184 +- * Strictly speaking, GNU asprintf doesn't do this,
185 +- * but the caller isn't checking the return value.
186 +- */
187 +- fprintf(stderr, "failed to allocate memory\\n");
188 +- exit(1);
189 +- }
190 +- rv = vsnprintf(str, size, format, arg);
191 +- va_end(arg);
192 +-
193 +- *string_ptr = str;
194 +- return (rv);
195 +-}
196 +-
197 +-#endif
198 +-
199 + #if !defined(HAVE_STRNDUP)
200 + char *strndup(const char *s, size_t n)
201 + {
202 +diff -Nuar a/logrotate.h b/logrotate.h
203 +--- a/logrotate.h 2016-11-30 13:05:55.000000000 +0100
204 ++++ b/logrotate.h 2016-12-02 23:40:54.518907034 +0100
205 +@@ -82,8 +82,5 @@
206 + extern int debug;
207 +
208 + int readAllConfigPaths(const char **paths);
209 +-#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
210 +-int asprintf(char **string_ptr, const char *format, ...);
211 +-#endif
212 +
213 + #endif
214
215 diff --git a/app-admin/logrotate/logrotate-3.11.0.ebuild b/app-admin/logrotate/logrotate-3.11.0.ebuild
216 new file mode 100644
217 index 00000000..a3eef31
218 --- /dev/null
219 +++ b/app-admin/logrotate/logrotate-3.11.0.ebuild
220 @@ -0,0 +1,89 @@
221 +# Copyright 1999-2016 Gentoo Foundation
222 +# Distributed under the terms of the GNU General Public License v2
223 +# $Id$
224 +
225 +EAPI=6
226 +
227 +inherit autotools eutils toolchain-funcs flag-o-matic
228 +
229 +DESCRIPTION="Rotates, compresses, and mails system logs"
230 +HOMEPAGE="https://github.com/logrotate/logrotate"
231 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz -> ${P}.tar.gz"
232 +
233 +LICENSE="GPL-2"
234 +SLOT="0"
235 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
236 +IUSE="acl +cron selinux"
237 +
238 +CDEPEND="
239 + >=dev-libs/popt-1.5
240 + selinux? (
241 + sys-libs/libselinux
242 + )
243 + acl? ( virtual/acl )"
244 +
245 +DEPEND="${CDEPEND}
246 + >=sys-apps/sed-4"
247 +
248 +RDEPEND="${CDEPEND}
249 + selinux? ( sec-policy/selinux-logrotate )
250 + cron? ( virtual/cron )"
251 +
252 +install_cron_file() {
253 + sed -i 's#/usr/sbin/logrotate#/usr/bin/logrotate#' "${S}"/examples/logrotate.cron || die
254 + exeinto /etc/cron.daily
255 + newexe "${S}"/examples/logrotate.cron "${PN}"
256 +}
257 +
258 +PATCHES=(
259 + "${FILESDIR}/${P}-ignore-hidden.patch"
260 + "${FILESDIR}/${P}-fbsd.patch"
261 + "${FILESDIR}/${P}-noasprintf.patch"
262 + "${FILESDIR}/${P}-Werror.patch"
263 + "${FILESDIR}/${P}-lfs.patch"
264 +)
265 +
266 +src_prepare() {
267 + default
268 + eautoreconf
269 +}
270 +
271 +src_configure() {
272 + econf $(use_with acl) $(use_with selinux)
273 +}
274 +
275 +src_compile() {
276 + emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}"
277 +}
278 +
279 +src_test() {
280 + emake test
281 +}
282 +
283 +src_install() {
284 + insinto /usr
285 + dobin logrotate
286 + doman logrotate.8
287 + dodoc ChangeLog.md examples/logrotate*
288 +
289 + insinto /etc
290 + doins "${FILESDIR}"/logrotate.conf
291 +
292 + use cron && install_cron_file
293 +
294 + keepdir /etc/logrotate.d
295 +}
296 +
297 +pkg_postinst() {
298 + elog "The ${PN} binary is now installed under /usr/bin. Please"
299 + elog "update your links"
300 + elog
301 + if [[ -z ${REPLACING_VERSIONS} ]] ; then
302 + elog "If you wish to have logrotate e-mail you updates, please"
303 + elog "emerge virtual/mailx and configure logrotate in"
304 + elog "/etc/logrotate.conf appropriately"
305 + elog
306 + elog "Additionally, /etc/logrotate.conf may need to be modified"
307 + elog "for your particular needs. See man logrotate for details."
308 + fi
309 +}