Merge pull request #1370 from aniruddha2000/aniruddha/add-logrotate-3.18.1-r1

Move logrotate to coreos-overlay from portage-stable
This commit is contained in:
Krzesimir Nowak 2021-11-09 16:57:45 +01:00 committed by GitHub
commit e86b6003a3
8 changed files with 179 additions and 1 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,29 @@
# keep only the most recent old log.
rotate 1
# 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
missingok
notifempty
nomail
noolddir
# accept user provided configuration files in /etc.
include /etc/logrotate.d
# must match creation rules in /usr/lib/tmpfiles.d/var.conf
/var/log/wtmp {
create 0664 root utmp
size 1M
}
/var/log/btmp {
create 0600 root utmp
size 1M
}

View File

@ -0,0 +1,5 @@
[Unit]
Description=Rotate and Compress System Logs
[Service]
ExecStart=/usr/sbin/logrotate /usr/share/logrotate/logrotate.conf

View File

@ -0,0 +1,2 @@
d /var/lib/misc
d /etc/logrotate.d - - - - -

View File

@ -0,0 +1,97 @@
# 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}
systemd_enable_service multi-user.target logrotate.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>

View File

@ -10,7 +10,7 @@ CROS_WORKON_REPO="https://github.com"
if [[ "${PV}" == 9999 ]]; then
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
else
CROS_WORKON_COMMIT="82c6f3c45411e1d9254fb664f14ece39cdbf2f54" # flatcar-master
CROS_WORKON_COMMIT="a3aec0e8daa5ce7b6221356710c3463eff238c4b" # flatcar-master
KEYWORDS="amd64 arm arm64 x86"
fi