diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-09-14 22:48:30 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-09-14 22:48:30 +0100 |
commit | ea7f3f690b55cdfa8b2d350b03c1dfc0c8357a51 (patch) | |
tree | 4b5a746c80bd7aacbe83448c66643e9dc4dcc105 /app-admin/logcheck/logcheck-1.4.3-r1.ebuild | |
parent | cdb999af22d9aa464bfd480fc9f5ebda71fc89e2 (diff) |
gentoo auto-resync : 14:09:2023 - 22:48:30
Diffstat (limited to 'app-admin/logcheck/logcheck-1.4.3-r1.ebuild')
-rw-r--r-- | app-admin/logcheck/logcheck-1.4.3-r1.ebuild | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/app-admin/logcheck/logcheck-1.4.3-r1.ebuild b/app-admin/logcheck/logcheck-1.4.3-r1.ebuild new file mode 100644 index 000000000000..76743bb9b220 --- /dev/null +++ b/app-admin/logcheck/logcheck-1.4.3-r1.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit readme.gentoo-r1 systemd tmpfiles + +DESCRIPTION="Mails anomalies in the system logfiles to the administrator" +HOMEPAGE="https://logcheck.org/" +SRC_URI="https://salsa.debian.org/debian/logcheck/-/archive/debian/${PV}/logcheck-debian-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-debian-${PV}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~sparc ~x86" +IUSE="cron systemd" +# Test (emake system-test) requires access to system logs +RESTRICT="test" + +DEPEND=" + acct-group/logcheck + acct-user/logcheck[systemd?] +" + +RDEPEND=" + ${DEPEND} + !app-admin/logsentry + app-misc/lockfile-progs + dev-lang/perl + dev-perl/mime-construct + virtual/mailx +" + +DOC_CONTENTS=" + Please read the guide at https://wiki.gentoo.org/wiki/Logcheck + for installation instructions. +" + +src_prepare() { + default + # Set version from PV, without using dpkg + sed -i -e "s/^VERSION=unknown/VERSION=\"${PV}\"/" "${S}/src/logcheck" || die + + # QA-fix remove call to non existent command | Bug: #911281 + sed -i "/dpkg-parsechangelog/d" "${S}/Makefile" || die + + # Add /var/log/messages to checked logs + echo "/var/log/messages" >> "${S}/etc/logcheck.logfiles.d/syslog.logfiles" || die + + # QA-fix Remove install of empty dirs to be created at runtime + sed -i "/install -d \$(DESTDIR)\/var\/lock\/logcheck/d" "${S}/Makefile" || die + + # Comment systemd journal check if systemd use flag is not set | Bug: #913857 + if ! use systemd; then + sed -i -e "s/^journal/#journal/" "${S}/etc/logcheck.logfiles.d/journal.logfiles" || die + fi +} + +src_install() { + default + + keepdir /var/lib/logcheck + + dodoc docs/README.* + doman docs/logtail.8 docs/logtail2.8 + + if use cron; then + exeinto /etc/cron.hourly + newexe "${FILESDIR}"/${PN}.cron ${PN} + DOC_CONTENTS="${DOC_CONTENTS}\n + \n + Read /etc/cron.hourly/logcheck.cron to activate hourly cron-based check!" + fi + + if use systemd; then + DOC_CONTENTS="${DOC_CONTENTS}\n + \n + To enable the systemd timer, run the following command:\n + systemctl enable --now logcheck.timer" + fi + + systemd_dounit "${FILESDIR}/${PN}."{service,timer} + newtmpfiles "${FILESDIR}/logcheck.tmpfiles" logcheck.conf + + readme.gentoo_create_doc + + fowners -R logcheck:logcheck /etc/logcheck /var/lib/logcheck +} + +pkg_postinst() { + tmpfiles_process logcheck.conf + + readme.gentoo_print_elog +} |