Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/logrotate/
Date: Wed, 25 May 2022 22:46:50
Message-Id: 1653518797.898643725ad24e41d3846092d639903f86d3b613.sam@gentoo
1 commit: 898643725ad24e41d3846092d639903f86d3b613
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 25 22:46:15 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed May 25 22:46:37 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89864372
7
8 app-admin/logrotate: add 3.20.1
9
10 Additional fix to the original security issue.
11
12 Bug: https://bugs.gentoo.org/847382
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 app-admin/logrotate/Manifest | 2 +
16 app-admin/logrotate/logrotate-3.20.1.ebuild | 95 +++++++++++++++++++++++++++++
17 2 files changed, 97 insertions(+)
18
19 diff --git a/app-admin/logrotate/Manifest b/app-admin/logrotate/Manifest
20 index f29730e396d9..52cd7279b77a 100644
21 --- a/app-admin/logrotate/Manifest
22 +++ b/app-admin/logrotate/Manifest
23 @@ -2,3 +2,5 @@ DIST logrotate-3.18.1.tar.gz 225226 BLAKE2B 6f40dfe89f9c6202263f16204a9cff07b921
24 DIST logrotate-3.19.0.tar.xz 166276 BLAKE2B bb19690ca092905e527f6a0a7915373a65b29d3b50d97456ed31aa9b5b5698b3ae266c8e247a167198dcd8891a7e330f4913dfefa3563e5b2de7a6e0d067a6c3 SHA512 7838e14a5b147f6e5edf6efdf743deeca39fdb563fc6f14aa010ac5b7bdef9c2bb8005415481d1b042b31975052d5ed6e75c4bcd7e378003427ebe5ec02a1f2c
25 DIST logrotate-3.20.0.tar.xz 166604 BLAKE2B 5cde189e0271d3a46075497547b06b0be0b10d79fb508ca241cd92063de94418e27b346657dd21601b219bd72a30ca1c4f7814d325fda4d40501992f8af3507d SHA512 2e2a6f29dfe8606202962a18b0262b6f56c6dbd3cacef10381ee2ae31ba1ba3166ad7f6b13e5a88dd7628b0048d8ab146951676be273dbe0bc6bfc4e8c67d65e
26 DIST logrotate-3.20.0.tar.xz.asc 833 BLAKE2B cbe3f825f2c17a6541dd2a7e1ab6720045b0f6ec498d13286e7f683317cddcf784c69d29b2ec8f05d62611a9fe1fc46c5db3c9278cefb28d8f0079760e6ea63f SHA512 9bff8dbdbf0c241a00191dc24c8c218c4f52b1f0bffc698446e10ac98d1ac5d8f108dc6aeec0c4729e7bf171d0b32b97419d83f3b8f64ec71f71e7fc54b3b034
27 +DIST logrotate-3.20.1.tar.xz 166712 BLAKE2B 8481e0d746c6bcbe10f2686a921334c6f957c8d92520927de7bc8fb0b7631a444fedaa80f35bc2de7961b3d5833ce4ab885b1298b235b7f8b33cc3ae05438da6 SHA512 a9ed5796ab254f511d0029a8f29ef7557f62e12e3ea9af24e30b5b9f348b1c1a16df26d44314b78299916fb3b5000b9cd9eed7cee2cee8df11cfd8e40c79b092
28 +DIST logrotate-3.20.1.tar.xz.asc 833 BLAKE2B afc02177335bcd580e0617af8c50846b371c2d00ecd8fe329c2e298dc8c48823137625f455cea3d983a0d9971733297fa2c4d98ba3c6f72d2c07f8f21108cfe4 SHA512 2dd207feec431b223ff12f09f6cce14409d45e5bb3abaf2275dd773c7ee7c59ed7d32395e5869bfed70c970be4158fd299e6e269838378843dcb63ca5ebfa029
29
30 diff --git a/app-admin/logrotate/logrotate-3.20.1.ebuild b/app-admin/logrotate/logrotate-3.20.1.ebuild
31 new file mode 100644
32 index 000000000000..79f198aab986
33 --- /dev/null
34 +++ b/app-admin/logrotate/logrotate-3.20.1.ebuild
35 @@ -0,0 +1,95 @@
36 +# Copyright 1999-2022 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +
41 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/kamildudka.asc
42 +inherit systemd tmpfiles verify-sig
43 +
44 +DESCRIPTION="Rotates, compresses, and mails system logs"
45 +HOMEPAGE="https://github.com/logrotate/logrotate"
46 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.xz"
47 +SRC_URI+=" verify-sig? ( https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.xz.asc )"
48 +
49 +LICENSE="GPL-2"
50 +SLOT="0"
51 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
52 +IUSE="acl +cron selinux"
53 +
54 +DEPEND=">=dev-libs/popt-1.5
55 + selinux? ( sys-libs/libselinux )
56 + acl? ( virtual/acl )"
57 +RDEPEND="${DEPEND}
58 + selinux? ( sec-policy/selinux-logrotate )
59 + cron? ( virtual/cron )"
60 +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-kamildudka )"
61 +
62 +STATEFILE="${EPREFIX}/var/lib/misc/logrotate.status"
63 +OLDSTATEFILE="${EPREFIX}/var/lib/logrotate.status"
64 +
65 +PATCHES=(
66 + "${FILESDIR}/${PN}-3.15.0-ignore-hidden.patch"
67 +)
68 +
69 +move_old_state_file() {
70 + elog "logrotate state file is now located at ${STATEFILE}"
71 + elog "See bug #357275"
72 + if [[ -e "${OLDSTATEFILE}" ]] ; then
73 + elog "Moving your current state file to new location: ${STATEFILE}"
74 + mv -n "${OLDSTATEFILE}" "${STATEFILE}" || die
75 + fi
76 +}
77 +
78 +install_cron_file() {
79 + exeinto /etc/cron.daily
80 + newexe "${S}"/examples/logrotate.cron "${PN}"
81 +}
82 +
83 +src_prepare() {
84 + default
85 +
86 + sed -i -e 's#/usr/sbin/logrotate#/usr/bin/logrotate#' examples/logrotate.{cron,service} || die
87 +}
88 +
89 +src_configure() {
90 + econf \
91 + $(use_with acl) \
92 + $(use_with selinux) \
93 + --with-state-file-path="${STATEFILE}"
94 +}
95 +
96 +src_install() {
97 + dobin logrotate
98 + doman logrotate.8
99 + dodoc ChangeLog.md
100 +
101 + insinto /etc
102 + doins "${FILESDIR}"/logrotate.conf
103 +
104 + use cron && install_cron_file
105 +
106 + systemd_dounit examples/logrotate.{service,timer}
107 + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf
108 +
109 + keepdir /etc/logrotate.d
110 +}
111 +
112 +pkg_postinst() {
113 + elog
114 + elog "The ${PN} binary is now installed under /usr/bin. Please"
115 + elog "update your links"
116 + elog
117 +
118 + move_old_state_file
119 +
120 + tmpfiles_process ${PN}.conf
121 +
122 + if [[ -z ${REPLACING_VERSIONS} ]] ; then
123 + elog "If you wish to have logrotate e-mail you updates, please"
124 + elog "emerge virtual/mailx and configure logrotate in"
125 + elog "/etc/logrotate.conf appropriately"
126 + elog
127 + elog "Additionally, /etc/logrotate.conf may need to be modified"
128 + elog "for your particular needs. See man logrotate for details."
129 + fi
130 +}