app-admin/logrotate: Sync with Gentoo upstream; updates to 3.18.1-r1

This commit is contained in:
Aniruddha Basak 2021-10-26 09:56:10 +00:00
parent e0f030c4a0
commit 49bcee9ae7
6 changed files with 184 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST logrotate-3.18.1.tar.gz 225226 BLAKE2B 6f40dfe89f9c6202263f16204a9cff07b921abc9a298b58649bb4968c9f498626741be334c47d4092da564ed75642b687ff6ef8781f69f5e25364f8635646d9d SHA512 c40f920686aee014c652f087c64f2a85e9e866a8717d1bd3f32a9dd7959a02962e6174de28ae685428b442e12079d0c8d91485611ca34a873ffae872a54ec9fe

View File

@ -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 */

View File

@ -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.

View File

@ -0,0 +1 @@
d /var/lib/misc

View File

@ -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
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>base-system@gentoo.org</email>
<name>Gentoo Base System</name>
</maintainer>
<longdescription lang="en">
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.
</longdescription>
<longdescription lang="es">
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.
</longdescription>
<use>
<flag name="acl">Installs acl support</flag>
<flag name="cron">Installs cron file</flag>
<flag name="selinux">Installs Security Enhanced Linux support</flag>
</use>
<upstream>
<remote-id type="github">logrotate/logrotate</remote-id>
<remote-id type="cpe">cpe:/a:logrotate_project:logrotate</remote-id>
</upstream>
</pkgmetadata>