1 |
commit: 563975acb08ae298814c7db17c110ec02e8f66a9 |
2 |
Author: Chema Alonso Josa <nimiux <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 3 22:03:18 2016 +0000 |
4 |
Commit: José María Alonso <nimiux <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 3 22:03:18 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=563975ac |
7 |
|
8 |
app-admin/logrotate: Bump to version 3.10.0 |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
11 |
|
12 |
app-admin/logrotate/Manifest | 1 + |
13 |
.../logrotate/files/logrotate-3.10.0-Werror.patch | 9 +++ |
14 |
.../files/logrotate-3.10.0-atomic-create.patch | 43 +++++++++++ |
15 |
.../logrotate/files/logrotate-3.10.0-fbsd.patch | 57 ++++++++++++++ |
16 |
.../files/logrotate-3.10.0-ignore-hidden.patch | 14 ++++ |
17 |
.../logrotate/files/logrotate-3.10.0-lfs.patch | 11 +++ |
18 |
.../files/logrotate-3.10.0-noasprintf.patch | 55 +++++++++++++ |
19 |
app-admin/logrotate/logrotate-3.10.0.ebuild | 90 ++++++++++++++++++++++ |
20 |
8 files changed, 280 insertions(+) |
21 |
|
22 |
diff --git a/app-admin/logrotate/Manifest b/app-admin/logrotate/Manifest |
23 |
index e2370a2..e8d5a2e 100644 |
24 |
--- a/app-admin/logrotate/Manifest |
25 |
+++ b/app-admin/logrotate/Manifest |
26 |
@@ -1,2 +1,3 @@ |
27 |
+DIST logrotate-3.10.0.tar.gz 162640 SHA256 dbc76cae5d4912455b5221654bb6114e43d91a3a0879ce3e20a62a157532912e SHA512 ec0328fbf4410c7a2f1386ebb7bd266d2fd7702eb1e3859e7cfb98fd0fcf313140bd1ad46aff1672a6613c0c524b2f98f1e6b9836858961c6e1ecdcd0988b6cd WHIRLPOOL bccf0d434b09f4777e8aca7150cecf81582d85017fc9688f5a652d7373c158a885be6a1d452dc360b3d053065f3522e498a5ea1aa9be36835dec8764215b9996 |
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.10.0-Werror.patch b/app-admin/logrotate/files/logrotate-3.10.0-Werror.patch |
32 |
new file mode 100644 |
33 |
index 0000000..86b45a4 |
34 |
--- /dev/null |
35 |
+++ b/app-admin/logrotate/files/logrotate-3.10.0-Werror.patch |
36 |
@@ -0,0 +1,9 @@ |
37 |
+diff -Nuar a/Makefile.am b/Makefile.am |
38 |
+--- a/Makefile.am 2016-08-03 12:25:47.000000000 +0200 |
39 |
++++ b/Makefile.am 2016-08-03 23:28:16.420071763 +0200 |
40 |
+@@ -1,4 +1,4 @@ |
41 |
+-AM_CFLAGS = -Wall -Werror |
42 |
++AM_CFLAGS = -Wall |
43 |
+ sbin_PROGRAMS = logrotate |
44 |
+ logrotate_SOURCES = basenames.c config.c log.c logrotate.c \ |
45 |
+ basenames.h config.h log.h logrotate.h queue.h |
46 |
|
47 |
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 |
48 |
new file mode 100644 |
49 |
index 0000000..46c36b8 |
50 |
--- /dev/null |
51 |
+++ b/app-admin/logrotate/files/logrotate-3.10.0-atomic-create.patch |
52 |
@@ -0,0 +1,43 @@ |
53 |
+diff -Nuar a/logrotate.c b/logrotate.c |
54 |
+--- a/logrotate.c 2016-08-03 23:20:52.900062834 +0200 |
55 |
++++ b/logrotate.c 2016-08-03 23:25:18.080068173 +0200 |
56 |
+@@ -368,15 +368,18 @@ |
57 |
+ int createOutputFile(char *fileName, int flags, struct stat *sb, acl_type acl, int force_mode) |
58 |
+ { |
59 |
+ int fd; |
60 |
+- struct stat sb_create; |
61 |
+- int acl_set = 0; |
62 |
+- |
63 |
+- fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW), |
64 |
+- (S_IRUSR | S_IWUSR) & sb->st_mode); |
65 |
++ int acl_set = 0; |
66 |
++ struct stat sb_create; |
67 |
++ char template[PATH_MAX + 1]; |
68 |
++ mode_t umask_value; |
69 |
++ snprintf(template, PATH_MAX, "%s/logrotate_temp.XXXXXX", ourDirName(fileName)); |
70 |
++ umask_value = umask(0000); |
71 |
++ fd = mkostemp(template, (flags | O_EXCL | O_NOFOLLOW)); |
72 |
++ umask(umask_value); |
73 |
+ |
74 |
+ if (fd < 0) { |
75 |
+- message(MESS_ERROR, "error creating output file %s: %s\n", |
76 |
+- fileName, strerror(errno)); |
77 |
++ message(MESS_ERROR, "error creating unique temp file: %s\n", |
78 |
++ strerror(errno)); |
79 |
+ return -1; |
80 |
+ } |
81 |
+ if (fchmod(fd, (S_IRUSR | S_IWUSR) & sb->st_mode)) { |
82 |
+@@ -427,6 +430,13 @@ |
83 |
+ } |
84 |
+ } |
85 |
+ |
86 |
++ if (rename(template, fileName)) { |
87 |
++ message(MESS_ERROR, "error renaming temp file to %s: %s\n", |
88 |
++ fileName, strerror(errno)); |
89 |
++ close(fd); |
90 |
++ return -1; |
91 |
++ } |
92 |
++ |
93 |
+ return fd; |
94 |
+ } |
95 |
+ |
96 |
|
97 |
diff --git a/app-admin/logrotate/files/logrotate-3.10.0-fbsd.patch b/app-admin/logrotate/files/logrotate-3.10.0-fbsd.patch |
98 |
new file mode 100644 |
99 |
index 0000000..4952ab8 |
100 |
--- /dev/null |
101 |
+++ b/app-admin/logrotate/files/logrotate-3.10.0-fbsd.patch |
102 |
@@ -0,0 +1,57 @@ |
103 |
+diff -Nuar a/config.c b/config.c |
104 |
+--- a/config.c 2016-08-03 23:19:33.730061240 +0200 |
105 |
++++ b/config.c 2016-08-03 23:20:31.200062397 +0200 |
106 |
+@@ -1,6 +1,6 @@ |
107 |
+ #include "queue.h" |
108 |
+ /* Alloca is defined in stdlib.h in NetBSD */ |
109 |
+-#ifndef __NetBSD__ |
110 |
++#if !defined(__NetBSD__) && !defined(__FreeBSD__) |
111 |
+ #include <alloca.h> |
112 |
+ #endif |
113 |
+ #include <limits.h> |
114 |
+@@ -24,6 +24,10 @@ |
115 |
+ #include <fnmatch.h> |
116 |
+ #include <sys/mman.h> |
117 |
+ |
118 |
++#if !defined(PATH_MAX) && defined(__FreeBSD__) |
119 |
++#include <sys/param.h> |
120 |
++#endif |
121 |
++ |
122 |
+ #include "basenames.h" |
123 |
+ #include "log.h" |
124 |
+ #include "logrotate.h" |
125 |
+diff -Nuar a/logrotate.c b/logrotate.c |
126 |
+--- a/logrotate.c 2016-08-03 12:25:47.000000000 +0200 |
127 |
++++ b/logrotate.c 2016-08-03 23:20:52.900062834 +0200 |
128 |
+@@ -1,6 +1,6 @@ |
129 |
+ #include "queue.h" |
130 |
+ /* alloca() is defined in stdlib.h in NetBSD */ |
131 |
+-#ifndef __NetBSD__ |
132 |
++#if !defined(__NetBSD__) && !defined(__FreeBSD__) |
133 |
+ #include <alloca.h> |
134 |
+ #endif |
135 |
+ #include <limits.h> |
136 |
+@@ -26,6 +27,10 @@ |
137 |
+ #include <limits.h> |
138 |
+ #endif |
139 |
+ |
140 |
++#if !defined(PATH_MAX) && defined(__FreeBSD__) |
141 |
++#include <sys/param.h> |
142 |
++#endif |
143 |
++ |
144 |
+ #include "basenames.h" |
145 |
+ #include "log.h" |
146 |
+ #include "logrotate.h" |
147 |
+diff -Nuar a/Makefile.legacy b/Makefile.legacy |
148 |
+--- a/Makefile.legacy 2016-08-03 12:25:47.000000000 +0200 |
149 |
++++ b/Makefile.legacy 2016-08-03 23:21:07.370063125 +0200 |
150 |
+@@ -22,7 +22,9 @@ |
151 |
+ |
152 |
+ ifeq ($(WITH_ACL),yes) |
153 |
+ CFLAGS += -DWITH_ACL |
154 |
++ifneq ($(OS_NAME),FreeBSD) |
155 |
+ LOADLIBES += -lacl |
156 |
++endif |
157 |
+ # See pretest |
158 |
+ TEST_ACL=1 |
159 |
+ else |
160 |
|
161 |
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 |
162 |
new file mode 100644 |
163 |
index 0000000..3496a6d |
164 |
--- /dev/null |
165 |
+++ b/app-admin/logrotate/files/logrotate-3.10.0-ignore-hidden.patch |
166 |
@@ -0,0 +1,14 @@ |
167 |
+diff -Nuar a/config.c b/config.c |
168 |
+--- a/config.c 2016-08-03 12:25:47.000000000 +0200 |
169 |
++++ b/config.c 2016-08-03 23:19:33.730061240 +0200 |
170 |
+@@ -359,7 +359,9 @@ |
171 |
+ char *pattern; |
172 |
+ |
173 |
+ /* Check if fname is '.' or '..'; if so, return false */ |
174 |
+- if (fname[0] == '.' && (!fname[1] || (fname[1] == '.' && !fname[2]))) |
175 |
++ /* Don't include 'hidden' files either; this breaks Gentoo |
176 |
++ portage config file management http://bugs.gentoo.org/87683 */ |
177 |
++ if (fname[0] == '.') |
178 |
+ return 0; |
179 |
+ |
180 |
+ /* Check if fname is ending in a taboo-extension; if so, return false */ |
181 |
|
182 |
diff --git a/app-admin/logrotate/files/logrotate-3.10.0-lfs.patch b/app-admin/logrotate/files/logrotate-3.10.0-lfs.patch |
183 |
new file mode 100644 |
184 |
index 0000000..9c7b360 |
185 |
--- /dev/null |
186 |
+++ b/app-admin/logrotate/files/logrotate-3.10.0-lfs.patch |
187 |
@@ -0,0 +1,11 @@ |
188 |
+diff -Nuar a/configure.ac b/configure.ac |
189 |
+--- a/configure.ac 2016-08-03 12:25:47.000000000 +0200 |
190 |
++++ b/configure.ac 2016-08-03 23:29:44.540073537 +0200 |
191 |
+@@ -9,6 +9,7 @@ |
192 |
+ AC_PROG_CC_STDC |
193 |
+ AC_STRUCT_ST_BLKSIZE |
194 |
+ AC_STRUCT_ST_BLOCKS |
195 |
++AC_SYS_LARGEFILE |
196 |
+ |
197 |
+ AC_CHECK_LIB([popt],[poptParseArgvString],, |
198 |
+ AC_MSG_ERROR([libpopt required but not found])) |
199 |
|
200 |
diff --git a/app-admin/logrotate/files/logrotate-3.10.0-noasprintf.patch b/app-admin/logrotate/files/logrotate-3.10.0-noasprintf.patch |
201 |
new file mode 100644 |
202 |
index 0000000..608a109 |
203 |
--- /dev/null |
204 |
+++ b/app-admin/logrotate/files/logrotate-3.10.0-noasprintf.patch |
205 |
@@ -0,0 +1,55 @@ |
206 |
+diff -Nuar a/config.c b/config.c |
207 |
+--- a/config.c 2016-08-03 23:20:31.200062397 +0200 |
208 |
++++ b/config.c 2016-08-03 23:22:52.830065248 +0200 |
209 |
+@@ -49,39 +49,6 @@ |
210 |
+ #include "asprintf.c" |
211 |
+ #endif |
212 |
+ |
213 |
+-#if !defined(asprintf) && !defined(_FORTIFY_SOURCE) |
214 |
+-#include <stdarg.h> |
215 |
+- |
216 |
+-int asprintf(char **string_ptr, const char *format, ...) |
217 |
+-{ |
218 |
+- va_list arg; |
219 |
+- char *str; |
220 |
+- int size; |
221 |
+- int rv; |
222 |
+- |
223 |
+- va_start(arg, format); |
224 |
+- size = vsnprintf(NULL, 0, format, arg); |
225 |
+- size++; |
226 |
+- va_start(arg, format); |
227 |
+- str = malloc(size); |
228 |
+- if (str == NULL) { |
229 |
+- va_end(arg); |
230 |
+- /* |
231 |
+- * Strictly speaking, GNU asprintf doesn't do this, |
232 |
+- * but the caller isn't checking the return value. |
233 |
+- */ |
234 |
+- fprintf(stderr, "failed to allocate memory\\n"); |
235 |
+- exit(1); |
236 |
+- } |
237 |
+- rv = vsnprintf(str, size, format, arg); |
238 |
+- va_end(arg); |
239 |
+- |
240 |
+- *string_ptr = str; |
241 |
+- return (rv); |
242 |
+-} |
243 |
+- |
244 |
+-#endif |
245 |
+- |
246 |
+ #if !defined(strndup) |
247 |
+ char *strndup(const char *s, size_t n) |
248 |
+ { |
249 |
+diff -Nuar a/logrotate.h b/logrotate.h |
250 |
+--- a/logrotate.h 2016-08-03 12:25:47.000000000 +0200 |
251 |
++++ b/logrotate.h 2016-08-03 23:23:15.220065699 +0200 |
252 |
+@@ -80,8 +80,5 @@ |
253 |
+ extern int debug; |
254 |
+ |
255 |
+ int readAllConfigPaths(const char **paths); |
256 |
+-#if !defined(asprintf) && !defined(_FORTIFY_SOURCE) |
257 |
+-int asprintf(char **string_ptr, const char *format, ...); |
258 |
+-#endif |
259 |
+ |
260 |
+ #endif |
261 |
|
262 |
diff --git a/app-admin/logrotate/logrotate-3.10.0.ebuild b/app-admin/logrotate/logrotate-3.10.0.ebuild |
263 |
new file mode 100644 |
264 |
index 0000000..6a7ff74 |
265 |
--- /dev/null |
266 |
+++ b/app-admin/logrotate/logrotate-3.10.0.ebuild |
267 |
@@ -0,0 +1,90 @@ |
268 |
+# Copyright 1999-2016 Gentoo Foundation |
269 |
+# Distributed under the terms of the GNU General Public License v2 |
270 |
+# $Id$ |
271 |
+ |
272 |
+EAPI=6 |
273 |
+ |
274 |
+inherit autotools eutils toolchain-funcs flag-o-matic |
275 |
+ |
276 |
+DESCRIPTION="Rotates, compresses, and mails system logs" |
277 |
+HOMEPAGE="https://github.com/logrotate/logrotate" |
278 |
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz -> ${P}.tar.gz" |
279 |
+ |
280 |
+LICENSE="GPL-2" |
281 |
+SLOT="0" |
282 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" |
283 |
+IUSE="acl +cron selinux" |
284 |
+ |
285 |
+CDEPEND=" |
286 |
+ >=dev-libs/popt-1.5 |
287 |
+ selinux? ( |
288 |
+ sys-libs/libselinux |
289 |
+ ) |
290 |
+ acl? ( virtual/acl )" |
291 |
+ |
292 |
+DEPEND="${CDEPEND} |
293 |
+ >=sys-apps/sed-4" |
294 |
+ |
295 |
+RDEPEND="${CDEPEND} |
296 |
+ selinux? ( sec-policy/selinux-logrotate ) |
297 |
+ cron? ( virtual/cron )" |
298 |
+ |
299 |
+install_cron_file() { |
300 |
+ sed -i 's#/usr/sbin/logrotate#/usr/bin/logrotate#' "${S}"/examples/logrotate.cron |
301 |
+ exeinto /etc/cron.daily |
302 |
+ newexe "${S}"/examples/logrotate.cron "${PN}" |
303 |
+} |
304 |
+ |
305 |
+PATCHES=( |
306 |
+ "${FILESDIR}"/"${P}"-ignore-hidden.patch \ |
307 |
+ "${FILESDIR}"/"${P}"-fbsd.patch \ |
308 |
+ "${FILESDIR}"/"${P}"-noasprintf.patch \ |
309 |
+ "${FILESDIR}"/"${P}"-atomic-create.patch \ |
310 |
+ "${FILESDIR}"/"${P}"-Werror.patch \ |
311 |
+ "${FILESDIR}"/"${P}"-lfs.patch |
312 |
+) |
313 |
+ |
314 |
+src_prepare() { |
315 |
+ default |
316 |
+ eautoreconf |
317 |
+} |
318 |
+ |
319 |
+src_configure() { |
320 |
+ econf $(use_with acl) $(use_with selinux) |
321 |
+} |
322 |
+ |
323 |
+src_compile() { |
324 |
+ emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}" |
325 |
+} |
326 |
+ |
327 |
+src_test() { |
328 |
+ emake test |
329 |
+} |
330 |
+ |
331 |
+src_install() { |
332 |
+ insinto /usr |
333 |
+ dobin logrotate |
334 |
+ doman logrotate.8 |
335 |
+ dodoc CHANGES examples/logrotate* |
336 |
+ |
337 |
+ insinto /etc |
338 |
+ doins "${FILESDIR}"/logrotate.conf |
339 |
+ |
340 |
+ use cron && install_cron_file |
341 |
+ |
342 |
+ keepdir /etc/logrotate.d |
343 |
+} |
344 |
+ |
345 |
+pkg_postinst() { |
346 |
+ elog "The ${PN} binary is now installed under /usr/bin. Please" |
347 |
+ elog "update your links" |
348 |
+ elog |
349 |
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then |
350 |
+ elog "If you wish to have logrotate e-mail you updates, please" |
351 |
+ elog "emerge virtual/mailx and configure logrotate in" |
352 |
+ elog "/etc/logrotate.conf appropriately" |
353 |
+ elog |
354 |
+ elog "Additionally, /etc/logrotate.conf may need to be modified" |
355 |
+ elog "for your particular needs. See man logrotate for details." |
356 |
+ fi |
357 |
+} |