From 49bcee9ae75643f5a60d6f2156ed5a8c999b6d26 Mon Sep 17 00:00:00 2001 From: Aniruddha Basak Date: Tue, 26 Oct 2021 09:56:10 +0000 Subject: [PATCH] app-admin/logrotate: Sync with Gentoo upstream; updates to 3.18.1-r1 --- .../app-admin/logrotate/Manifest | 1 + .../logrotate-3.15.0-ignore-hidden.patch | 14 +++ .../app-admin/logrotate/files/logrotate.conf | 42 ++++++++ .../logrotate/files/logrotate.tmpfiles | 1 + .../logrotate/logrotate-3.18.1-r1.ebuild | 96 +++++++++++++++++++ .../app-admin/logrotate/metadata.xml | 30 ++++++ 6 files changed, 184 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/Manifest create mode 100644 sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate-3.15.0-ignore-hidden.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate.conf create mode 100644 sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate.tmpfiles create mode 100644 sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/logrotate-3.18.1-r1.ebuild create mode 100644 sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/metadata.xml diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/Manifest b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/Manifest new file mode 100644 index 0000000000..0d34971c62 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/Manifest @@ -0,0 +1 @@ +DIST logrotate-3.18.1.tar.gz 225226 BLAKE2B 6f40dfe89f9c6202263f16204a9cff07b921abc9a298b58649bb4968c9f498626741be334c47d4092da564ed75642b687ff6ef8781f69f5e25364f8635646d9d SHA512 c40f920686aee014c652f087c64f2a85e9e866a8717d1bd3f32a9dd7959a02962e6174de28ae685428b442e12079d0c8d91485611ca34a873ffae872a54ec9fe diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate-3.15.0-ignore-hidden.patch b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate-3.15.0-ignore-hidden.patch new file mode 100644 index 0000000000..cb2fc073bc --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate-3.15.0-ignore-hidden.patch @@ -0,0 +1,14 @@ +diff -Nuar a/config.c b/config.c +--- a/config.c 2018-10-05 17:01:21.000000000 +0200 ++++ b/config.c 2018-12-19 16:33:52.280129804 +0100 +@@ -417,7 +417,9 @@ + int i; + + /* 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/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate.conf b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate.conf new file mode 100644 index 0000000000..d25e023858 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate.conf @@ -0,0 +1,42 @@ +# +# 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 also be configured here. diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate.tmpfiles b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate.tmpfiles new file mode 100644 index 0000000000..dfb4ab66c1 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/files/logrotate.tmpfiles @@ -0,0 +1 @@ +d /var/lib/misc diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/logrotate-3.18.1-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/logrotate-3.18.1-r1.ebuild new file mode 100644 index 0000000000..2d5867e5be --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/logrotate-3.18.1-r1.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit systemd tmpfiles + +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.gz" + +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 )" + +STATEFILE="${EPREFIX}/var/lib/misc/logrotate.status" +OLDSTATEFILE="${EPREFIX}/var/lib/logrotate.status" + +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}" +} + +PATCHES=( + "${FILESDIR}/${PN}-3.15.0-ignore-hidden.patch" +) + +src_prepare() { + sed -i -e 's#/usr/sbin/logrotate#/usr/bin/logrotate#' examples/logrotate.{cron,service} || die + default +} + +src_configure() { + econf \ + $(use_with acl) \ + $(use_with selinux) \ + --with-state-file-path="${STATEFILE}" +} + +src_test() { + emake test +} + +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 +} diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/metadata.xml b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/metadata.xml new file mode 100644 index 0000000000..7e0dcb9119 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/logrotate/metadata.xml @@ -0,0 +1,30 @@ + + + + + base-system@gentoo.org + Gentoo Base System + + + 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. + + + 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. + + + Installs acl support + Installs cron file + Installs Security Enhanced Linux support + + + logrotate/logrotate + cpe:/a:logrotate_project:logrotate + +