diff options
author | Sam James <sam@gentoo.org> | 2022-05-25 08:46:09 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-05-25 08:55:22 +0100 |
commit | e5f19c9604ac3e7b61ff979add45c7db2f037c03 (patch) | |
tree | cba18635906aa7b085723696edf3b4262ba21680 /app-admin/logrotate | |
parent | sec-keys/openpgp-keys-kamildudka: new package, add 20220525 (diff) | |
download | gentoo-e5f19c9604ac3e7b61ff979add45c7db2f037c03.tar.gz gentoo-e5f19c9604ac3e7b61ff979add45c7db2f037c03.tar.bz2 gentoo-e5f19c9604ac3e7b61ff979add45c7db2f037c03.zip |
app-admin/logrotate: add 3.20.0
Bug: https://bugs.gentoo.org/847382
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-admin/logrotate')
-rw-r--r-- | app-admin/logrotate/Manifest | 2 | ||||
-rw-r--r-- | app-admin/logrotate/logrotate-3.20.0.ebuild | 95 |
2 files changed, 97 insertions, 0 deletions
diff --git a/app-admin/logrotate/Manifest b/app-admin/logrotate/Manifest index 46170aa8169d..f29730e396d9 100644 --- a/app-admin/logrotate/Manifest +++ b/app-admin/logrotate/Manifest @@ -1,2 +1,4 @@ DIST logrotate-3.18.1.tar.gz 225226 BLAKE2B 6f40dfe89f9c6202263f16204a9cff07b921abc9a298b58649bb4968c9f498626741be334c47d4092da564ed75642b687ff6ef8781f69f5e25364f8635646d9d SHA512 c40f920686aee014c652f087c64f2a85e9e866a8717d1bd3f32a9dd7959a02962e6174de28ae685428b442e12079d0c8d91485611ca34a873ffae872a54ec9fe DIST logrotate-3.19.0.tar.xz 166276 BLAKE2B bb19690ca092905e527f6a0a7915373a65b29d3b50d97456ed31aa9b5b5698b3ae266c8e247a167198dcd8891a7e330f4913dfefa3563e5b2de7a6e0d067a6c3 SHA512 7838e14a5b147f6e5edf6efdf743deeca39fdb563fc6f14aa010ac5b7bdef9c2bb8005415481d1b042b31975052d5ed6e75c4bcd7e378003427ebe5ec02a1f2c +DIST logrotate-3.20.0.tar.xz 166604 BLAKE2B 5cde189e0271d3a46075497547b06b0be0b10d79fb508ca241cd92063de94418e27b346657dd21601b219bd72a30ca1c4f7814d325fda4d40501992f8af3507d SHA512 2e2a6f29dfe8606202962a18b0262b6f56c6dbd3cacef10381ee2ae31ba1ba3166ad7f6b13e5a88dd7628b0048d8ab146951676be273dbe0bc6bfc4e8c67d65e +DIST logrotate-3.20.0.tar.xz.asc 833 BLAKE2B cbe3f825f2c17a6541dd2a7e1ab6720045b0f6ec498d13286e7f683317cddcf784c69d29b2ec8f05d62611a9fe1fc46c5db3c9278cefb28d8f0079760e6ea63f SHA512 9bff8dbdbf0c241a00191dc24c8c218c4f52b1f0bffc698446e10ac98d1ac5d8f108dc6aeec0c4729e7bf171d0b32b97419d83f3b8f64ec71f71e7fc54b3b034 diff --git a/app-admin/logrotate/logrotate-3.20.0.ebuild b/app-admin/logrotate/logrotate-3.20.0.ebuild new file mode 100644 index 000000000000..79f198aab986 --- /dev/null +++ b/app-admin/logrotate/logrotate-3.20.0.ebuild @@ -0,0 +1,95 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/kamildudka.asc +inherit systemd tmpfiles verify-sig + +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.xz" +SRC_URI+=" verify-sig? ( https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.xz.asc )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="acl +cron selinux" + +DEPEND=">=dev-libs/popt-1.5 + selinux? ( sys-libs/libselinux ) + acl? ( virtual/acl )" +RDEPEND="${DEPEND} + selinux? ( sec-policy/selinux-logrotate ) + cron? ( virtual/cron )" +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-kamildudka )" + +STATEFILE="${EPREFIX}/var/lib/misc/logrotate.status" +OLDSTATEFILE="${EPREFIX}/var/lib/logrotate.status" + +PATCHES=( + "${FILESDIR}/${PN}-3.15.0-ignore-hidden.patch" +) + +move_old_state_file() { + elog "logrotate state file is now located at ${STATEFILE}" + elog "See bug #357275" + if [[ -e "${OLDSTATEFILE}" ]] ; then + elog "Moving your current state file to new location: ${STATEFILE}" + mv -n "${OLDSTATEFILE}" "${STATEFILE}" || die + fi +} + +install_cron_file() { + exeinto /etc/cron.daily + newexe "${S}"/examples/logrotate.cron "${PN}" +} + +src_prepare() { + default + + sed -i -e 's#/usr/sbin/logrotate#/usr/bin/logrotate#' examples/logrotate.{cron,service} || die +} + +src_configure() { + econf \ + $(use_with acl) \ + $(use_with selinux) \ + --with-state-file-path="${STATEFILE}" +} + +src_install() { + dobin logrotate + doman logrotate.8 + dodoc ChangeLog.md + + insinto /etc + doins "${FILESDIR}"/logrotate.conf + + use cron && install_cron_file + + systemd_dounit examples/logrotate.{service,timer} + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf + + keepdir /etc/logrotate.d +} + +pkg_postinst() { + elog + elog "The ${PN} binary is now installed under /usr/bin. Please" + elog "update your links" + elog + + move_old_state_file + + tmpfiles_process ${PN}.conf + + 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 +} |