From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 38725158087 for ; Thu, 20 Jan 2022 23:52:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6AC9F2BC001; Thu, 20 Jan 2022 23:52:02 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A7F0D2BC001 for ; Thu, 20 Jan 2022 23:52:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BBA833431C8 for ; Thu, 20 Jan 2022 23:52:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 104D3200 for ; Thu, 20 Jan 2022 23:51:59 +0000 (UTC) From: "Mike Pagano" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Pagano" Message-ID: <1642722709.15b16fa6fd962c7278131da9156657287c6880a7.mpagano@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-forensics/lynis/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-forensics/lynis/lynis-3.0.7-r1.ebuild app-forensics/lynis/lynis-3.0.7.ebuild app-forensics/lynis/metadata.xml X-VCS-Directories: app-forensics/lynis/ X-VCS-Committer: mpagano X-VCS-Committer-Name: Mike Pagano X-VCS-Revision: 15b16fa6fd962c7278131da9156657287c6880a7 X-VCS-Branch: master Date: Thu, 20 Jan 2022 23:51:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c522aa8d-42ff-460b-bc67-375b793c32f6 X-Archives-Hash: 820eeba2f83156130eb260aabe7120be commit: 15b16fa6fd962c7278131da9156657287c6880a7 Author: Mike Pagano gentoo org> AuthorDate: Thu Jan 20 23:51:49 2022 +0000 Commit: Mike Pagano gentoo org> CommitDate: Thu Jan 20 23:51:49 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15b16fa6 app-forensics/lynis: Do not install cron scripts when not appropiate Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Mike Pagano gentoo.org> .../{lynis-3.0.7.ebuild => lynis-3.0.7-r1.ebuild} | 29 ++++++++++++++++++---- app-forensics/lynis/metadata.xml | 3 +++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/app-forensics/lynis/lynis-3.0.7.ebuild b/app-forensics/lynis/lynis-3.0.7-r1.ebuild similarity index 57% rename from app-forensics/lynis/lynis-3.0.7.ebuild rename to app-forensics/lynis/lynis-3.0.7-r1.ebuild index 6ae259786a48..913dca9f8bb1 100644 --- a/app-forensics/lynis/lynis-3.0.7.ebuild +++ b/app-forensics/lynis/lynis-3.0.7-r1.ebuild @@ -12,10 +12,12 @@ SRC_URI="https://cisofy.com/files/${P}.tar.gz" LICENSE="GPL-3" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" +IUSE="cron systemd" DEPEND="" -RDEPEND="app-shells/bash" +RDEPEND=" + app-shells/bash + !systemd? ( virtual/cron )" S="${WORKDIR}/${PN}" @@ -44,10 +46,27 @@ src_install() { sed -i -e 's/\/path\/to\///' "${S}/extras/systemd/${PN}.service" || die "Sed Failed!" systemd_dounit "${S}/extras/systemd/${PN}.service" || die "Sed Failed!" systemd_dounit "${S}/extras/systemd/${PN}.timer" + + if ! use cron; then + ebegin "removing cron files from installation image" + rm -rfv "${ED}/etc/cron.daily" || die + eend "$?" + fi } pkg_postinst() { - einfo - einfo "A cron script has been installed to ${ROOT}/etc/cron.daily/lynis." - einfo + if use cron; then + if systemd_is_booted || has_version sys-apps/systemd; then + echo + ewarn "Both 'cron' and 'systemd' flags are enabled." + ewarn "So both ${PN}.target and cron files were installed." + ewarn "Please don't use 2 implementations at the same time." + ewarn "Cronjobs are usually enabled by default via /etc/cron.* jobs" + ewarn "If you want to use systemd ${PN}.target timers" + ewarn "disable 'cron' flag and reinstall ${PN}" + echo + else + einfo "A cron script has been installed to ${ROOT}/etc/cron.daily/lynis." + fi + fi } diff --git a/app-forensics/lynis/metadata.xml b/app-forensics/lynis/metadata.xml index 086891921a07..72bf02bbb435 100644 --- a/app-forensics/lynis/metadata.xml +++ b/app-forensics/lynis/metadata.xml @@ -5,4 +5,7 @@ mpagano@gentoo.org Mike Pagano + + Install /etc/cron.* files +