From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1331152-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 3BCDD158086
	for <garchives@archives.gentoo.org>; Sun, 17 Oct 2021 02:11:54 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 67C2DE0822;
	Sun, 17 Oct 2021 02:11:53 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 0E544E07C5
	for <gentoo-commits@lists.gentoo.org>; Sun, 17 Oct 2021 02:11:53 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id D2C34342D86
	for <gentoo-commits@lists.gentoo.org>; Sun, 17 Oct 2021 02:11:51 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 4DCDC155
	for <gentoo-commits@lists.gentoo.org>; Sun, 17 Oct 2021 02:11:50 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1634436700.51e1085b4e7aabda7dfe098e4b7bb25108c81033.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-antivirus/clamav/clamav-0.104.0.ebuild app-antivirus/clamav/metadata.xml
X-VCS-Directories: app-antivirus/clamav/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 51e1085b4e7aabda7dfe098e4b7bb25108c81033
X-VCS-Branch: master
Date: Sun, 17 Oct 2021 02:11:50 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 2e0317a4-3bce-4567-b7ec-f9560867f0ba
X-Archives-Hash: f8647b55f07565aa54403de850b00186

commit:     51e1085b4e7aabda7dfe098e4b7bb25108c81033
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 17 02:10:18 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 17 02:11:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51e1085b

app-antivirus/clamav: fix installation based on USE=clamapp

Some files only exist with USE=clamapp. We also
enable clamapp by default as it aligns with
expectations.

Closes: https://bugs.gentoo.org/818484
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-antivirus/clamav/clamav-0.104.0.ebuild | 88 +++++++++++++++---------------
 app-antivirus/clamav/metadata.xml          |  4 +-
 2 files changed, 48 insertions(+), 44 deletions(-)

diff --git a/app-antivirus/clamav/clamav-0.104.0.ebuild b/app-antivirus/clamav/clamav-0.104.0.ebuild
index 96c6d859164..61677d2089f 100644
--- a/app-antivirus/clamav/clamav-0.104.0.ebuild
+++ b/app-antivirus/clamav/clamav-0.104.0.ebuild
@@ -13,7 +13,7 @@ SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
-IUSE="doc clamonacc clamapp libclamav-only milter rar selinux systemd test uclibc"
+IUSE="doc clamonacc +clamapp libclamav-only milter rar selinux systemd test uclibc"
 
 REQUIRED_USE="libclamav-only? ( !clamonacc !clamapp !milter )
 			  clamonacc? ( clamapp )
