summaryrefslogtreecommitdiff
path: root/app-antivirus
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2026-08-10 16:36:40 -0400
committerMichael Orlitzky <mjo@gentoo.org>2026-08-10 21:03:35 -0400
commit74f221a3bd847ed5b19c8acc7425d4282ebad156 (patch)
tree32ca06f42670cbc0da20b758227eb90f10a63ddf /app-antivirus
parent3702b1b3eff1f563892525b8e3cad7670659b1a0 (diff)
app-antivirus/clamav: new LTS revision for CVE patches
Backport the latest round of security patches that affect the 0.103.x series. In addition, * The "STATS" command is now disabled (sorry). These were too hard to backport. As a result, clamdtop is disabled. * One fix for Windows network paths was skipped. Bug: https://bugs.gentoo.org/980609 Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Diffstat (limited to 'app-antivirus')
-rw-r--r--app-antivirus/clamav/Manifest1
-rw-r--r--app-antivirus/clamav/clamav-0.103.12-r6.ebuild231
2 files changed, 232 insertions, 0 deletions
diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index 081214d5fc57..1400f3f341ac 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -21,6 +21,7 @@ DIST cexpr-0.6.0.crate 17966 BLAKE2B cb46f066eb1f4dbac00ec86dc3e562db7ee8ea5ff17
DIST cfg-if-1.0.0.crate 7934 BLAKE2B e99a5589c11d79d77a4537b34ce0a45d37b981c123b79b807cea836c89fc3926d693458893baca2882448d3d44e3f64e06141f6d916b748daa10b8cc1ae16d1b SHA512 0fb16a8882fd30e86b62c5143b1cb18ab564e84e75bd1f28fd12f24ffdc4a42e0d2e012a99abb606c12efe3c11061ff5bf8e24ab053e550ae083f7d90f6576ff
DIST chrono-0.4.38.crate 220559 BLAKE2B ab828bfeed56eb737a1797d5e1132cafe87a1e14bf7a1fe4a5098f50e6ceead50ca2e7f041cc2ff63d5f4e41e2853322f6c345bb31ff12a5b412e3e5202f5fea SHA512 858e47e3facebd5383e71898f26b27d92fe4a69027e2cc47da2af59975ead7767355e0b699f4228eabe76a3eff8b2519c7cecf8b60dc3fc60fbf9b28e2f3d4d9
DIST clamav-0.103-patches-20260702.tar.xz 22420 BLAKE2B 816c59b5d9ed8fb608594aca29bb95e776153eb08dbbf3b7b6a0d9aec6dea83e2935ba2d089ad467ef443d4af62f337b72a90c1bc75948de9d68e076b7bc1e36 SHA512 ef04286ecacc1e53723bb52cd2e0c22e5cb95f50ea56d5ea6ec8f902bf9cda977318c89e6532843a8b6964631770f8120cdbe5e046065d4583c49d9d57b101aa
+DIST clamav-0.103-patches-20260810.tar.xz 32016 BLAKE2B a2745b5abf3ddcbb2609a785f8a4245c215fff03dd76460bdf97ac6b7c04dbfbf6084c8b9057027bb59d2198403ce3f533ebc9d765f8bd4389f64d49f71b5928 SHA512 e5adbe0d4b156e070901c575931f8e694e4bdeaf930d3ece2247d849479ca0d3de3856aecee7f5b5f27debc5aec5c5488fa1595406a3935330bf48359a3d19f6
DIST clamav-0.103.12.tar.gz 16507685 BLAKE2B bc31787625f85867bf21c4555aa2fd2998514986fb571fa4e6cb9fa3fedf61b493c517291b662054edc0bbe8d45649d9c244d943df01950e204baa9e537e3e32 SHA512 0e870a5fd035fbf090359ef7634b1b36e346ff3066b896ff17c2c6ace04f4c17e16181a21fead8b8b2f397de9ea47b928515b717a41996bac4c8efed4d16ec4e
DIST clamav-1.4.3.tar.gz 13431353 BLAKE2B bb775323df020949dfd793e5f145686eaa417a6f10894b1c4ff535ca547d4e943bdf519e63519c31957a19ead18dc560db799f36a7bf07a7b5e44a107acd1877 SHA512 af5f3e60b0098a9bea1cc4283e7fa230f3a3d1d2f760f92eb7a67497a7b21a7526d73ceb4e9f3130f698552f63b47923da03c8e188cd2f5a4c8aa35e93a7625a
DIST clamav-1.4.4-crates.tar.xz 14236120 BLAKE2B 75ded8840297edfe38f02ca865c54a04052725ca0ff83c9c910432e438dfcdde9998e48b86109faf6906c0044e7876a447bfea46ac68b118f43b3c1ac9ae16ac SHA512 58b0de2dd0bbb9097765f1964faf15d96fe78a16ba437b54c7cfb5f347bf89617b1810dafef35e56bae065e94755234eee5bdcd782f25336963dca9a6bcb3fe5
diff --git a/app-antivirus/clamav/clamav-0.103.12-r6.ebuild b/app-antivirus/clamav/clamav-0.103.12-r6.ebuild
new file mode 100644
index 000000000000..e4596117e28b
--- /dev/null
+++ b/app-antivirus/clamav/clamav-0.103.12-r6.ebuild
@@ -0,0 +1,231 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic systemd tmpfiles
+
+DESCRIPTION="Clam Anti-Virus Scanner"
+HOMEPAGE="https://www.clamav.net/"
+SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz
+ https://dev.gentoo.org/~mjo/distfiles/clamav-0.103-patches-20260810.tar.xz"
+
+LICENSE="GPL-2 unRAR"
+SLOT="0/lts"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="bzip2 doc clamonacc clamsubmit iconv libclamav-only milter metadata-analysis-api selinux systemd test xml"
+
+REQUIRED_USE="libclamav-only? ( !clamonacc !clamsubmit !milter !metadata-analysis-api )"
+
+RESTRICT="!test? ( test )"
+
+# Require acct-{user,group}/clamav at build time so that we can set
+# the permissions on /var/lib/clamav in src_install rather than in
+# pkg_postinst; calling "chown" on the live filesystem scares me.
+CDEPEND="acct-group/clamav
+ acct-user/clamav
+ dev-libs/libltdl
+ dev-libs/libmspack
+ || ( dev-libs/libpcre2 dev-libs/libpcre )
+ dev-libs/tomsfastmath
+ >=virtual/zlib-1.2.2:=
+ bzip2? ( app-arch/bzip2 )
+ clamsubmit? ( net-misc/curl dev-libs/json-c:= )
+ elibc_musl? ( sys-libs/fts-standalone )
+ iconv? ( virtual/libiconv )
+ !libclamav-only? ( net-misc/curl )
+ dev-libs/openssl:0=
+ milter? ( mail-filter/libmilter:= )
+ xml? ( dev-libs/libxml2:= )"
+
+# We need at least autoconf-2.69-r5 because that's the first (patched)
+# version of it in Gentoo that supports ./configure --runstatedir.
+BDEPEND=">=dev-build/autoconf-2.69-r5
+ virtual/pkgconfig"
+
+DEPEND="${CDEPEND}
+ metadata-analysis-api? ( dev-libs/json-c:* )
+ test? ( dev-libs/check )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-clamav )"
+
+src_prepare() {
+ eapply "${WORKDIR}"/clamav-0.103-patches-*/*.patch
+
+ default
+
+ # Be extra sure that we're using the system copy of tomsfastmath
+ einfo "removing bundled copy of dev-libs/tomsfastmath"
+ rm -r libclamav/tomsfastmath || \
+ die "failed to remove bundled tomsfastmath"
+
+ AT_NO_RECURSIVE="yes" eautoreconf
+}
+
+src_configure() {
+ use elibc_musl && append-ldflags -lfts
+ use ppc64 && append-flags -mminimal-toc
+
+ # according to configure help it should be
+ # $(use_enable xml)
+ # but that does not work
+ # do not add this, since --disable-xml seems to override
+ # --without-xml
+ JSONUSE="--without-libjson"
+
+ if use clamsubmit || use metadata-analysis-api; then
+ # either of those 2 requires libjson.
+ # clamsubmit will be built as soon as libjson and curl are found
+ # but we only install the binary if requested
+ JSONUSE="--with-libjson=${EPREFIX}/usr"
+ fi
+
+ local myeconfargs=(
+ $(use_enable bzip2)
+ $(use_enable clamonacc)
+ $(use_enable milter)
+ $(use_enable test check)
+ $(use_with xml)
+ $(use_with iconv)
+ ${JSONUSE}
+ $(use_enable libclamav-only)
+ $(use_with !libclamav-only libcurl)
+ --enable-ipv6
+ --with-system-libmspack
+ --cache-file="${S}"/config.cache
+ --disable-clamdtop
+ --disable-experimental
+ --disable-static
+ --disable-zlib-vcheck
+ --enable-id-check
+ --with-dbdir="${EPREFIX}"/var/lib/clamav
+ # Don't call --with-zlib=/usr (see bug #699296)
+ --with-zlib
+ --disable-llvm
+ --enable-openrc
+ --runstatedir=/run
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ rm -rf "${ED}"/var/lib/clamav || die
+
+ if ! use libclamav-only ; then
+ if use systemd; then
+ # The tmpfiles entry is behind USE=systemd because the
+ # OpenRC service scripts should (and do) ensure that the
+ # directories they need exist and have the correct
+ # permissions without the help of tmpfiles.
+ newtmpfiles "${FILESDIR}/tmpfiles.d/clamav-r1.conf" clamav.conf
+ systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
+ systemd_dounit "${FILESDIR}/clamd.service"
+ systemd_newunit "${FILESDIR}/freshclamd.service-r1" \
+ "freshclamd.service"
+ fi
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/clamd.logrotate" clamd
+ newins "${FILESDIR}/freshclam.logrotate" freshclam
+ use milter && \
+ newins "${FILESDIR}/clamav-milter.logrotate-r1" clamav-milter
+
+ # Modify /etc/{clamd,freshclam}.conf to be usable out of the box
+ sed -i -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/clamd.conf.sample || die
+
+ sed -i -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/freshclam.conf.sample || die
+
+ if use milter ; then
+ # Note: only keep the "unix" ClamdSocket and MilterSocket!
+ sed -i -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-milter.conf.sample || die
+
+ cat >> "${ED}"/etc/conf.d/clamd <<-EOF
+ MILTER_NICELEVEL=19
+ START_MILTER=no
+ EOF
+
+ systemd_newunit "${FILESDIR}/clamav-milter.service-r1" 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
+ 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
+
+ if use doc ; then
+ local HTML_DOCS=( docs/html/. )
+ einstalldocs
+
+ if ! use libclamav-only ; then
+ doman docs/man/*.[1-8]
+ fi
+ fi
+
+ find "${ED}" -name '*.la' -delete || die
+}
+
+src_test() {
+ if use libclamav-only ; then
+ ewarn "Test target not available when USE=libclamav-only is set, skipping tests ..."
+ return 0
+ fi
+
+ emake quick-check
+}
+
+pkg_postinst() {
+ if ! use libclamav-only ; then
+ if use systemd ; then
+ tmpfiles_process clamav.conf
+ fi
+ fi
+
+ if use milter ; then
+ elog "For simple instructions how to setup the clamav-milter read the"
+ elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}"
+ fi
+
+ local databases=( "${EROOT}"/var/lib/clamav/main.c[lv]d )
+ if [[ ! -f "${databases}" ]] ; then
+ ewarn "You must run freshclam manually to populate the virus database"
+ ewarn "before starting clamav for the first time."
+ fi
+
+ ewarn "This version of ClamAV provides separate OpenRC services"
+ ewarn "for clamd, freshclam, clamav-milter, and clamonacc. The"
+ ewarn "clamd service now starts only the clamd daemon itself. You"
+ ewarn "should add freshclam (and perhaps clamav-milter) to any"
+ ewarn "runlevels that previously contained clamd."
+}