summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-10-17 03:10:18 +0100
committerSam James <sam@gentoo.org>2021-10-17 03:11:40 +0100
commit51e1085b4e7aabda7dfe098e4b7bb25108c81033 (patch)
tree99b7769495a846aaab6f73ba58cf6f8ea34ab3f1 /app-antivirus
parentnet-misc/yt-dlp: EAPI8 and small adjustments (diff)
downloadgentoo-51e1085b4e7aabda7dfe098e4b7bb25108c81033.tar.gz
gentoo-51e1085b4e7aabda7dfe098e4b7bb25108c81033.tar.bz2
gentoo-51e1085b4e7aabda7dfe098e4b7bb25108c81033.zip
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@gentoo.org>
Diffstat (limited to 'app-antivirus')
-rw-r--r--app-antivirus/clamav/clamav-0.104.0.ebuild88
-rw-r--r--app-antivirus/clamav/metadata.xml4
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 96c6d859164f..61677d2089f7 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 4c41e164aee7..b7ec36aac1cf 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>