@@ -113,54 +113,56 @@ src_install() {
 							"freshclamd.service"
 		fi
 
-		# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
-		sed -e "s:^\(Example\):\# \1:" \
-			-e "s/^#\(PidFile .*\)/\1/" \
-			-e "s/^#\(LocalSocket .*\)/\1/" \
-			-e "s/^#\(User .*\)/\1/" \
-			-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
-			-e "s:^\#\(LogTime\).*:\1 yes:" \
-			-e "s/^#\(DatabaseDirectory .*\)/\1/" \
-			"${ED}"/etc/clamav/clamd.conf.sample > \
-			"${ED}"/etc/clamav/clamd.conf || die
-
-		sed -e "s:^\(Example\):\# \1:" \
-			-e "s/^#\(PidFile .*\)/\1/" \
-			-e "s/^#\(DatabaseOwner .*\)/\1/" \
-			-e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
-			-e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
-			-e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
-			-e "s/^#\(DatabaseDirectory .*\)/\1/" \
-			"${ED}"/etc/clamav/freshclam.conf.sample > \
-			"${ED}"/etc/clamav/freshclam.conf || die
-
-		if use milter ; then
-			# Note: only keep the "unix" ClamdSocket and MilterSocket!
+		if use clamapp; then
+			# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
 			sed -e "s:^\(Example\):\# \1:" \
 				-e "s/^#\(PidFile .*\)/\1/" \
-				-e "s/^#\(ClamdSocket unix:.*\)/\1/" \
+				-e "s/^#\(LocalSocket .*\)/\1/" \
 				-e "s/^#\(User .*\)/\1/" \
-				-e "s/^#\(MilterSocket unix:.*\)/\1/" \
-				-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
-				"${ED}"/etc/clamav/clamav-milter.conf.sample > \
-				"${ED}"/etc/clamav/clamav-milter.conf || die
+				-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
+				-e "s:^\#\(LogTime\).*:\1 yes:" \
+				-e "s/^#\(DatabaseDirectory .*\)/\1/" \
+				"${ED}"/etc/clamav/clamd.conf.sample > \
+				"${ED}"/etc/clamav/clamd.conf || die
 
-			systemd_newunit "${FILESDIR}/clamav-milter.service-0.104.0" clamav-milter.service
-		fi
-
-		local i
-		for i in clamd freshclam clamav-milter
-		do
-			if [[ -f "${ED}"/etc/"${i}".conf.sample ]]; then
-				mv "${ED}"/etc/"${i}".conf{.sample,} || die
+			sed -e "s:^\(Example\):\# \1:" \
+				-e "s/^#\(PidFile .*\)/\1/" \
+				-e "s/^#\(DatabaseOwner .*\)/\1/" \
+				-e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
+				-e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
+				-e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
+				-e "s/^#\(DatabaseDirectory .*\)/\1/" \
+				"${ED}"/etc/clamav/freshclam.conf.sample > \
+				"${ED}"/etc/clamav/freshclam.conf || die
+
+			if use milter ; then
+				# Note: only keep the "unix" ClamdSocket and MilterSocket!
+				sed -e "s:^\(Example\):\# \1:" \
+					-e "s/^#\(PidFile .*\)/\1/" \
+					-e "s/^#\(ClamdSocket unix:.*\)/\1/" \
+					-e "s/^#\(User .*\)/\1/" \
+					-e "s/^#\(MilterSocket unix:.*\)/\1/" \
+					-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
+					"${ED}"/etc/clamav/clamav-milter.conf.sample > \
+					"${ED}"/etc/clamav/clamav-milter.conf || die
+
+				systemd_newunit "${FILESDIR}/clamav-milter.service-0.104.0" clamav-milter.service
 			fi
-		done
 
-		# These both need to be writable by the clamav user.
-		# TODO: use syslog by default; that's what it's for.
-		diropts -o clamav -g clamav
-		keepdir /var/lib/clamav
-		keepdir /var/log/clamav
+			local i
+			for i in clamd freshclam clamav-milter
+			do
+				if [[ -f "${ED}"/etc/"${i}".conf.sample ]]; then
+					mv "${ED}"/etc/"${i}".conf{.sample,} || die
+				fi
+			done
+
+			# These both need to be writable by the clamav user.
+			# TODO: use syslog by default; that's what it's for.
+			diropts -o clamav -g clamav
+			keepdir /var/lib/clamav
+			keepdir /var/log/clamav
+		fi
 	fi
 
 	if use doc ; then

diff --git a/app-antivirus/clamav/metadata.xml b/app-antivirus/clamav/metadata.xml
index 4c41e164aee..b7ec36aac1c 100644
--- a/app-antivirus/clamav/metadata.xml
+++ b/app-antivirus/clamav/metadata.xml
@@ -12,7 +12,9 @@
   </maintainer>
 
   <use>
-    <flag name="clamapp">Build applications (clamscan, clamd, clamdscan, clamonacc(also has it's own USE flag), sigtool, clambc, clamav-milter(also requires milter USE flag), clamdtop, clamsubmit, clamconf).</flag>
+    <flag name="clamapp">
+	Build applications (clamscan, clamd, clamdscan, clamonacc (also has its own USE flag), sigtool, clambc, clamav-milter (also requires milter USE flag), clamdtop, clamsubmit, clamconf).
+    </flag>
     <flag name="clamonacc">Build the clamonacc on-access scanner</flag>
     <flag name="clamdtop">A Top like tool which shows what clamd is currently scanning amongst other things</flag>
     <flag name="clamsubmit">A tool to submit false positives / negatives</flag>