public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2016-12-25 18:13 Sergei Trofimovich
  0 siblings, 0 replies; 21+ messages in thread
From: Sergei Trofimovich @ 2016-12-25 18:13 UTC (permalink / raw
  To: gentoo-commits

commit:     65711d60b5d0c971790381f4efabbaf0f3c2610d
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 25 18:12:02 2016 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Dec 25 18:12:02 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65711d60

app-antivirus/clamav: fix build failure against gcc-6, bug #592432

Thanks to Peter Levine diagnosed an error as a reserved keyword
problem. I've picked renaming as it's done in upstreal llvm.

Reported-by: Francesco Turco

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 app-antivirus/clamav/clamav-0.99.2.ebuild          |  2 +
 .../clamav/files/clamav-0.99.2-gcc-6.patch         | 84 ++++++++++++++++++++++
 2 files changed, 86 insertions(+)

diff --git a/app-antivirus/clamav/clamav-0.99.2.ebuild b/app-antivirus/clamav/clamav-0.99.2.ebuild
index 1b0207d..8cc42bb 100644
--- a/app-antivirus/clamav/clamav-0.99.2.ebuild
+++ b/app-antivirus/clamav/clamav-0.99.2.ebuild
@@ -46,6 +46,8 @@ pkg_setup() {
 src_prepare() {
 	use ppc64 && append-flags -mminimal-toc
 	use uclibc && export ac_cv_type_error_t=yes
+
+	epatch "${FILESDIR}"/${P}-gcc-6.patch #592432
 }
 
 src_configure() {

diff --git a/app-antivirus/clamav/files/clamav-0.99.2-gcc-6.patch b/app-antivirus/clamav/files/clamav-0.99.2-gcc-6.patch
new file mode 100644
index 00000000..2031edb
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.99.2-gcc-6.patch
@@ -0,0 +1,84 @@
+diff --git a/libclamav/c++/llvm/include/llvm/ADT/StringMap.h b/libclamav/c++/llvm/include/llvm/ADT/StringMap.h
+index 59ff6aa..1325394 100644
+--- a/libclamav/c++/llvm/include/llvm/ADT/StringMap.h
++++ b/libclamav/c++/llvm/include/llvm/ADT/StringMap.h
+@@ -169,3 +169,3 @@ public:
+       KeyLength+1;
+-    unsigned Alignment = alignof<StringMapEntry>();
++    unsigned Alignment = alignOf<StringMapEntry>();
+ 
+diff --git a/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h b/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h
+index 88044c7..86b0f40 100644
+--- a/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h
++++ b/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h
+@@ -417,3 +417,3 @@ namespace llvm {
+           ileAllocator.Allocate(sizeof(IndexListEntry),
+-          alignof<IndexListEntry>()));
++          alignOf<IndexListEntry>()));
+ 
+diff --git a/libclamav/c++/llvm/include/llvm/Support/AlignOf.h b/libclamav/c++/llvm/include/llvm/Support/AlignOf.h
+index 6a7a1a6..979e597 100644
+--- a/libclamav/c++/llvm/include/llvm/Support/AlignOf.h
++++ b/libclamav/c++/llvm/include/llvm/Support/AlignOf.h
+@@ -51,8 +51,8 @@ struct AlignOf {
+ 
+-/// alignof - A templated function that returns the mininum alignment of
++/// alignOf - A templated function that returns the mininum alignment of
+ ///  of a type.  This provides no extra functionality beyond the AlignOf
+ ///  class besides some cosmetic cleanliness.  Example usage:
+-///  alignof<int>() returns the alignment of an int.
++///  alignOf<int>() returns the alignment of an int.
+ template <typename T>
+-static inline unsigned alignof() { return AlignOf<T>::Alignment; }
++static inline unsigned alignOf() { return AlignOf<T>::Alignment; }
+ 
+diff --git a/libclamav/c++/llvm/include/llvm/Support/Allocator.h b/libclamav/c++/llvm/include/llvm/Support/Allocator.h
+index 4a7251f..17caf5e 100644
+--- a/libclamav/c++/llvm/include/llvm/Support/Allocator.h
++++ b/libclamav/c++/llvm/include/llvm/Support/Allocator.h
+@@ -203,3 +203,3 @@ public:
+       for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
+-        Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
++        Ptr = Allocator.AlignPtr(Ptr, alignOf<T>());
+         if (Ptr + sizeof(T) <= End)
+diff --git a/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp b/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp
+index b892d85..dc72346 100644
+--- a/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp
++++ b/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp
+@@ -495,3 +495,3 @@ void SCEVUnknown::print(raw_ostream &OS) const {
+   if (isAlignOf(AllocTy)) {
+-    OS << "alignof(" << *AllocTy << ")";
++    OS << "alignOf(" << *AllocTy << ")";
+     return;
+diff --git a/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp b/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp
+index 824021c..757ca50 100644
+--- a/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp
++++ b/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp
+@@ -569,3 +569,3 @@ void Emitter<CodeEmitter>::emitMemModRMByte(const MachineInstr &MI,
+   // Calculate what the SS field value should be...
+-  static const unsigned SSTable[] = { ~0, 0, 1, ~0, 2, ~0, ~0, ~0, 3 };
++  static const unsigned SSTable[] = { ~0u, 0u, 1u, ~0u, 2u, ~0u, ~0u, ~0u, 3u };
+   unsigned SS = SSTable[Scale.getImm()];
+diff --git a/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp b/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
+index 9564fe0..b2b7986 100644
+--- a/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
++++ b/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
+@@ -332,3 +332,3 @@ void X86MCCodeEmitter::EmitMemModRMByte(const MCInst &MI, unsigned Op,
+   // Calculate what the SS field value should be...
+-  static const unsigned SSTable[] = { ~0, 0, 1, ~0, 2, ~0, ~0, ~0, 3 };
++  static const unsigned SSTable[] = { ~0u, 0u, 1u, ~0u, 2u, ~0u, ~0u, ~0u, 3u };
+   unsigned SS = SSTable[Scale.getImm()];
+diff --git a/libclamav/mpool.c b/libclamav/mpool.c
+index cd38e15..b5e537d 100644
+--- a/libclamav/mpool.c
++++ b/libclamav/mpool.c
+@@ -417,3 +417,3 @@ static size_t from_bits(unsigned int bits) {
+ 
+-static inline unsigned int alignof(size_t size)
++static inline unsigned int alignOf(size_t size)
+ {
+@@ -609,3 +609,3 @@ static void* allocate_aligned(struct MPMAP *mpm, size_t size, unsigned align, co
+ void *mpool_malloc(struct MP *mp, size_t size) {
+-  size_t align = alignof(size);
++  size_t align = alignOf(size);
+   size_t i, needed = align_increase(size+FRAG_OVERHEAD, align);


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2017-04-23 20:26 Jeroen Roovers
  0 siblings, 0 replies; 21+ messages in thread
From: Jeroen Roovers @ 2017-04-23 20:26 UTC (permalink / raw
  To: gentoo-commits

commit:     48726a08716bb85e2f5ec049e54eab6f0639741a
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 23 20:22:05 2017 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun Apr 23 20:26:12 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48726a08

app-antivirus/clamav: Fix building against sys-libs/ncurses[tinfo] (bug #596310).

Package-Manager: Portage-2.3.5, Repoman-2.3.2

 app-antivirus/clamav/clamav-0.99.1.ebuild          |  2 +-
 app-antivirus/clamav/clamav-0.99.2-r1.ebuild       | 18 ++++++++++-------
 app-antivirus/clamav/clamav-0.99.2.ebuild          |  2 +-
 app-antivirus/clamav/clamav-0.99.ebuild            |  2 +-
 ...configure-zlib.patch => clamav-0.99-zlib.patch} |  0
 .../clamav/files/clamav-0.99.2-tinfo.patch         | 23 ++++++++++++++++++++++
 6 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/app-antivirus/clamav/clamav-0.99.1.ebuild b/app-antivirus/clamav/clamav-0.99.1.ebuild
index 132c114a62a..8b65d87de6b 100644
--- a/app-antivirus/clamav/clamav-0.99.1.ebuild
+++ b/app-antivirus/clamav/clamav-0.99.1.ebuild
@@ -45,7 +45,7 @@ src_prepare() {
 	use ppc64 && append-flags -mminimal-toc
 	use uclibc && export ac_cv_type_error_t=yes
 
-	epatch "${FILESDIR}"/${PN}-configure-zlib.patch # 604650, fixed in upstream HEAD
+	epatch "${FILESDIR}"/${PN}-0.99-zlib.patch # 604650, fixed in upstream HEAD
 	eautoconf
 }
 

diff --git a/app-antivirus/clamav/clamav-0.99.2-r1.ebuild b/app-antivirus/clamav/clamav-0.99.2-r1.ebuild
index b6bd457b4a5..75d679e3bd5 100644
--- a/app-antivirus/clamav/clamav-0.99.2-r1.ebuild
+++ b/app-antivirus/clamav/clamav-0.99.2-r1.ebuild
@@ -38,7 +38,8 @@ RDEPEND="${CDEPEND}
 DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
 PATCHES=(
 	"${FILESDIR}"/${P}-gcc-6.patch
-	"${FILESDIR}"/${PN}-configure-zlib.patch
+	"${FILESDIR}"/${P}-tinfo.patch
+	"${FILESDIR}"/${PN}-0.99-zlib.patch
 )
 
 pkg_setup() {
@@ -57,18 +58,21 @@ src_configure() {
 	use uclibc && export ac_cv_type_error_t=yes
 
 	econf \
-		--disable-experimental \
-		--enable-id-check \
-		--with-dbdir="${EPREFIX}"/var/lib/clamav \
-		--with-system-tommath \
-		--with-zlib="${EPREFIX}"/usr \
 		$(use_enable bzip2) \
 		$(use_enable clamdtop) \
 		$(use_enable ipv6) \
 		$(use_enable milter) \
 		$(use_enable static-libs static) \
 		$(use_with iconv) \
-		$(use_with metadata-analysis-api libjson /usr)
+		$(use_with metadata-analysis-api libjson /usr) \
+		--cache-file="${S}"/config.cache \
+		--disable-experimental \
+		--disable-gcc-vcheck \
+		--disable-zlib-vcheck \
+		--enable-id-check \
+		--with-dbdir="${EPREFIX}"/var/lib/clamav \
+		--with-system-tommath \
+		--with-zlib="${EPREFIX}"/usr
 }
 
 src_install() {

diff --git a/app-antivirus/clamav/clamav-0.99.2.ebuild b/app-antivirus/clamav/clamav-0.99.2.ebuild
index 1987aac7e78..bf0acf80abb 100644
--- a/app-antivirus/clamav/clamav-0.99.2.ebuild
+++ b/app-antivirus/clamav/clamav-0.99.2.ebuild
@@ -47,7 +47,7 @@ src_prepare() {
 	use uclibc && export ac_cv_type_error_t=yes
 
 	epatch "${FILESDIR}"/${P}-gcc-6.patch #592432
-	epatch "${FILESDIR}"/${PN}-configure-zlib.patch # 604650, fixed in upstream HEAD
+	epatch "${FILESDIR}"/${PN}-0.99-zlib.patch # 604650, fixed in upstream HEAD
 	eautoconf
 }
 

diff --git a/app-antivirus/clamav/clamav-0.99.ebuild b/app-antivirus/clamav/clamav-0.99.ebuild
index 9ae42e5bba4..020f61bb23e 100644
--- a/app-antivirus/clamav/clamav-0.99.ebuild
+++ b/app-antivirus/clamav/clamav-0.99.ebuild
@@ -45,7 +45,7 @@ src_prepare() {
 	use ppc64 && append-flags -mminimal-toc
 	use uclibc && export ac_cv_type_error_t=yes
 
-	epatch "${FILESDIR}"/${PN}-configure-zlib.patch # 604650, fixed in upstream HEAD
+	epatch "${FILESDIR}"/${P}-zlib.patch # 604650, fixed in upstream HEAD
 	eautoconf
 }
 

diff --git a/app-antivirus/clamav/files/clamav-configure-zlib.patch b/app-antivirus/clamav/files/clamav-0.99-zlib.patch
similarity index 100%
rename from app-antivirus/clamav/files/clamav-configure-zlib.patch
rename to app-antivirus/clamav/files/clamav-0.99-zlib.patch

diff --git a/app-antivirus/clamav/files/clamav-0.99.2-tinfo.patch b/app-antivirus/clamav/files/clamav-0.99.2-tinfo.patch
new file mode 100644
index 00000000000..4593d16836e
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.99.2-tinfo.patch
@@ -0,0 +1,23 @@
+--- a/m4/reorganization/clamdtop.m4
++++ b/m4/reorganization/clamdtop.m4
+@@ -4,12 +4,20 @@
+ 
+ if test "$enable_clamdtop" != "no"; then
+ 
++PKG_CHECK_MODULES([CURSES],[ncurses],
++	[HAVE_LIBNCURSES=yes; CURSES_INCLUDE="<ncurses.h>"],
++	[HAVE_LIBNCURSES=no],
++)
++
++if test "X$HAVE_LIBNCURSES" != "Xyes"; then
++    HAVE_LIBNCURSES=
+ AC_LIB_FIND([ncurses], [ncurses/ncurses.h],
+ 	    AC_LANG_PROGRAM([#include <ncurses/ncurses.h>],
+ 			    [initscr(); KEY_RESIZE;]),
+ 	    [CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES";
+ 	     CURSES_INCLUDE="<ncurses/ncurses.h>"],
+ 	    [])
++fi
+ 
+ if test "X$HAVE_LIBNCURSES" != "Xyes"; then
+     HAVE_LIBNCURSES=


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2017-12-24 23:12 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2017-12-24 23:12 UTC (permalink / raw
  To: gentoo-commits

commit:     44d72fe2005c1dd48af8d44b12b8cf609db5468a
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 24 23:11:31 2017 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Dec 24 23:11:57 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44d72fe2

app-antivirus/clamav: fixup systemd units

Closes: https://bugs.gentoo.org/627700
Closes: https://github.com/gentoo/gentoo/pull/6621
Package-Manager: Portage-2.3.19_p2, Repoman-2.3.6_p36

 .../{clamav-0.99.2-r2.ebuild => clamav-0.99.2-r3.ebuild}      |  0
 app-antivirus/clamav/files/clamd.service                      | 11 ++++++++---
 app-antivirus/clamav/files/clamd_at.service                   |  3 +++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/app-antivirus/clamav/clamav-0.99.2-r2.ebuild b/app-antivirus/clamav/clamav-0.99.2-r3.ebuild
similarity index 100%
rename from app-antivirus/clamav/clamav-0.99.2-r2.ebuild
rename to app-antivirus/clamav/clamav-0.99.2-r3.ebuild

diff --git a/app-antivirus/clamav/files/clamd.service b/app-antivirus/clamav/files/clamd.service
index efdab4314a2..75aa2ccb624 100644
--- a/app-antivirus/clamav/files/clamd.service
+++ b/app-antivirus/clamav/files/clamd.service
@@ -1,7 +1,12 @@
-.include /usr/lib/systemd/system/clamd@.service
-
 [Unit]
-Description=Generic ClamAV scanner daemon
+Description=clamd scanner daemon
+After=nss-lookup.target network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/clamd
+Restart=on-failure
+PrivateTmp=true
 
 [Install]
 WantedBy=multi-user.target

diff --git a/app-antivirus/clamav/files/clamd_at.service b/app-antivirus/clamav/files/clamd_at.service
index c5ad8dfa689..9008ba7e82e 100644
--- a/app-antivirus/clamav/files/clamd_at.service
+++ b/app-antivirus/clamav/files/clamd_at.service
@@ -7,3 +7,6 @@ Type=forking
 ExecStart=/usr/sbin/clamd -c /etc/clamd%i.conf
 Restart=on-failure
 PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2018-02-23 19:00 Thomas Deutschmann
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Deutschmann @ 2018-02-23 19:00 UTC (permalink / raw
  To: gentoo-commits

commit:     69c038dd6c5f79aa46eb92543bed649d50857b66
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 23 19:00:09 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Fri Feb 23 19:00:23 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69c038dd

app-antivirus/clamav: Rev bump to add patch for CVE-2012-6706

...aka VMSF_DELTA Filter Signedness Error.

Bug: https://bugs.gentoo.org/623534
Package-Manager: Portage-2.3.24, Repoman-2.3.6

 app-antivirus/clamav/clamav-0.99.3-r2.ebuild       | 160 ++++++++++++++++++
 ...lamav-0.99.3-VMSF_DELTA-fix-CVE-2012-6706.patch | 186 +++++++++++++++++++++
 2 files changed, 346 insertions(+)

diff --git a/app-antivirus/clamav/clamav-0.99.3-r2.ebuild b/app-antivirus/clamav/clamav-0.99.3-r2.ebuild
new file mode 100644
index 00000000000..f0977dc5f0f
--- /dev/null
+++ b/app-antivirus/clamav/clamav-0.99.3-r2.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic user systemd
+
+DESCRIPTION="Clam Anti-Virus Scanner"
+HOMEPAGE="http://www.clamav.net/"
+SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE="bzip2 clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs uclibc"
+
+CDEPEND="bzip2? ( app-arch/bzip2 )
+	clamdtop? ( sys-libs/ncurses:0 )
+	iconv? ( virtual/libiconv )
+	metadata-analysis-api? ( dev-libs/json-c:= )
+	milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
+	dev-libs/libtommath
+	>=sys-libs/zlib-1.2.2:=
+	!libressl? ( dev-libs/openssl:0= )
+	libressl? ( dev-libs/libressl:0= )
+	sys-devel/libtool
+	|| ( dev-libs/libpcre2 >dev-libs/libpcre-6 )
+	!!<app-antivirus/clamav-0.99"
+# hard block clamav < 0.99 due to linking problems Bug #567680
+# openssl is now *required* see this link as to why
+# http://blog.clamav.net/2014/02/introducing-openssl-as-dependency-to.html
+DEPEND="${CDEPEND}
+	virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-clamav )"
+
+DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.99.2-gcc-6.patch
+	"${FILESDIR}"/${PN}-0.99.2-tinfo.patch
+	"${FILESDIR}"/${PN}-0.99.2-bytecode_api.patch
+	"${FILESDIR}"/${PN}-0.99.2-pcre2-compile-erroffset.patch
+	"${FILESDIR}"/${PN}-0.99.3-fix-fd-leaks-in-cli_scanscript.patch
+	"${FILESDIR}"/${PN}-0.99.3-VMSF_DELTA-fix-CVE-2012-6706.patch
+)
+
+pkg_setup() {
+	enewgroup clamav
+	enewuser clamav -1 -1 /dev/null clamav
+}
+
+src_prepare() {
+	default
+
+	eautoconf
+}
+
+src_configure() {
+	use ppc64 && append-flags -mminimal-toc
+	use uclibc && export ac_cv_type_error_t=yes
+
+	econf \
+		$(use_enable bzip2) \
+		$(use_enable clamdtop) \
+		$(use_enable ipv6) \
+		$(use_enable milter) \
+		$(use_enable static-libs static) \
+		$(use_with iconv) \
+		$(use_with metadata-analysis-api libjson /usr) \
+		--cache-file="${S}"/config.cache \
+		--disable-experimental \
+		--disable-gcc-vcheck \
+		--disable-zlib-vcheck \
+		--enable-id-check \
+		--with-dbdir="${EPREFIX}"/var/lib/clamav \
+		--with-system-tommath \
+		--with-zlib="${EPREFIX}"/usr
+}
+
+src_install() {
+	default
+
+	rm -rf "${ED}"/var/lib/clamav
+	newinitd "${FILESDIR}"/clamd.initd-r6 clamd
+	newconfd "${FILESDIR}"/clamd.conf-r1 clamd
+
+	systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
+	systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
+	systemd_dounit "${FILESDIR}/clamd.service"
+	systemd_dounit "${FILESDIR}/freshclamd.service"
+
+	keepdir /var/lib/clamav
+	fowners clamav:clamav /var/lib/clamav
+	keepdir /var/log/clamav
+	fowners clamav:clamav /var/log/clamav
+
+	dodir /etc/logrotate.d
+	insinto /etc/logrotate.d
+	newins "${FILESDIR}"/clamav.logrotate clamav
+
+	# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
+	sed -i -e "s:^\(Example\):\# \1:" \
+		-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
+		-e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
+		-e "s:.*\(User\) .*:\1 clamav:" \
+		-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
+		-e "s:^\#\(LogTime\).*:\1 yes:" \
+		-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
+		"${ED}"/etc/clamd.conf.sample || die
+	sed -i -e "s:^\(Example\):\# \1:" \
+		-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
+		-e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
+		-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:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
+		"${ED}"/etc/freshclam.conf.sample || die
+
+	if use milter ; then
+		# MilterSocket one to include ' /' because there is a 2nd line for
+		# inet: which we want to leave
+		dodoc "${FILESDIR}"/clamav-milter.README.gentoo
+		sed -i -e "s:^\(Example\):\# \1:" \
+			-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
+			-e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
+			-e "s:.*\(User\) .*:\1 clamav:" \
+			-e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
+			-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
+			-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
+
+	for i in clamd freshclam clamav-milter
+	do
+		[[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,}
+	done
+
+	prune_libtool_files --all
+}
+
+src_test() {
+	emake quick-check
+}
+
+pkg_postinst() {
+	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
+	if test -z $(find "${ROOT}"var/lib/clamav -maxdepth 1 -name 'main.c*' -print -quit) ; then
+		ewarn "You must run freshclam manually to populate the virus database files"
+		ewarn "before starting clamav for the first time.\n"
+	fi
+}

diff --git a/app-antivirus/clamav/files/clamav-0.99.3-VMSF_DELTA-fix-CVE-2012-6706.patch b/app-antivirus/clamav/files/clamav-0.99.3-VMSF_DELTA-fix-CVE-2012-6706.patch
new file mode 100644
index 00000000000..90facf6eae0
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.99.3-VMSF_DELTA-fix-CVE-2012-6706.patch
@@ -0,0 +1,186 @@
+Apply proposed changes to fix RAR VMSF_DELTA Filter Signedness error (CVE-2012-6706)
+
+Cherry picked from commit a7d8447bd9a4d5ae1fa970c1849c8caeb5f1a805 [Link 1] and
+d4699442bce76574573dc564e7f2177d679b88bd [Link 2].
+
+Link 1: https://github.com/Cisco-Talos/clamav-devel/commit/a7d8447bd9a4d5ae1fa970c1849c8caeb5f1a805
+Link 2: https://github.com/Cisco-Talos/clamav-devel/commit/d4699442bce76574573dc564e7f2177d679b88bd
+
+--- a/libclamunrar/unrarvm.c
++++ b/libclamunrar/unrarvm.c
+@@ -213,17 +213,20 @@ void rarvm_addbits(rarvm_input_t *rarvm_input, int bits)
+ 
+ unsigned int rarvm_getbits(rarvm_input_t *rarvm_input)
+ {
+-	unsigned int bit_field;
++        unsigned int bit_field = 0;
+ 
+-	if (rarvm_input->in_addr+2 < rarvm_input->buf_size) {
++        if (rarvm_input->in_addr < rarvm_input->buf_size) {
+             bit_field = (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr] << 16;
+-            bit_field |= (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr+1] << 8;
+-            bit_field |= (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr+2];
+-            bit_field >>= (8-rarvm_input->in_bit);
+-
+-            return (bit_field & 0xffff);
++            if (rarvm_input->in_addr+1 < rarvm_input->buf_size) {
++                bit_field |= (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr+1] << 8;
++                if (rarvm_input->in_addr+2 < rarvm_input->buf_size) {
++                    bit_field |= (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr+2];
++                }
++            }
+         }
+-        return 0;
++        bit_field >>= (8-rarvm_input->in_bit);
++
++        return (bit_field & 0xffff);
+ }
+ 
+ unsigned int rarvm_read_data(rarvm_input_t *rarvm_input)
+@@ -311,10 +314,10 @@ static unsigned int *rarvm_get_operand(rarvm_data_t *rarvm_data,
+ 	}
+ }
+ 
+-static unsigned int filter_itanium_getbits(unsigned char *data, int bit_pos, int bit_count)
++static unsigned int filter_itanium_getbits(unsigned char *data, unsigned int bit_pos, unsigned int bit_count)
+ {
+-	int in_addr=bit_pos/8;
+-	int in_bit=bit_pos&7;
++	unsigned int in_addr=bit_pos/8;
++	unsigned int in_bit=bit_pos&7;
+ 	unsigned int bit_field=(unsigned int)data[in_addr++];
+ 	bit_field|=(unsigned int)data[in_addr++] << 8;
+ 	bit_field|=(unsigned int)data[in_addr++] << 16;
+@@ -323,10 +326,10 @@ static unsigned int filter_itanium_getbits(unsigned char *data, int bit_pos, int
+ 	return(bit_field & (0xffffffff>>(32-bit_count)));
+ }
+ 
+-static void filter_itanium_setbits(unsigned char *data, unsigned int bit_field, int bit_pos, int bit_count)
++static void filter_itanium_setbits(unsigned char *data, unsigned int bit_field, unsigned int bit_pos, unsigned int bit_count)
+ {
+-	int i, in_addr=bit_pos/8;
+-	int in_bit=bit_pos&7;
++	unsigned int i, in_addr=bit_pos/8;
++	unsigned int in_bit=bit_pos&7;
+ 	unsigned int and_mask=0xffffffff>>(32-bit_count);
+ 	and_mask=~(and_mask<<in_bit);
+ 
+@@ -343,11 +346,12 @@ static void filter_itanium_setbits(unsigned char *data, unsigned int bit_field,
+ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_filters_t filter_type)
+ {
+ 	unsigned char *data, cmp_byte2, cur_byte, *src_data, *dest_data;
+-	int i, j, data_size, channels, src_pos, dest_pos, border, width, PosR;
+-	int op_type, cur_channel, byte_count, start_pos, pa, pb, pc;
++	unsigned int i, j, data_size, channels, src_pos, dest_pos, border, width, PosR;
++	unsigned int op_type, cur_channel, byte_count, start_pos;
++	int pa, pb, pc;
+ 	unsigned int file_offset, cur_pos, predicted;
+-	int32_t offset, addr;
+-	const int file_size=0x1000000;
++	uint32_t offset, addr;
++	const unsigned int file_size=0x1000000;
+ 
+ 	switch(filter_type) {
+ 	case VMSF_E8:
+@@ -356,7 +360,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
+ 		data_size = rarvm_data->R[4];
+ 		file_offset = rarvm_data->R[6];
+ 
+-		if (((unsigned int)data_size >= VM_GLOBALMEMADDR) || (data_size < 4)) {
++		if ((data_size > VM_GLOBALMEMADDR) || (data_size < 4)) {
+ 			break;
+ 		}
+ 
+@@ -367,12 +371,14 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
+ 			if (cur_byte==0xe8 || cur_byte==cmp_byte2) {
+ 				offset = cur_pos+file_offset;
+ 				addr = GET_VALUE(FALSE, data);
+-				if (addr < 0) {
+-					if (addr+offset >=0 ) {
++				// We check 0x80000000 bit instead of '< 0' comparison
++				// not assuming int32 presence or uint size and endianness.
++				if ((addr & 0x80000000)!=0) {              // addr<0
++					if (((addr+offset) & 0x80000000)==0) {   // addr+offset>=0
+ 						SET_VALUE(FALSE, data, addr+file_size);
+ 					}
+ 				} else {
+-					if (addr<file_size) {
++					if (((addr-file_size) & 0x80000000)!=0) { // addr<file_size
+ 						SET_VALUE(FALSE, data, addr-offset);
+ 					}
+ 				}
+@@ -386,7 +392,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
+ 		data_size = rarvm_data->R[4];
+ 		file_offset = rarvm_data->R[6];
+ 		
+-		if (((unsigned int)data_size >= VM_GLOBALMEMADDR) || (data_size < 21)) {
++		if ((data_size > VM_GLOBALMEMADDR) || (data_size < 21)) {
+ 			break;
+ 		}
+ 		
+@@ -429,7 +435,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
+ 		border = data_size*2;
+ 		
+ 		SET_VALUE(FALSE, &rarvm_data->mem[VM_GLOBALMEMADDR+0x20], data_size);
+-		if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2) {
++		if (data_size > VM_GLOBALMEMADDR/2 || channels > 1024 || channels == 0) {
+ 			break;
+ 		}
+ 		for (cur_channel=0 ; cur_channel < channels ; cur_channel++) {
+@@ -440,7 +446,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
+ 		}
+ 		break;
+ 	case VMSF_RGB: {
+-		const int channels=3;
++		const unsigned int channels=3;
+ 		data_size = rarvm_data->R[4];
+ 		width = rarvm_data->R[0] - 3;
+ 		PosR = rarvm_data->R[1];
+@@ -448,15 +454,14 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
+ 		dest_data = src_data + data_size;
+ 		
+ 		SET_VALUE(FALSE, &rarvm_data->mem[VM_GLOBALMEMADDR+0x20], data_size);
+-		if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2) {
++		if (data_size > VM_GLOBALMEMADDR/2 || data_size < 3 || width > data_size || PosR > 2) {
+ 			break;
+ 		}
+ 		for (cur_channel=0 ; cur_channel < channels; cur_channel++) {
+ 			unsigned int prev_byte = 0;
+ 			for (i=cur_channel ; i<data_size ; i+=channels) {
+-				int upper_pos=i-width;
+-				if (upper_pos >= 3) {
+-					unsigned char *upper_data = dest_data+upper_pos;
++				if (i >= width+3) {
++					unsigned char *upper_data = dest_data+i-width;
+ 					unsigned int upper_byte = *upper_data;
+ 					unsigned int upper_left_byte = *(upper_data-3);
+ 					predicted = prev_byte+upper_byte-upper_left_byte;
+@@ -486,13 +491,14 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
+ 		break;
+ 	}
+ 	case VMSF_AUDIO: {
+-		int channels=rarvm_data->R[0];
++		unsigned int channels=rarvm_data->R[0];
+ 		data_size = rarvm_data->R[4];
+ 		src_data = rarvm_data->mem;
+ 		dest_data = src_data + data_size;
+ 		
+ 		SET_VALUE(FALSE, &rarvm_data->mem[VM_GLOBALMEMADDR+0x20], data_size);
+-		if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2) {
++		// In fact, audio channels never exceed 4.
++		if (data_size > VM_GLOBALMEMADDR/2 || channels > 128 || channels == 0) {
+ 			break;
+ 		}
+ 		for (cur_channel=0 ; cur_channel < channels ; cur_channel++) {
+@@ -553,7 +559,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
+ 		data_size = rarvm_data->R[4];
+ 		src_pos = 0;
+ 		dest_pos = data_size;
+-		if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2) {
++		if (data_size > VM_GLOBALMEMADDR/2) {
+ 			break;
+ 		}
+ 		while (src_pos < data_size) {
+-- 
+2.16.2
+


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2018-03-02 18:42 Thomas Raschbacher
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Raschbacher @ 2018-03-02 18:42 UTC (permalink / raw
  To: gentoo-commits

commit:     3ef3729b3b97a44da91368fe40a77a1886e4464d
Author:     Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  2 18:38:04 2018 +0000
Commit:     Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
CommitDate: Fri Mar  2 18:41:49 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ef3729b

app-antivirus/clamav:
adding 0.99.4 security release

Package-Manager: Portage-2.3.19, Repoman-2.3.6

 app-antivirus/clamav/Manifest                      |   1 +
 app-antivirus/clamav/clamav-0.99.4.ebuild          | 156 +++++++++++++++++++++
 .../clamav-0.99.4-pcre2-compile-erroffset.patch    |  11 ++
 3 files changed, 168 insertions(+)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index f30802ee7e0..1296e9f756b 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -1,2 +1,3 @@
 DIST clamav-0.99.2.tar.gz 16067497 BLAKE2B 4155e3125ccc45cc6828033f207b6b8d3514253dfb8156428ad4096c0901d5a8500f9dd253b8f40afdc49a6039b647627868f75d51829ab7bd247ada5f3b8383 SHA512 7744ba8a344b163cf98e9737cddfd25d2120b34ee9c4518380e028c9ec3cd50127b198b0dfa9fde30f5ce9aab0c0e6384712fbc11287e77d16ce052fd7b6ac44
 DIST clamav-0.99.3.tar.gz 16082645 BLAKE2B 3be06e563f17a07e4c7e95eb3efbb61e80858bcb3dffc584f13ec30dc2ef9c5257aec78605f1c03e183b4b7ed5b08343a25b579b2b12e54458694eff624aa01e SHA512 0d3c75d571ed4aa4937ef2b743a39a9a144f5adfd6f56f71046e5a8387b8ed7c3c4d9a4196aa85750f9ec4dc545720fdd659289d0cce086ab13a7cc505a0ab3e
+DIST clamav-0.99.4.tar.gz 16083015 BLAKE2B 3c2e7d11ee05fe846f75c3fb6501b5fd809a2e58f8e69c82e493e32fcbc87ca0e5b5f7ab83a0d7e251a5dc8e84aed1475c87c1248b393fa04b6924a2ab32b9bf SHA512 778d5ef510d8d4bdfac5dc33d92469ed4283c414b3d42da6e1a0b13ed70e37755d5c837622dc336bc728ba1f8bf5485fc8a8d3a67a90e9aaa9e4dc71ece0691d

diff --git a/app-antivirus/clamav/clamav-0.99.4.ebuild b/app-antivirus/clamav/clamav-0.99.4.ebuild
new file mode 100644
index 00000000000..6df52a55c99
--- /dev/null
+++ b/app-antivirus/clamav/clamav-0.99.4.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic user systemd
+
+DESCRIPTION="Clam Anti-Virus Scanner"
+HOMEPAGE="http://www.clamav.net/"
+SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE="bzip2 clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs uclibc"
+
+CDEPEND="bzip2? ( app-arch/bzip2 )
+	clamdtop? ( sys-libs/ncurses:0 )
+	iconv? ( virtual/libiconv )
+	metadata-analysis-api? ( dev-libs/json-c:= )
+	milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
+	dev-libs/libtommath
+	>=sys-libs/zlib-1.2.2:=
+	!libressl? ( dev-libs/openssl:0= )
+	libressl? ( dev-libs/libressl:0= )
+	sys-devel/libtool
+	|| ( dev-libs/libpcre2 >dev-libs/libpcre-6 )
+	!!<app-antivirus/clamav-0.99"
+# hard block clamav < 0.99 due to linking problems Bug #567680
+# openssl is now *required* see this link as to why
+# http://blog.clamav.net/2014/02/introducing-openssl-as-dependency-to.html
+DEPEND="${CDEPEND}
+	virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-clamav )"
+
+DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
+PATCHES=(
+	"${FILESDIR}/${P}-pcre2-compile-erroffset.patch"
+)
+
+pkg_setup() {
+	enewgroup clamav
+	enewuser clamav -1 -1 /dev/null clamav
+}
+
+src_prepare() {
+	default
+
+	eautoconf
+}
+
+src_configure() {
+	use ppc64 && append-flags -mminimal-toc
+	use uclibc && export ac_cv_type_error_t=yes
+
+	econf \
+		$(use_enable bzip2) \
+		$(use_enable clamdtop) \
+		$(use_enable ipv6) \
+		$(use_enable milter) \
+		$(use_enable static-libs static) \
+		$(use_with iconv) \
+		$(use_with metadata-analysis-api libjson /usr) \
+		--cache-file="${S}"/config.cache \
+		--disable-experimental \
+		--disable-gcc-vcheck \
+		--disable-zlib-vcheck \
+		--enable-id-check \
+		--with-dbdir="${EPREFIX}"/var/lib/clamav \
+		--with-system-tommath \
+		--with-zlib="${EPREFIX}"/usr \
+		--disable-llvm
+}
+
+src_install() {
+	default
+
+	rm -rf "${ED}"/var/lib/clamav
+	newinitd "${FILESDIR}"/clamd.initd-r6 clamd
+	newconfd "${FILESDIR}"/clamd.conf-r1 clamd
+
+	systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
+	systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
+	systemd_dounit "${FILESDIR}/clamd.service"
+	systemd_dounit "${FILESDIR}/freshclamd.service"
+
+	keepdir /var/lib/clamav
+	fowners clamav:clamav /var/lib/clamav
+	keepdir /var/log/clamav
+	fowners clamav:clamav /var/log/clamav
+
+	dodir /etc/logrotate.d
+	insinto /etc/logrotate.d
+	newins "${FILESDIR}"/clamav.logrotate clamav
+
+	# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
+	sed -i -e "s:^\(Example\):\# \1:" \
+		-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
+		-e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
+		-e "s:.*\(User\) .*:\1 clamav:" \
+		-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
+		-e "s:^\#\(LogTime\).*:\1 yes:" \
+		-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
+		"${ED}"/etc/clamd.conf.sample || die
+	sed -i -e "s:^\(Example\):\# \1:" \
+		-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
+		-e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
+		-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:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
+		"${ED}"/etc/freshclam.conf.sample || die
+
+	if use milter ; then
+		# MilterSocket one to include ' /' because there is a 2nd line for
+		# inet: which we want to leave
+		dodoc "${FILESDIR}"/clamav-milter.README.gentoo
+		sed -i -e "s:^\(Example\):\# \1:" \
+			-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
+			-e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
+			-e "s:.*\(User\) .*:\1 clamav:" \
+			-e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
+			-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
+			-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
+
+	for i in clamd freshclam clamav-milter
+	do
+		[[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,}
+	done
+
+	prune_libtool_files --all
+}
+
+src_test() {
+	emake quick-check
+}
+
+pkg_postinst() {
+	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
+	if test -z $(find "${ROOT}"var/lib/clamav -maxdepth 1 -name 'main.c*' -print -quit) ; then
+		ewarn "You must run freshclam manually to populate the virus database files"
+		ewarn "before starting clamav for the first time.\n"
+	fi
+}

diff --git a/app-antivirus/clamav/files/clamav-0.99.4-pcre2-compile-erroffset.patch b/app-antivirus/clamav/files/clamav-0.99.4-pcre2-compile-erroffset.patch
new file mode 100644
index 00000000000..5585ea61453
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.99.4-pcre2-compile-erroffset.patch
@@ -0,0 +1,11 @@
+--- clamav-0.99.4/libclamav/regex_pcre.c_orig   2018-03-02 19:10:39.702899702 +0100
++++ clamav-0.99.4/libclamav/regex_pcre.c        2018-03-02 19:09:27.600901912 +0100
+@@ -112,7 +112,8 @@
+ #if USING_PCRE2
+ int cli_pcre_compile(struct cli_pcre_data *pd, long long unsigned match_limit, long long unsigned match_limit_recursion, unsigned int options, int opt_override)
+ {
+-    int errornum, erroffset;
++    int errornum;
++    size_t erroffset;
+     pcre2_general_context *gctx;
+     pcre2_compile_context *cctx;


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2019-07-31 12:07 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2019-07-31 12:07 UTC (permalink / raw
  To: gentoo-commits

commit:     23f936685079e75931b026d5dcdb2e18015daf71
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 31 12:02:32 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Jul 31 12:07:20 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23f93668

app-antivirus/clamav: Revbump to remove automagic dep on dev-libs/icu

Fixed without excplicit permission due to maintainer timeout.

Bug: https://bugs.gentoo.org/661328
Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 ...mav-0.101.2.ebuild => clamav-0.101.2-r1.ebuild} | 15 ++---
 .../files/clamav-0.101.2-libxml2_pkgconfig.patch   | 78 ++++++++++++++++++++++
 2 files changed, 85 insertions(+), 8 deletions(-)

diff --git a/app-antivirus/clamav/clamav-0.101.2.ebuild b/app-antivirus/clamav/clamav-0.101.2-r1.ebuild
similarity index 97%
rename from app-antivirus/clamav/clamav-0.101.2.ebuild
rename to app-antivirus/clamav/clamav-0.101.2-r1.ebuild
index 165eaec4372..986cc1711ae 100644
--- a/app-antivirus/clamav/clamav-0.101.2.ebuild
+++ b/app-antivirus/clamav/clamav-0.101.2-r1.ebuild
@@ -40,20 +40,19 @@ RDEPEND="${CDEPEND}
 DOCS=( docs/UserManual.md docs/UserManual )
 HTML_DOCS=( docs/html )
 
-#PATCHES=(
-#	"${FILESDIR}/clamav-0.100.0_autotools.patch"
-#)
+PATCHES=(
+	"${FILESDIR}/clamav-0.101.2-libxml2_pkgconfig.patch" #661328
+)
 
 pkg_setup() {
 	enewgroup clamav
 	enewuser clamav -1 -1 /dev/null clamav
 }
 
-#src_prepare() {
-#	default
-#
-#	eautoconf
-#}
+src_prepare() {
+	default
+	eautoconf
+}
 
 src_configure() {
 	use elibc_musl && append-ldflags -lfts

diff --git a/app-antivirus/clamav/files/clamav-0.101.2-libxml2_pkgconfig.patch b/app-antivirus/clamav/files/clamav-0.101.2-libxml2_pkgconfig.patch
new file mode 100644
index 00000000000..e1f5bb9b338
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.101.2-libxml2_pkgconfig.patch
@@ -0,0 +1,78 @@
+https://bugs.gentoo.org/661328
+
+--- clamav-0.101.2/m4/reorganization/libs/xml.m4
++++ clamav-0.101.2/m4/reorganization/libs/xml.m4
+@@ -4,55 +4,19 @@
+ [AS_HELP_STRING([--disable-xml], [do not include DMG and XAR support])],
+ want_xml=$enableval, want_xml="auto")
+ 
+-XML_HOME=""
+-if test "X$want_xml" != "Xno"; then
+-  AC_MSG_CHECKING([for libxml2 installation])
+-  AC_ARG_WITH([xml],
+-    AS_HELP_STRING([--with-xml@<:@=DIR@:>@], [path to directory containing libxml2 library
+-                    @<:@default=/usr/local or /usr if not found in /usr/local@:>@]),
+-    [with_xml_val=$withval]
+-  )
+-fi
+-
+-AS_IF([test "x$with_xml_val" = "xno"], [XML_HOME=""],
+-  [test "x$with_xml_val" = "xyes"], [XML_HOME="/usr/local"],
+-  [XML_HOME="$with_xml_val"])
+-
+-AS_IF([test "x$XML_HOME" != "x"], [
+-   AS_IF([test ! -x "$XML_HOME/bin/xml2-config"], [XML_HOME=""])
+-   ])
+-
+-AS_IF([test "x$XML_HOME" = "x" -a "x$with_xml_val" = "xyes"], [
+-   AS_IF([test -x "/usr/bin/xml2-config"], [XML_HOME="/usr"])
+-   ])
+-
+-if test "x$XML_HOME" != "x"; then
+-  AC_MSG_RESULT([$XML_HOME])
+-else
+-  AC_MSG_RESULT([not found])
+-fi
+-
+-found_xml="no"
+-XMLCONF_VERSION=""
+-XML_CPPFLAGS=""
+-XML_LIBS=""
+-if test "x$XML_HOME" != "x"; then
+-  AC_MSG_CHECKING([xml2-config version])
+-  XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`"
+-  if test "x%XMLCONF_VERSION" != "x"; then
+-    AC_MSG_RESULT([$XMLCONF_VERSION])
+-    found_xml="yes"
+-    XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`"
+-    XML_LIBS="`$XML_HOME/bin/xml2-config --libs`"
+-    AS_ECHO("$XML_CPPFLAGS")
+-    AS_ECHO("$XML_LIBS")
+-  else
+-    AC_MSG_ERROR([xml2-config failed])
+-  fi
+-fi
++PKG_CHECK_MODULES([XML], [libxml-2.0],
++	[found_xml=yes],
++	[
++		found_xml=no
++		AS_IF([test "x$want_xml" = xyes],
++			[AC_MSG_ERROR([--enable-xml set but cannot find libxml2])]
++		)
++	]
++)
+ 
+ working_xml="no"
+ if test "X$found_xml" != "Xno"; then
++  XML_HOME=$(${PKG_CONFIG} --variable prefix libxml-2.0)
+   AC_MSG_CHECKING([for xmlreader.h in $XML_HOME])
+ 
+   if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then
+@@ -61,6 +25,7 @@
+     AC_MSG_RESULT([found])
+     save_LIBS="$LIBS"
+     save_CPPFLAGS="$CPPFLAGS"
++    XML_CPPFLAGS="$XML_CFLAGS"
+     CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+     save_LDFLAGS="$LDFLAGS"
+     LDFLAGS="$LDFLAGS $XML_LIBS"


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2019-07-31 12:47 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2019-07-31 12:47 UTC (permalink / raw
  To: gentoo-commits

commit:     ca05c21a3ab3e69ff60da41cb10cba2de84ed614
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 31 12:47:12 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Jul 31 12:47:39 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca05c21a

app-antivirus/clamav: Fixed compilation with sys-libs/ncurses[tinfo]

Fixed without excplicit permission due to maintainer timeout.

Thanks-to: Jeroen Roovers <jer <AT> gentoo.org>
Bug: https://bugs.gentoo.org/670729
Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-antivirus/clamav/clamav-0.101.2-r1.ebuild      |  3 ++-
 .../clamav/files/clamav-0.101.2-tinfo.patch        | 31 ++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/app-antivirus/clamav/clamav-0.101.2-r1.ebuild b/app-antivirus/clamav/clamav-0.101.2-r1.ebuild
index 986cc1711ae..372a1c6336b 100644
--- a/app-antivirus/clamav/clamav-0.101.2-r1.ebuild
+++ b/app-antivirus/clamav/clamav-0.101.2-r1.ebuild
@@ -41,7 +41,8 @@ DOCS=( docs/UserManual.md docs/UserManual )
 HTML_DOCS=( docs/html )
 
 PATCHES=(
-	"${FILESDIR}/clamav-0.101.2-libxml2_pkgconfig.patch" #661328
+	"${FILESDIR}/${PN}-0.101.2-libxml2_pkgconfig.patch" #661328
+	"${FILESDIR}/${PN}-0.101.2-tinfo.patch" #670729
 )
 
 pkg_setup() {

diff --git a/app-antivirus/clamav/files/clamav-0.101.2-tinfo.patch b/app-antivirus/clamav/files/clamav-0.101.2-tinfo.patch
new file mode 100644
index 00000000000..66130be4188
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.101.2-tinfo.patch
@@ -0,0 +1,31 @@
+https://bugs.gentoo.org/670729
+
+--- a/m4/reorganization/clamdtop.m4
++++ b/m4/reorganization/clamdtop.m4
+@@ -4,12 +4,26 @@
+ 
+ if test "$enable_clamdtop" != "no"; then
+ 
++PKG_CHECK_MODULES([CURSES], [ncursesw],
++		[CURSES_INCLUDE="<ncurses.h>";
++		 HAVE_LIBNCURSES=yes],
++		HAVE_LIBNCURSES=no])
++
++if test "X$HAVE_LIBNCURSES" != "Xyes"; then
++PKG_CHECK_MODULES([CURSES], [ncurses],
++	    [CURSES_INCLUDE="<ncurses.h>";
++	     HAVE_LIBNCURSES=yes],
++	    HAVE_LIBNCURSES=no])
++fi
++
++if test "X$HAVE_LIBNCURSES" != "Xyes"; then
+ AC_LIB_FIND([ncurses], [ncurses/ncurses.h],
+ 	    AC_LANG_PROGRAM([#include <ncurses/ncurses.h>],
+ 			    [initscr(); KEY_RESIZE;]),
+ 	    [CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES";
+ 	     CURSES_INCLUDE="<ncurses/ncurses.h>"],
+ 	    [])
++fi
+ 
+ if test "X$HAVE_LIBNCURSES" != "Xyes"; then
+     HAVE_LIBNCURSES=


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2019-11-25  4:08 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2019-11-25  4:08 UTC (permalink / raw
  To: gentoo-commits

commit:     0bed854e02879dce0dd783dafb9ab175eb7ca443
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 25 03:02:23 2019 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon Nov 25 03:54:20 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bed854e

app-antivirus/clamav: new version 0.102.1.

This new version fixes some major problems in the last one. The milter
isn't totally busted, a DoS was patched (CVE-2019-15961), we don't need
to patch the build system to detect libxml2, and fanotify should now
be found when it's there.

I've also tweaked the documentation location so that we don't wind up
with nested "html" directories, and stopped USE="-metadata-analysis-api"
from clobbering USE="clamsubmit" in the ebuild.

The mailing list reports that there are still intermittent test
failures and a ./configure bug, but this one might actually be usable.

Closes: https://bugs.gentoo.org/697686
Closes: https://bugs.gentoo.org/697688
Closes: https://bugs.gentoo.org/701094
Package-Manager: Portage-2.3.76, Repoman-2.3.16
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 app-antivirus/clamav/Manifest                      |   2 +-
 ...mav-0.102.0-r2.ebuild => clamav-0.102.1.ebuild} |  13 +--
 .../files/clamav-0.102.0-libxml2_pkgconfig.patch   | 101 ---------------------
 3 files changed, 5 insertions(+), 111 deletions(-)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index 00830a7c63b..6af7a532eee 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -1,4 +1,4 @@
 DIST clamav-0.101.2.tar.gz 21722932 BLAKE2B 5c2960e678510a6f829fc9333e05a45a57a704e13eb407e0f890dd5553a1f9644eb3b1122c677755237b8c682127319d447a508087bc9130d14cd2cfec92896a SHA512 f9ea4589a8081acf7b6d454d1a068da05ae6574a9070a08f9438935795cb6dc084ffb9222b11fb1623f31962f859e6536a2f5bd1de29ef6b9b314efa5edc8c7e
 DIST clamav-0.101.3.tar.gz 21389753 BLAKE2B f254846dad40bd9dda650ece9dd672ca040fe4779b4f46a5cfa087808711055745d02c65f24da9589420e979a777bc435f68d25f6940ebf283cd0a8f240908b5 SHA512 285e6011ef5b68683daae7287005b2a615d7ee2fb9dac28d6db347cf7fe101da627aaec800366e83551f41afb78c6b08517def7aa30d0f0c347e54344b0b14d3
 DIST clamav-0.101.4.tar.gz 21408145 BLAKE2B 5eba85dcf203f56cbd943e479e660469dcc1972819674f5624207f4123ec74207b664cba3c9b0318665d261176da338f3c3fba9c938eeb626ce75174d525a43f SHA512 fae914a95b674fa6bdea044abec702401146590ca0aaaea1245deb1c4770641a794f60ff7b448b24d8c1923150cb7ba230848974837257c3a8ab20ea1e2f86d3
-DIST clamav-0.102.0.tar.gz 13211357 BLAKE2B b3ba01f7ff63dbb4fcba57955b3ea364b56da6b71c01770cb6fabbd48a60cf43935aa0a869ef8d96d8f7adc65c9ebc681d08e87c2e07bc7469584a0d9833a4fd SHA512 7228f5f572e5ca32a458c262a5d297694059de04cb4a64364dd92e1d2e4560d58263d05bfb2053641ea7521c4040bef5a49b3cea27e77b907c95195cf4a54d84
+DIST clamav-0.102.1.tar.gz 13215586 BLAKE2B 653e5506ed0b19c154038e960184abf2773a8a12a775dda81ce4f69fe7e58c457c39d85e24ce43bda9f09f43766c81af69d5462e7459077b0e4886f73a2a5ba2 SHA512 2d0cd2dece771ab8228771f9a95eb0342e756083a0107b2bef31bd2f5f46c36aa692e15d7eb2ea321f535ea4e18c8df043c8663ae350d40fbe1bdb4d073dcb90

diff --git a/app-antivirus/clamav/clamav-0.102.0-r2.ebuild b/app-antivirus/clamav/clamav-0.102.1.ebuild
similarity index 94%
rename from app-antivirus/clamav/clamav-0.102.0-r2.ebuild
rename to app-antivirus/clamav/clamav-0.102.1.ebuild
index e768ec499d0..1236104e6ae 100644
--- a/app-antivirus/clamav/clamav-0.102.0-r2.ebuild
+++ b/app-antivirus/clamav/clamav-0.102.1.ebuild
@@ -43,11 +43,9 @@ DEPEND="${CDEPEND}
 RDEPEND="${CDEPEND}
 	selinux? ( sec-policy/selinux-clamav )"
 
-#DOCS=( docs/UserManual.md docs/UserManual )
-HTML_DOCS=( docs/html )
+HTML_DOCS=( docs/html/. )
 
 PATCHES=(
-	"${FILESDIR}/${PN}-0.102.0-libxml2_pkgconfig.patch" #661328
 	"${FILESDIR}/${PN}-0.101.2-tinfo.patch" #670729
 )
 
@@ -71,15 +69,13 @@ src_configure() {
 	# but that does not work
 	# do not add this, since --disable-xml seems to override
 	# --without-xml
-	JSONUSE=""
+	JSONUSE="--without-libjson"
 
-	if [ use clamsubmit ] || [ use metadata-analysis-api ]; then
+	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=/usr"
-	else
-		JSONUSE="--without-libjson"
+		JSONUSE="--with-libjson=${EPREFIX}/usr"
 	fi
 
 	econf \
@@ -91,7 +87,6 @@ src_configure() {
 		$(use_enable test check) \
 		$(use_with xml) \
 		$(use_with iconv) \
-		$(use_with metadata-analysis-api libjson /usr) \
 		${JSONUSE} \
 		$(use_enable libclamav-only) \
 		--with-system-libmspack \

diff --git a/app-antivirus/clamav/files/clamav-0.102.0-libxml2_pkgconfig.patch b/app-antivirus/clamav/files/clamav-0.102.0-libxml2_pkgconfig.patch
deleted file mode 100644
index 1a6303b5c8c..00000000000
--- a/app-antivirus/clamav/files/clamav-0.102.0-libxml2_pkgconfig.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-https://bugs.gentoo.org/661328
-
---- clamav-0.102.0/m4/reorganization/libs/xml.m4
-+++ clamav-0.102.0/m4/reorganization/libs/xml.m4
-@@ -4,85 +4,29 @@
- [AS_HELP_STRING([--disable-xml], [do not include DMG and XAR support])],
- want_xml=$enableval, want_xml="auto")
- 
--XML_HOME=""
--xmlconfig=""
- if test "X$want_xml" != "Xno"; then
--  AC_MSG_CHECKING([for libxml2 installation])
--  AC_ARG_WITH([xml],
--    AS_HELP_STRING([--with-xml@<:@=DIR@:>@], [path to directory containing libxml2 library
--                    @<:@default=/usr/local or /usr if not found in /usr/local@:>@]),
--    [with_xml_val=$withval]
-+  PKG_CHECK_MODULES([XML], [libxml-2.0],
-+    [found_xml=yes],
-+    [
-+	found_xml=no
-+	AS_IF([test "x$want_xml" = xyes],
-+	    [AC_MSG_ERROR([--enable-xml set but cannot find libxml2])]
-+	)
-+    ]
-   )
- 
--  AS_IF([test "x$with_xml_val" = "xno"], [XML_HOME=""],
--    [test "x$with_xml_val" = "xyes"], [XML_HOME="/usr/local"],
--    [XML_HOME="$with_xml_val"])
--
--  AS_IF([test "x$XML_HOME" != "x"], [
--     AS_IF([test ! -x "$XML_HOME/bin/xml2-config"], [XML_HOME=""])
--     ])
--
--  AS_IF([test "x$XML_HOME" = "x" -a "x$with_xml_val" = "xyes"], [
--     AS_IF([test -x "/usr/bin/xml2-config"], [XML_HOME="/usr"])
--     ])
--
--  if test "x$XML_HOME" != "x"; then
--    AC_MSG_RESULT([$XML_HOME])
--    with_xml="yes"
--  else
--    AC_MSG_RESULT([not found])
--  fi
--
--  found_xml="no"
--  XMLCONF_VERSION=""
--  XML_CPPFLAGS=""
--  XML_LIBS=""
--  case "$with_xml" in
--    yes) AC_PATH_PROG([xmlconfig], [xml2-config])
--        if test "x$xmlconfig" = x ; then
--            AC_MSG_NOTICE([can not locate xml2-config in PATH, will search default XML_HOME variants])
--            
--            if test "x$XML_HOME" != "x"; then
--                AC_MSG_CHECKING([xml2-config version])
--                XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`"
--
--                if test "x%XMLCONF_VERSION" != "x"; then
--                    AC_MSG_RESULT([$XMLCONF_VERSION])
--                    found_xml="yes"
--                    XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`"
--                    XML_LIBS="`$XML_HOME/bin/xml2-config --libs`"
--                    AS_ECHO("$XML_CPPFLAGS")
--                    AS_ECHO("$XML_LIBS")
--                else
--                    AC_MSG_ERROR([xml2-config failed])
--                fi
--            fi
--        else
--            found_xml="yes"
--            XMLCONF_VERSION="`$xmlconfig --version`"
--            XML_CPPFLAGS="`$xmlconfig --cflags`"
--            XML_LIBS="`$xmlconfig --libs`"
--        fi
--  esac
--
-   working_xml="no"
-   if test "X$found_xml" != "Xno"; then
--
--    readerresult=""
--    if test "x$xmlconfig" = x ; then
--        readerresult="$XML_HOME/include/libxml2/libxml/xmlreader.h"
--    else
--        readerresult="`$xmlconfig --prefix`/include/libxml2/libxml/xmlreader.h"
--    fi
--    
-+    XML_HOME=$(${PKG_CONFIG} --variable prefix libxml-2.0)
-     AC_MSG_CHECKING([for xmlreader.h in $readerresult])
-     
--    if test ! -f "$readerresult"; then
-+    if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then
-       AC_MSG_RESULT([not found])
-     else
-       AC_MSG_RESULT([found])
-       save_LIBS="$LIBS"
-       save_CPPFLAGS="$CPPFLAGS"
-+      XML_CPPFLAGS="$XML_CFLAGS"
-       CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
-       save_LDFLAGS="$LDFLAGS"
-       LDFLAGS="$LDFLAGS $XML_LIBS"


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2019-11-25 16:27 Lars Wendler
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Wendler @ 2019-11-25 16:27 UTC (permalink / raw
  To: gentoo-commits

commit:     21602230e4da2f80db97331ac2cfe78051d39395
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 25 16:15:30 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Nov 25 16:27:40 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21602230

app-antivirus/clamav: Revbump to fix various linking issues

- Don't call configure with --with-zlib=/usr or else we end up having
  "-L/usr/lib" in linker flags which breaks 64bit compilations in 17.1
  profiles
- Once again (third time) use pkg-config to check for libxml2 in order
  to avoud automagic and unnecessary linking to dev-libs/icu

Bug: https://bugs.gentoo.org/661328
Closes: https://bugs.gentoo.org/699296
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 ...mav-0.102.1.ebuild => clamav-0.102.1-r1.ebuild} |  41 +++----
 .../files/clamav-0.102.1-libxml2_pkgconfig.patch   | 120 +++++++++++++++++++++
 2 files changed, 143 insertions(+), 18 deletions(-)

diff --git a/app-antivirus/clamav/clamav-0.102.1.ebuild b/app-antivirus/clamav/clamav-0.102.1-r1.ebuild
similarity index 90%
rename from app-antivirus/clamav/clamav-0.102.1.ebuild
rename to app-antivirus/clamav/clamav-0.102.1-r1.ebuild
index a3044a08ef9..2c69d169341 100644
--- a/app-antivirus/clamav/clamav-0.102.1.ebuild
+++ b/app-antivirus/clamav/clamav-0.102.1-r1.ebuild
@@ -48,6 +48,7 @@ HTML_DOCS=( docs/html/. )
 
 PATCHES=(
 	"${FILESDIR}/${PN}-0.101.2-tinfo.patch" #670729
+	"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
 )
 
 pkg_setup() {
@@ -79,25 +80,29 @@ src_configure() {
 		JSONUSE="--with-libjson=${EPREFIX}/usr"
 	fi
 
-	econf \
-		$(use_enable bzip2) \
-		$(use_enable clamdtop) \
-		$(use_enable ipv6) \
-		$(use_enable milter) \
-		$(use_enable static-libs static) \
-		$(use_enable test check) \
-		$(use_with xml) \
-		$(use_with iconv) \
-		${JSONUSE} \
-		$(use_enable libclamav-only) \
-		--with-system-libmspack \
-		--cache-file="${S}"/config.cache \
-		--disable-experimental \
-		--disable-zlib-vcheck \
-		--enable-id-check \
-		--with-dbdir="${EPREFIX}"/var/lib/clamav \
-		--with-zlib="${EPREFIX}"/usr \
+	local myeconfargs=(
+		$(use_enable bzip2)
+		$(use_enable clamdtop)
+		$(use_enable ipv6)
+		$(use_enable milter)
+		$(use_enable static-libs static)
+		$(use_enable test check)
+		$(use_with xml)
+		$(use_with iconv)
+		${JSONUSE}
+		$(use_enable libclamav-only)
+		$(use_with !libclamav-only libcurl)
+		--with-system-libmspack
+		--cache-file="${S}"/config.cache
+		--disable-experimental
+		--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
+	)
+	econf "${myeconfargs[@]}"
 }
 
 src_install() {

diff --git a/app-antivirus/clamav/files/clamav-0.102.1-libxml2_pkgconfig.patch b/app-antivirus/clamav/files/clamav-0.102.1-libxml2_pkgconfig.patch
new file mode 100644
index 00000000000..ea39173c8ba
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.102.1-libxml2_pkgconfig.patch
@@ -0,0 +1,120 @@
+From 25b9fccdae3a05561b6b7c9c82018a9a3dfec819 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Mon, 25 Nov 2019 15:54:09 +0100
+Subject: [PATCH] build: Use pkg-config to find libxml2
+
+Otherwise we get unneccesary linkage to icu and other unwanted stuff
+
+Bug: https://bugzilla.clamav.net/show_bug.cgi?id=12202
+Gentoo-bug: https://bugs.gentoo.org/661328
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ m4/reorganization/libs/xml.m4 | 82 ++++++-----------------------------
+ 1 file changed, 13 insertions(+), 69 deletions(-)
+
+diff --git a/m4/reorganization/libs/xml.m4 b/m4/reorganization/libs/xml.m4
+index 24f0cfa92..d143e3a47 100644
+--- a/m4/reorganization/libs/xml.m4
++++ b/m4/reorganization/libs/xml.m4
+@@ -4,85 +4,29 @@ AC_ARG_ENABLE([xml],
+ [AS_HELP_STRING([--disable-xml], [do not include DMG and XAR support])],
+ want_xml=$enableval, want_xml="auto")
+ 
+-XML_HOME=""
+-xmlconfig=""
+ if test "X$want_xml" != "Xno"; then
+-  AC_MSG_CHECKING([for libxml2 installation])
+-  AC_ARG_WITH([xml],
+-    AS_HELP_STRING([--with-xml@<:@=DIR@:>@], [path to directory containing libxml2 library
+-                    @<:@default=/usr/local or /usr if not found in /usr/local@:>@]),
+-    [with_xml_val=$withval]
+-  )
+-
+-  AS_IF([test "x$with_xml_val" = "xno"], [XML_HOME=""],
+-    [test "x$with_xml_val" = "xyes"], [XML_HOME="/usr/local"],
+-    [XML_HOME="$with_xml_val"])
+-
+-  AS_IF([test "x$XML_HOME" != "x"], [
+-     AS_IF([test ! -x "$XML_HOME/bin/xml2-config"], [XML_HOME=""])
+-     ])
+-
+-  AS_IF([test "x$XML_HOME" = "x" -a "x$with_xml_val" = "xyes"], [
+-     AS_IF([test -x "/usr/bin/xml2-config"], [XML_HOME="/usr"])
+-     ])
+-
+-  if test "x$XML_HOME" != "x"; then
+-    AC_MSG_RESULT([$XML_HOME])
+-    with_xml="yes"
+-  else
+-    AC_MSG_RESULT([not found])
+-  fi
+-
+-  found_xml="no"
+-  XMLCONF_VERSION=""
+-  XML_CPPFLAGS=""
+-  XML_LIBS=""
+-  case "$with_xml" in
+-    yes) AC_PATH_PROG([xmlconfig], [xml2-config])
+-        if test "x$xmlconfig" = x ; then
+-            AC_MSG_NOTICE([can not locate xml2-config in PATH, will search default XML_HOME variants])
+-            
+-            if test "x$XML_HOME" != "x"; then
+-                AC_MSG_CHECKING([xml2-config version])
+-                XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`"
+-
+-                if test "x%XMLCONF_VERSION" != "x"; then
+-                    AC_MSG_RESULT([$XMLCONF_VERSION])
+-                    found_xml="yes"
+-                    XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`"
+-                    XML_LIBS="`$XML_HOME/bin/xml2-config --libs`"
+-                    AS_ECHO("$XML_CPPFLAGS")
+-                    AS_ECHO("$XML_LIBS")
+-                else
+-                    AC_MSG_ERROR([xml2-config failed])
+-                fi
+-            fi
+-        else
+-            found_xml="yes"
+-            XMLCONF_VERSION="`$xmlconfig --version`"
+-            XML_CPPFLAGS="`$xmlconfig --cflags`"
+-            XML_LIBS="`$xmlconfig --libs`"
+-        fi
+-  esac
++    PKG_CHECK_MODULES([XML], [libxml-2.0],
++	[found_xml=yes],
++	[
++	    found_xml=no
++	    AS_IF([test "x$want_xml" = xyes],
++		[AC_MSG_ERROR([--enable-xml set but cannot find libxml2])]
++	    )
++	]
++    )
+ 
+   working_xml="no"
+   if test "X$found_xml" != "Xno"; then
+-
+-    readerresult=""
+-    if test "x$xmlconfig" = x ; then
+-        readerresult="$XML_HOME/include/libxml2/libxml/xmlreader.h"
+-    else
+-        readerresult="`$xmlconfig --prefix`/include/libxml2/libxml/xmlreader.h"
+-    fi
+-    
++    XML_HOME=$(${PKG_CONFIG} --variable prefix libxml-2.0)
+     AC_MSG_CHECKING([for xmlreader.h in $readerresult])
+-    
+-    if test ! -f "$readerresult"; then
++
++    if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then
+       AC_MSG_RESULT([not found])
+     else
+       AC_MSG_RESULT([found])
+       save_LIBS="$LIBS"
+       save_CPPFLAGS="$CPPFLAGS"
++      XML_CPPFLAGS="$XML_CFLAGS"
+       CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+       save_LDFLAGS="$LDFLAGS"
+       LDFLAGS="$LDFLAGS $XML_LIBS"
+-- 
+2.24.0
+


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2020-06-09  1:53 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2020-06-09  1:53 UTC (permalink / raw
  To: gentoo-commits

commit:     948d05626dc945da43baa24204331dd87fe534fb
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  9 01:45:45 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Jun  9 01:45:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=948d0562

app-antivirus/clamav: remove older vulnerable versions.

Bug: https://bugs.gentoo.org/722726
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 app-antivirus/clamav/Manifest                      |   1 -
 app-antivirus/clamav/clamav-0.102.2-r1.ebuild      | 214 --------------------
 app-antivirus/clamav/clamav-0.102.2-r3.ebuild      | 225 ---------------------
 .../files/clamav-0.101.2-libxml2_pkgconfig.patch   |  78 -------
 4 files changed, 518 deletions(-)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index 213281bf6a9..c908a9c0522 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -1,2 +1 @@
-DIST clamav-0.102.2.tar.gz 13227538 BLAKE2B 09d18f507a439f1dd63ebc038b129e0ead75bb344bfad2b5bd36e2c0c76af01f42fcacc60ff40b5676cb5fb7b38b90747452654a5d104b9b7b5e2d5a06b3dc2d SHA512 7db53e0e2b4d6b0e4cf5048d3c9dfbcabcffd680c3a2b718c763b9599b0c1c14e56bae70c54c251ee9e8fd1acd3134657196dbaad2d23a16bad76a088c6fc41f
 DIST clamav-0.102.3.tar.gz 13226108 BLAKE2B 741c0cc6a088ffe880eabb7a59151b3c13c5754f9cb36582ffca9cbeea6b039e3c49b7155ba14fa302e9ee4bfa6adf8b98f0e29f2354ea8569b11b1ed2b2532c SHA512 d239718814b303fb0f1655d9bdaf3675d888eea57e786d927eafabb7b6f58cd7f5fb7dc149511c2af6f800dcc919f2e1d6954110d45b9e16619c632e8d2b37f2

diff --git a/app-antivirus/clamav/clamav-0.102.2-r1.ebuild b/app-antivirus/clamav/clamav-0.102.2-r1.ebuild
deleted file mode 100644
index 8809377758e..00000000000
--- a/app-antivirus/clamav/clamav-0.102.2-r1.ebuild
+++ /dev/null
@@ -1,214 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic systemd
-
-DESCRIPTION="Clam Anti-Virus Scanner"
-HOMEPAGE="https://www.clamav.net/"
-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 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
-IUSE="bzip2 doc clamdtop clamsubmit iconv ipv6 libclamav-only libressl milter metadata-analysis-api selinux static-libs test uclibc xml"
-
-REQUIRED_USE="libclamav-only? ( !clamdtop !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-6 )
-	>=sys-libs/zlib-1.2.2:=
-	bzip2? ( app-arch/bzip2 )
-	clamdtop? ( sys-libs/ncurses:0 )
-	clamsubmit? ( net-misc/curl dev-libs/json-c:= )
-	elibc_musl? ( sys-libs/fts-standalone )
-	iconv? ( virtual/libiconv )
-	!libclamav-only? ( net-misc/curl )
-	!libressl? ( dev-libs/openssl:0= )
-	libressl? ( dev-libs/libressl:0= )
-	milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
-	xml? ( dev-libs/libxml2 )"
-
-BDEPEND="virtual/pkgconfig"
-
-DEPEND="${CDEPEND}
-	metadata-analysis-api? ( dev-libs/json-c:* )
-	test? ( dev-libs/check )"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-clamav )"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-0.101.2-tinfo.patch" #670729
-	"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
-	"${FILESDIR}/${PN}-0.102.2-fix-curl-detection.patch" #709616
-)
-
-src_prepare() {
-	default
-	eautoconf
-}
-
-src_configure() {
-	use elibc_musl && append-ldflags -lfts
-	use ppc64 && append-flags -mminimal-toc
-	use uclibc && export ac_cv_type_error_t=yes
-
-	# 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 clamdtop)
-		$(use_enable ipv6)
-		$(use_enable milter)
-		$(use_enable static-libs static)
-		$(use_enable test check)
-		$(use_with xml)
-		$(use_with iconv)
-		${JSONUSE}
-		$(use_enable libclamav-only)
-		$(use_with !libclamav-only libcurl)
-		--with-system-libmspack
-		--cache-file="${S}"/config.cache
-		--disable-experimental
-		--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
-	)
-	econf "${myeconfargs[@]}"
-}
-
-src_install() {
-	default
-
-	rm -rf "${ED}"/var/lib/clamav || die
-
-	if ! use libclamav-only ; then
-		newinitd "${FILESDIR}"/clamd.initd-r6 clamd
-		newconfd "${FILESDIR}"/clamd.conf-r1 clamd
-
-		systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
-		systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
-		systemd_dounit "${FILESDIR}/clamd.service"
-		systemd_dounit "${FILESDIR}/freshclamd.service"
-
-		insinto /etc/logrotate.d
-		newins "${FILESDIR}"/clamav.logrotate clamav
-
-		# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
-		sed -i -e "s:^\(Example\):\# \1:" \
-			-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
-			-e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
-			-e "s:.*\(User\) .*:\1 clamav:" \
-			-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
-			-e "s:^\#\(LogTime\).*:\1 yes:" \
-			-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
-			-e "s:^\#\(DatabaseDirectory\).*:\1 /var/lib/clamav:" \
-			"${ED}"/etc/clamd.conf.sample || die
-
-		sed -i -e "s:^\(Example\):\# \1:" \
-			-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
-			-e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
-			-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:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
-			-e "s:^\#\(DatabaseDirectory\).*:\1 /var/lib/clamav:" \
-			"${ED}"/etc/freshclam.conf.sample || die
-
-		if use milter ; then
-			# MilterSocket one to include ' /' because there is a 2nd line for
-			# inet: which we want to leave
-			##dodoc "${FILESDIR}"/clamav-milter.README.gentoo
-			sed -i -e "s:^\(Example\):\# \1:" \
-				-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
-				-e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
-				-e "s:.*\(User\) .*:\1 clamav:" \
-				-e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
-				-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
-				-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 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
-
-	elog "For instructions on how to use clamonacc, see"
-	elog
-	elog "  https://www.clamav.net/documents/on-access-scanning"
-}

diff --git a/app-antivirus/clamav/clamav-0.102.2-r3.ebuild b/app-antivirus/clamav/clamav-0.102.2-r3.ebuild
deleted file mode 100644
index e4700595b03..00000000000
--- a/app-antivirus/clamav/clamav-0.102.2-r3.ebuild
+++ /dev/null
@@ -1,225 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic systemd
-
-DESCRIPTION="Clam Anti-Virus Scanner"
-HOMEPAGE="https://www.clamav.net/"
-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 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
-IUSE="bzip2 doc clamdtop clamsubmit iconv ipv6 libclamav-only libressl milter metadata-analysis-api selinux test uclibc xml"
-
-REQUIRED_USE="libclamav-only? ( !clamdtop !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-6 )
-	>=sys-libs/zlib-1.2.2:=
-	bzip2? ( app-arch/bzip2 )
-	clamdtop? ( sys-libs/ncurses:0 )
-	clamsubmit? ( net-misc/curl dev-libs/json-c:= )
-	elibc_musl? ( sys-libs/fts-standalone )
-	iconv? ( virtual/libiconv )
-	!libclamav-only? ( net-misc/curl )
-	!libressl? ( dev-libs/openssl:0= )
-	libressl? ( dev-libs/libressl:0= )
-	metadata-analysis-api? ( dev-libs/json-c:= )
-	milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
-	xml? ( dev-libs/libxml2 )"
-
-BDEPEND="virtual/pkgconfig"
-
-DEPEND="${CDEPEND}
-	test? ( dev-libs/check )"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-clamav )"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-0.101.2-tinfo.patch" #670729
-	"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
-	"${FILESDIR}/${PN}-0.102.2-fix-curl-detection.patch" #709616
-)
-
-src_prepare() {
-	default
-	eautoconf
-
-	if ! use clamsubmit; then
-		# ENABLE_CLAMSUBMIT is defined in the configure script based on
-		# only the values of $have_curl and $have_json (so we have no
-		# easy way to disable it). Here we hack the configure script to
-		# manually set the value of ENABLE_CLAMSUBMIT to something falsy
-		# when USE=clamsubmit is not set. Yes, this looks backwards. The
-		# value '#' is not a boolean indicator, it's a comment character.
-		sed -e "s/ENABLE_CLAMSUBMIT_TRUE=$/ENABLE_CLAMSUBMIT_TRUE='#'/" \
-			-e "s/ENABLE_CLAMSUBMIT_FALSE='#'/ENABLE_CLAMSUBMIT_FALSE=/" \
-			-i configure \
-			|| die 'failed to disable clamsubmit in ./configure script'
-	fi
-}
-
-src_configure() {
-	use elibc_musl && append-ldflags -lfts
-	use ppc64 && append-flags -mminimal-toc
-	use uclibc && export ac_cv_type_error_t=yes
-
-	# 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
-	JSONCONF="--without-libjson"
-
-	if use clamsubmit || use metadata-analysis-api; then
-		# Either of these requires libjson-c.
-		JSONCONF="--with-libjson=${EPREFIX}/usr"
-	fi
-
-	local myeconfargs=(
-		$(use_enable bzip2)
-		$(use_enable clamdtop)
-		$(use_enable ipv6)
-		$(use_enable milter)
-		$(use_enable test check)
-		$(use_with xml)
-		$(use_with iconv)
-		${JSONCONF}
-		$(use_enable libclamav-only)
-		$(use_with !libclamav-only libcurl)
-		--with-system-libmspack
-		--cache-file="${S}"/config.cache
-		--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
-	)
-	econf "${myeconfargs[@]}"
-}
-
-src_install() {
-	default
-
-	rm -rf "${ED}"/var/lib/clamav || die
-
-	if ! use libclamav-only ; then
-		newinitd "${FILESDIR}"/clamd.initd-r6 clamd
-		newconfd "${FILESDIR}"/clamd.conf-r1 clamd
-
-		systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
-		systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
-		systemd_dounit "${FILESDIR}/clamd.service"
-		systemd_dounit "${FILESDIR}/freshclamd.service"
-
-		insinto /etc/logrotate.d
-		newins "${FILESDIR}"/clamav.logrotate clamav
-
-		# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
-		sed -i -e "s:^\(Example\):\# \1:" \
-			-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
-			-e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
-			-e "s:.*\(User\) .*:\1 clamav:" \
-			-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
-			-e "s:^\#\(LogTime\).*:\1 yes:" \
-			-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
-			-e "s:^\#\(DatabaseDirectory\).*:\1 /var/lib/clamav:" \
-			"${ED}"/etc/clamd.conf.sample || die
-
-		sed -i -e "s:^\(Example\):\# \1:" \
-			-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
-			-e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
-			-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:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
-			-e "s:^\#\(DatabaseDirectory\).*:\1 /var/lib/clamav:" \
-			"${ED}"/etc/freshclam.conf.sample || die
-
-		if use milter ; then
-			# MilterSocket one to include ' /' because there is a 2nd line for
-			# inet: which we want to leave
-			##dodoc "${FILESDIR}"/clamav-milter.README.gentoo
-			sed -i -e "s:^\(Example\):\# \1:" \
-				-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
-				-e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
-				-e "s:.*\(User\) .*:\1 clamav:" \
-				-e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
-				-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
-				-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 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
-
-	elog "For instructions on how to use clamonacc, see"
-	elog
-	elog "  https://www.clamav.net/documents/on-access-scanning"
-}

diff --git a/app-antivirus/clamav/files/clamav-0.101.2-libxml2_pkgconfig.patch b/app-antivirus/clamav/files/clamav-0.101.2-libxml2_pkgconfig.patch
deleted file mode 100644
index e1f5bb9b338..00000000000
--- a/app-antivirus/clamav/files/clamav-0.101.2-libxml2_pkgconfig.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-https://bugs.gentoo.org/661328
-
---- clamav-0.101.2/m4/reorganization/libs/xml.m4
-+++ clamav-0.101.2/m4/reorganization/libs/xml.m4
-@@ -4,55 +4,19 @@
- [AS_HELP_STRING([--disable-xml], [do not include DMG and XAR support])],
- want_xml=$enableval, want_xml="auto")
- 
--XML_HOME=""
--if test "X$want_xml" != "Xno"; then
--  AC_MSG_CHECKING([for libxml2 installation])
--  AC_ARG_WITH([xml],
--    AS_HELP_STRING([--with-xml@<:@=DIR@:>@], [path to directory containing libxml2 library
--                    @<:@default=/usr/local or /usr if not found in /usr/local@:>@]),
--    [with_xml_val=$withval]
--  )
--fi
--
--AS_IF([test "x$with_xml_val" = "xno"], [XML_HOME=""],
--  [test "x$with_xml_val" = "xyes"], [XML_HOME="/usr/local"],
--  [XML_HOME="$with_xml_val"])
--
--AS_IF([test "x$XML_HOME" != "x"], [
--   AS_IF([test ! -x "$XML_HOME/bin/xml2-config"], [XML_HOME=""])
--   ])
--
--AS_IF([test "x$XML_HOME" = "x" -a "x$with_xml_val" = "xyes"], [
--   AS_IF([test -x "/usr/bin/xml2-config"], [XML_HOME="/usr"])
--   ])
--
--if test "x$XML_HOME" != "x"; then
--  AC_MSG_RESULT([$XML_HOME])
--else
--  AC_MSG_RESULT([not found])
--fi
--
--found_xml="no"
--XMLCONF_VERSION=""
--XML_CPPFLAGS=""
--XML_LIBS=""
--if test "x$XML_HOME" != "x"; then
--  AC_MSG_CHECKING([xml2-config version])
--  XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`"
--  if test "x%XMLCONF_VERSION" != "x"; then
--    AC_MSG_RESULT([$XMLCONF_VERSION])
--    found_xml="yes"
--    XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`"
--    XML_LIBS="`$XML_HOME/bin/xml2-config --libs`"
--    AS_ECHO("$XML_CPPFLAGS")
--    AS_ECHO("$XML_LIBS")
--  else
--    AC_MSG_ERROR([xml2-config failed])
--  fi
--fi
-+PKG_CHECK_MODULES([XML], [libxml-2.0],
-+	[found_xml=yes],
-+	[
-+		found_xml=no
-+		AS_IF([test "x$want_xml" = xyes],
-+			[AC_MSG_ERROR([--enable-xml set but cannot find libxml2])]
-+		)
-+	]
-+)
- 
- working_xml="no"
- if test "X$found_xml" != "Xno"; then
-+  XML_HOME=$(${PKG_CONFIG} --variable prefix libxml-2.0)
-   AC_MSG_CHECKING([for xmlreader.h in $XML_HOME])
- 
-   if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then
-@@ -61,6 +25,7 @@
-     AC_MSG_RESULT([found])
-     save_LIBS="$LIBS"
-     save_CPPFLAGS="$CPPFLAGS"
-+    XML_CPPFLAGS="$XML_CFLAGS"
-     CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
-     save_LDFLAGS="$LDFLAGS"
-     LDFLAGS="$LDFLAGS $XML_LIBS"


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2020-09-20 19:35 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2020-09-20 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     8038d96958974432777d667fae883516eebad258
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 20 17:08:41 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 19:28:56 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8038d969

app-antivirus/clamav: new version 0.103.0.

New version with lots of good stuff. The main changes are that
on-access scanning is now controlled by USE=clamonacc, and that we
provide separate OpenRC services for the various daemons.

Closes: https://bugs.gentoo.org/272963
Closes: https://bugs.gentoo.org/670729
Closes: https://bugs.gentoo.org/732926
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 app-antivirus/clamav/Manifest                      |   1 +
 app-antivirus/clamav/clamav-0.103.0.ebuild         | 219 ++++++++++
 .../files/clamav-0.103.0-system-tomsfastmath.patch | 115 ++++++
 .../files/clamav-0.103.0-upstream-openrc.patch     | 447 +++++++++++++++++++++
 app-antivirus/clamav/metadata.xml                  |   1 +
 5 files changed, 783 insertions(+)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index fdf9ea6c972..67f7c790109 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -1 +1,2 @@
 DIST clamav-0.102.4.tar.gz 13234444 BLAKE2B 7109da3e2281472032777b8a9d14ca6ff345aead33e5aaf0b9d1ff4721459926062f789dd1f7e8637155e4b9f3bce9f78127bf450f32baf3f1006b8083d3431a SHA512 29893deb8d2d913dff72331875d3dc3a10356bfb254ddfe1c1933b3ea4f8b76c96a1b840f95e72be36cbc0e00b9ec35e395225ef264761f53e709bb1026a4f09
+DIST clamav-0.103.0.tar.gz 13357078 BLAKE2B 6c4b05043f560a56f967642094ba4a9f9bd52268994ac43a99446650a78dafe0ec851b9ebcfe95f3e216fd7942e4756f2e20bda67ca9187e55523fbba9ca56d8 SHA512 e0712ed3c068dc8dab1d31b7cbc19cd69c62875fdcf314abb28e6f42660daf162a3aae69e0a008919e7b809675b68d35f79d3cb98379442bcbc6f5c8ee4313bf

diff --git a/app-antivirus/clamav/clamav-0.103.0.ebuild b/app-antivirus/clamav/clamav-0.103.0.ebuild
new file mode 100644
index 00000000000..16a7129ce1b
--- /dev/null
+++ b/app-antivirus/clamav/clamav-0.103.0.ebuild
@@ -0,0 +1,219 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic systemd
+
+DESCRIPTION="Clam Anti-Virus Scanner"
+HOMEPAGE="https://www.clamav.net/"
+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 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE="bzip2 doc clamonacc clamdtop clamsubmit iconv ipv6 libclamav-only libressl milter metadata-analysis-api selinux test uclibc xml"
+
+REQUIRED_USE="libclamav-only? ( !clamonacc !clamdtop !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-6 )
+	dev-libs/tomsfastmath
+	>=sys-libs/zlib-1.2.2:=
+	bzip2? ( app-arch/bzip2 )
+	clamdtop? ( sys-libs/ncurses:0 )
+	clamsubmit? ( net-misc/curl dev-libs/json-c:= )
+	elibc_musl? ( sys-libs/fts-standalone )
+	iconv? ( virtual/libiconv )
+	!libclamav-only? ( net-misc/curl )
+	!libressl? ( dev-libs/openssl:0= )
+	libressl? ( dev-libs/libressl:0= )
+	milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
+	xml? ( dev-libs/libxml2 )"
+
+BDEPEND="virtual/pkgconfig"
+
+DEPEND="${CDEPEND}
+	metadata-analysis-api? ( dev-libs/json-c:* )
+	test? ( dev-libs/check )"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-clamav )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
+	"${FILESDIR}/${PN}-0.102.2-fix-curl-detection.patch" #709616
+	"${FILESDIR}/${PN}-0.103.0-system-tomsfastmath.patch" # 649394
+	"${FILESDIR}/${PN}-0.103.0-upstream-openrc.patch"
+)
+
+src_prepare() {
+	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
+	use uclibc && export ac_cv_type_error_t=yes
+
+	# 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 clamdtop)
+		$(use_enable ipv6)
+		$(use_enable milter)
+		$(use_enable test check)
+		$(use_with xml)
+		$(use_with iconv)
+		${JSONUSE}
+		$(use_enable libclamav-only)
+		$(use_with !libclamav-only libcurl)
+		--with-system-libmspack
+		--cache-file="${S}"/config.cache
+		--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
+		systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
+		systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
+		systemd_dounit "${FILESDIR}/clamd.service"
+		systemd_dounit "${FILESDIR}/freshclamd.service"
+
+		insinto /etc/logrotate.d
+		newins "${FILESDIR}"/clamav.logrotate clamav
+
+		# 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 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."
+}

diff --git a/app-antivirus/clamav/files/clamav-0.103.0-system-tomsfastmath.patch b/app-antivirus/clamav/files/clamav-0.103.0-system-tomsfastmath.patch
new file mode 100644
index 00000000000..ad9276c1ad0
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.103.0-system-tomsfastmath.patch
@@ -0,0 +1,115 @@
+From 70cc96407302cf0fd4eee2b6a401253ed50fe4df Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sun, 20 Sep 2020 11:16:06 -0400
+Subject: [PATCH 1/1] autotools: use system tomsfastmath if possible.
+
+---
+ configure.ac                           |  2 ++
+ libclamav/Makefile.am                  | 10 ++++++++--
+ libclamav/bignum.h                     |  6 +++++-
+ libclamav/xdp.c                        |  2 +-
+ m4/reorganization/libs/tomsfastmath.m4 | 12 ++++++++++++
+ 5 files changed, 28 insertions(+), 4 deletions(-)
+ create mode 100644 m4/reorganization/libs/tomsfastmath.m4
+
+diff --git a/configure.ac b/configure.ac
+index 8e0e810f8..773787e49 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -104,6 +104,7 @@ m4_include([m4/reorganization/libs/libmspack.m4])
+ if test "x$use_internal_mspack" = "xno"; then
+     mspack_msg="External, $LIBMSPACK_CFLAGS $LIBMSPACK_LIBS"
+ fi
++m4_include([m4/reorganization/libs/tomsfastmath.m4])
+ 
+ AM_MAINTAINER_MODE
+ m4_include([m4/reorganization/libs/libz.m4])
+@@ -376,6 +377,7 @@ fi
+ CL_MSG_STATUS([yara        ],[$enable_yara],[$enable_yara])
+ CL_MSG_STATUS([fts         ],[yes],[$lfs_fts_msg])
+ 
++CL_MSG_STATUS([tomsfastmath],[yes],[$tomsfastmath_msg])
+ 
+ # Yep, downgrading the compiler avoids the bug too:
+ # 4.0.x, and 4.1.0 are the known buggy versions
+diff --git a/libclamav/Makefile.am b/libclamav/Makefile.am
+index ae655cfec..240fa23f8 100644
+--- a/libclamav/Makefile.am
++++ b/libclamav/Makefile.am
+@@ -588,8 +588,10 @@ libclamav_la_SOURCES += yara_arena.c \
+ 	yara_clam.h
+ endif
+ 
+-libclamav_la_SOURCES += bignum.h\
+-	bignum_fast.h\
++libclamav_la_SOURCES += bignum.h
++
++if !SYSTEM_TOMSFASTMATH
++libclamav_la_SOURCES += bignum_fast.h\
+ 	tomsfastmath/addsub/fp_add.c\
+ 	tomsfastmath/addsub/fp_add_d.c\
+ 	tomsfastmath/addsub/fp_addmod.c\
+@@ -671,6 +673,10 @@ libclamav_la_SOURCES += bignum.h\
+ 	tomsfastmath/sqr/fp_sqr_comba_generic.c\
+ 	tomsfastmath/sqr/fp_sqr_comba_small_set.c\
+ 	tomsfastmath/sqr/fp_sqrmod.c
++else
++libclamav_la_CFLAGS += $(TOMSFASTMATH_CFLAGS)
++libclamav_la_LIBADD += $(TOMSFASTMATH_LIBS)
++endif
+ 
+ .PHONY2: version.h.tmp
+ version.c: version.h
+diff --git a/libclamav/bignum.h b/libclamav/bignum.h
+index 8fdc956bb..56dfa957e 100644
+--- a/libclamav/bignum.h
++++ b/libclamav/bignum.h
+@@ -1,9 +1,13 @@
+ #ifndef BIGNUM_H_
+ #define BIGNUM_H_
+ 
++#if HAVE_SYSTEM_TOMSFASTMATH
++#include <tfm.h>
++#else
+ #define TFM_CHECK
+-
+ #include "bignum_fast.h"
++#endif
++
+ typedef fp_int mp_int;
+ #define mp_cmp fp_cmp
+ #define mp_toradix_n(a, b, c, d) fp_toradix_n(a, b, c, d)
+diff --git a/libclamav/xdp.c b/libclamav/xdp.c
+index 87423421d..6370221ff 100644
+--- a/libclamav/xdp.c
++++ b/libclamav/xdp.c
+@@ -52,7 +52,7 @@
+ #include "scanners.h"
+ #include "conv.h"
+ #include "xdp.h"
+-#include "bignum_fast.h"
++#include "bignum.h"
+ #include "filetypes.h"
+ 
+ static char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz);
+diff --git a/m4/reorganization/libs/tomsfastmath.m4 b/m4/reorganization/libs/tomsfastmath.m4
+new file mode 100644
+index 000000000..2a821a14d
+--- /dev/null
++++ b/m4/reorganization/libs/tomsfastmath.m4
+@@ -0,0 +1,12 @@
++dnl Check for system tomsfastmath
++PKG_CHECK_MODULES([TOMSFASTMATH], [tomsfastmath], [have_system_tomsfastmath=yes], [have_system_tomsfastmath=no])
++
++AM_CONDITIONAL([SYSTEM_TOMSFASTMATH], [test "x$have_system_tomsfastmath" = "xyes"])
++
++if test "x$have_system_tomsfastmath" = "xyes"; then
++    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [1], [link against system-wide tomsfastmath library])
++    tomsfastmath_msg="External, $TOMSFASTMATH_CFLAGS $TOMSFASTMATH_LIBS"
++else
++    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [0], [don't link against system-wide tomsfastmath library])
++    tomsfastmath_msg="Internal"
++fi
+-- 
+2.26.2
+

diff --git a/app-antivirus/clamav/files/clamav-0.103.0-upstream-openrc.patch b/app-antivirus/clamav/files/clamav-0.103.0-upstream-openrc.patch
new file mode 100644
index 00000000000..909c965afbe
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.103.0-upstream-openrc.patch
@@ -0,0 +1,447 @@
+diff --git a/Makefile.am b/Makefile.am
+index 12e7fcc28..a3c47e23a 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -52,6 +52,17 @@ nodist_include_HEADERS = clamav-types.h clamav-version.h
+ distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print
+ DISTCLEANFILES = target.h
+ DISTCHECK_CONFIGURE_FLAGS=--enable-milter --disable-clamav --enable-all-jit-targets --enable-llvm=yes --with-system-llvm=no --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) CC="$(CC)" CXX="$(CXX)" YACC="$(YACC)" LEX="$(LEX)" AR="$(AR)" AS="$(AS)"
++
++
++# This command allows us to replace bindir, libdir, etc.
++# within our script and conf file. The example is taken
++# from the autoconf documentation and can be found in the
++# "Installation Directory Variables" section.
++editgnudirs = sed -e 's|@BINDIR[@]|$(bindir)|g' \
++                  -e 's|@SBINDIR[@]|$(sbindir)|g' \
++                  -e 's|@RUNSTATEDIR[@]|$(runstatedir)|g'
++export editgnudirs
++
+ lcov:
+ 	($(MAKE); cd unit_tests; $(MAKE) lcov)
+ quick-check:
+diff --git a/clamav-config.h.in b/clamav-config.h.in
+index d7aff4a3b..ebd8ac256 100644
+--- a/clamav-config.h.in
++++ b/clamav-config.h.in
+@@ -402,6 +402,9 @@
+ /* Use private fts() implementation which is LFS safe */
+ #undef HAVE_SYSTEM_LFS_FTS
+ 
++/* don't link against system-wide tomsfastmath library */
++#undef HAVE_SYSTEM_TOMSFASTMATH
++
+ /* Define to 1 if you have the <sys/cdefs.h> header file. */
+ #undef HAVE_SYS_CDEFS_H
+ 
+diff --git a/clamav-milter/Makefile.am b/clamav-milter/Makefile.am
+index 1ec4afff6..c75c2b4a3 100644
+--- a/clamav-milter/Makefile.am
++++ b/clamav-milter/Makefile.am
+@@ -35,6 +35,27 @@ clamav_milter_SOURCES = \
+ man_MANS = $(top_builddir)/docs/man/clamav-milter.8
+ AM_CFLAGS=@WERR_CFLAGS_MILTER@
+ 
++
++if INSTALL_OPENRC_SERVICES
++
++openrcdir = $(sysconfdir)/init.d
++
++# The next rule allows us to replace @RUNSTATEDIR@ and friends within
++# our OpenRC service scripts. This example is taken from the autoconf
++# documentation in the "Installation Directory Variables" section.
++openrc_SCRIPTS_src = openrc/clamav-milter.in.in
++openrc_SCRIPTS_intermediate = openrc/clamav-milter.in
++nodist_openrc_SCRIPTS = openrc/clamav-milter
++DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
++$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++
++endif
++EXTRA_DIST = $(openrc_SCRIPTS_src)
++
++
+ endif
+ 
+ LIBS = $(top_builddir)/libclamav/libclamav.la $(top_builddir)/shared/libshared.la @CLAMAV_MILTER_LIBS@ @THREAD_LIBS@
+diff --git a/clamav-milter/openrc/clamav-milter.in.in b/clamav-milter/openrc/clamav-milter.in.in
+new file mode 100644
+index 000000000..71053564a
+--- /dev/null
++++ b/clamav-milter/openrc/clamav-milter.in.in
+@@ -0,0 +1,34 @@
++#!/sbin/openrc-run
++
++# Note: the "Foreground" option in clamav-milter.conf MUST
++# be set to "no".
++command="@SBINDIR@/clamav-milter"
++
++# For now, must be manually synchronized with the PidFile
++# variable in clamav-milter.conf.
++#
++# https://bugzilla.clamav.net/show_bug.cgi?id=12595
++#
++pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
++
++depend() {
++  # The milter can successfully launch without clamd, but it's not a
++  # great user experience to have the milter start accepting requests
++  # that it can't process. The "use" dependency below will start clamd
++  # before clamav-milter, so long as clamd is also present this runlevel.
++  use clamd
++}
++
++start_pre() {
++  # This exists to support the (disabled) default MilterSocket setting
++  # within clamav-milter.conf. The "clamav" user and group agree with
++  # the (disabled) default "User" and "MilterSocketGroup" settings.
++  #
++  # Creating this directory is harmless even when a local socket is
++  # not used. In fact, the clamd service that we depend on should
++  # create it as well, to hold its own local socket (if enabled).
++  checkpath --directory \
++           --mode 0755 \
++           --owner clamav:clamav \
++           "@RUNSTATEDIR@/clamav"
++}
+diff --git a/clamd/Makefile.am b/clamd/Makefile.am
+index 12b872b1f..725bc2fc1 100644
+--- a/clamd/Makefile.am
++++ b/clamd/Makefile.am
+@@ -44,6 +44,25 @@ if INSTALL_SYSTEMD_UNITS
+ systemdsystemunit_DATA = clamav-daemon.socket clamav-daemon.service
+ endif
+ 
++if INSTALL_OPENRC_SERVICES
++
++openrcdir = $(sysconfdir)/init.d
++
++# The next rule allows us to replace @RUNSTATEDIR@ and friends within
++# our OpenRC service scripts. This example is taken from the autoconf
++# documentation in the "Installation Directory Variables" section.
++openrc_SCRIPTS_src = openrc/clamd.in.in
++openrc_SCRIPTS_intermediate = openrc/clamd.in
++nodist_openrc_SCRIPTS = openrc/clamd
++DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
++$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++
++endif
++EXTRA_DIST = $(openrc_SCRIPTS_src)
++
+ LIBS = $(top_builddir)/libclamav/libclamav.la $(top_builddir)/shared/libshared.la @CLAMD_LIBS@ @THREAD_LIBS@
+ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface @SSL_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
+ 
+diff --git a/clamd/openrc/clamd.in.in b/clamd/openrc/clamd.in.in
+new file mode 100644
+index 000000000..5d38f9a84
+--- /dev/null
++++ b/clamd/openrc/clamd.in.in
+@@ -0,0 +1,33 @@
++#!/sbin/openrc-run
++
++# Note: the "Foreground" option in clamd.conf must be set to "no"
++command="@SBINDIR@/clamd"
++extra_started_commands="reload"
++
++# For now, must be manually synchronized with the PidFile variable
++# in clamd.conf.
++#
++# https://bugzilla.clamav.net/show_bug.cgi?id=12595
++#
++pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
++
++start_pre() {
++  # This exists to support the (disabled) default LocalSocket setting
++  # within clamd.conf. The "clamav" user and group agree with the
++  # (disabled) default "User" and "LocalSocketGroup" settings in
++  # clamd.conf. And everything here agrees with the
++  # clamav-daemon.socket systemd service.
++  #
++  # Creating this directory is harmless even when a local socket is
++  # not used.
++  checkpath --directory \
++           --mode 0755 \
++           --owner clamav:clamav \
++           "@RUNSTATEDIR@/clamav"
++}
++
++reload() {
++  ebegin "Reloading ${RC_SVCNAME}"
++  "@BINDIR@/clamdscan" --reload
++  eend $?
++}
+diff --git a/clamonacc/Makefile.am b/clamonacc/Makefile.am
+index 181e22056..864a7fc2a 100644
+--- a/clamonacc/Makefile.am
++++ b/clamonacc/Makefile.am
+@@ -56,6 +56,25 @@ if INSTALL_SYSTEMD_UNITS
+ systemdsystemunit_DATA = clamav-clamonacc.service
+ endif
+ 
++if INSTALL_OPENRC_SERVICES
++
++openrcdir = $(sysconfdir)/init.d
++
++# The next rules allow us to replace @RUNSTATEDIR@ and friends within
++# our OpenRC service scripts. This example is taken from the autoconf
++# documentation in the "Installation Directory Variables" section.
++openrc_SCRIPTS_src = openrc/clamonacc.in.in
++openrc_SCRIPTS_intermediate = openrc/clamonacc.in
++nodist_openrc_SCRIPTS = openrc/clamonacc
++DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
++$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++
++endif
++EXTRA_DIST = $(openrc_SCRIPTS_src)
++
+ LIBS = $(top_builddir)/shared/libshared.la $(top_builddir)/libclamav/libclamav.la @CURL_LIBS@ @CLAMONACC_LIBS@ @THREAD_LIBS@
+ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/clamonacc -I$(top_srcdir)/shared -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface @CURL_CPPFLAGS@ @SSL_CPPFLAGS@ @CLAMONACC_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
+ 
+diff --git a/clamonacc/openrc/clamonacc.in.in b/clamonacc/openrc/clamonacc.in.in
+new file mode 100644
+index 000000000..64acf5d83
+--- /dev/null
++++ b/clamonacc/openrc/clamonacc.in.in
+@@ -0,0 +1,12 @@
++#!/sbin/openrc-run
++
++command="@SBINDIR@/clamonacc"
++pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
++
++# clamonacc doesn't support a PID file at the moment, so we
++# run it in the foreground and let OpenRC background it.
++#
++# https://bugzilla.clamav.net/show_bug.cgi?id=12595
++#
++command_args="--foreground"
++command_background=true
+diff --git a/configure.ac b/configure.ac
+index 461342621..773787e49 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -79,6 +79,12 @@ if test "$enable_experimental" = "yes"; then
+   VERSION_SUFFIX="$VERSION_SUFFIX-exp"
+ fi
+ 
++# Autoconf 2.70 will support this, and many distros patch it in,
++# but Autoconf 2.70 hasn't actually been released yet (it's in beta).
++AS_IF([test -z "${runstatedir}"], [runstatedir='${localstatedir}/run'])
++AC_SUBST([runstatedir])
++
++
+ build_configure_args=`echo "$ac_configure_args" | sed -e 's/[\"]//g'`
+ AC_SUBST([BUILD_CONFIGURE_FLAGS], [$build_configure_args])
+ 
+@@ -105,6 +111,7 @@ m4_include([m4/reorganization/libs/libz.m4])
+ m4_include([m4/reorganization/libs/bzip.m4])
+ m4_include([m4/reorganization/libs/unrar.m4])
+ m4_include([m4/reorganization/libs/systemd.m4])
++m4_include([m4/reorganization/libs/openrc.m4])
+ m4_include([m4/reorganization/code_checks/ipv6.m4])
+ m4_include([m4/reorganization/code_checks/dns.m4])
+ m4_include([m4/reorganization/code_checks/fanotify.m4])
+@@ -193,7 +200,10 @@ AC_CONFIG_FILES([
+                  libclamav.pc
+                  platform.h
+                  clamav-types.h
+-                 clamav-version.h])
++                 clamav-version.h
++                 etc/clamd.conf.sample.in
++                 etc/clamav-milter.conf.sample.in
++                 etc/freshclam.conf.sample.in])
+ if test "x$enable_libclamav_only" != "xyes"; then
+     AC_CONFIG_FILES([
+                      clamscan/Makefile
+@@ -203,10 +213,14 @@ if test "x$enable_libclamav_only" != "xyes"; then
+                      clamd/Makefile
+                      clamd/clamav-daemon.service
+                      clamd/clamav-daemon.socket
++                     clamd/openrc/clamd.in
+                      clamdscan/Makefile
+                      clamsubmit/Makefile
++                     clamonacc/openrc/clamonacc.in
+                      clamav-milter/Makefile
++                     clamav-milter/openrc/clamav-milter.in
+                      freshclam/clamav-freshclam.service
++                     freshclam/openrc/freshclam.in
+                      freshclam/Makefile
+                      sigtool/Makefile
+                      clamconf/Makefile
+diff --git a/etc/Makefile.am b/etc/Makefile.am
+index 487c31429..bee68f1d0 100644
+--- a/etc/Makefile.am
++++ b/etc/Makefile.am
+@@ -18,11 +18,31 @@
+ #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ #  MA 02110-1301, USA.
+ 
+-EXTRA_DIST = clamd.conf.sample freshclam.conf.sample clamav-milter.conf.sample
++EXTRA_DIST = clamd.conf.sample.in.in \
++             freshclam.conf.sample.in.in \
++             clamav-milter.conf.sample.in.in
+ CFGINST = @CFGDIR@
+ 
+ sysconf_DATA = clamd.conf.sample freshclam.conf.sample
+ 
++# Custom variable to simplify the "edit" rule below.
++sysconf_DATA_intermediate = clamd.conf.sample.in freshclam.conf.sample.in
++
+ if HAVE_MILTER
+ sysconf_DATA += clamav-milter.conf.sample
++sysconf_DATA_intermediate += clamav-milter.conf.sample.in
+ endif
++
++# Otherwise these don't get cleaned up by "make distclean",
++# even though they are auto-generated.
++DISTCLEANFILES = $(sysconf_DATA) $(sysconf_DATA_intermediate)
++
++# This rule includes EVERY source/intermediate file as a dependency of
++# EVERY output file, which is clearly wrong, but it may be the best we
++# can do without duplication. At least it's the right kind of wrong,
++# and rebuilds too often rather than not often enough.
++$(sysconf_DATA): $(sysconf_DATA_intermediate) $(EXTRA_DIST) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++>>>>>>> ea2f2442b... etc: convert conf files to templates and make @VARIABLE@ substitutions.
+diff --git a/etc/clamav-milter.conf.sample b/etc/clamav-milter.conf.sample.in.in
+similarity index 98%
+rename from etc/clamav-milter.conf.sample
+rename to etc/clamav-milter.conf.sample.in.in
+index bf46b4fc5..c3c5d2000 100644
+--- a/etc/clamav-milter.conf.sample
++++ b/etc/clamav-milter.conf.sample.in.in
+@@ -17,7 +17,7 @@ Example
+ # inet6:port@[hostname|ip-address] - to specify an ipv6 socket
+ #
+ # Default: no default
+-#MilterSocket /tmp/clamav-milter.socket
++#MilterSocket unix:@RUNSTATEDIR@/clamav/clamav-milter.socket
+ #MilterSocket inet:7357
+ 
+ # Define the group ownership for the (unix) milter socket.
+@@ -64,7 +64,7 @@ Example
+ # also owned by root to keep other users from tampering with it.
+ #
+ # Default: disabled
+-#PidFile /var/run/clamav-milter.pid
++#PidFile @RUNSTATEDIR@/clamav-milter.pid
+ 
+ # Optional path to the global temporary directory.
+ # Default: system specific (usually /tmp or /var/tmp).
+@@ -91,6 +91,7 @@ Example
+ # fashion.
+ #
+ # Default: no default
++#ClamdSocket unix:@RUNSTATEDIR@/clamav/clamd.ctl
+ #ClamdSocket tcp:scanner.mydomain:7357
+ 
+ 
+diff --git a/etc/clamd.conf.sample b/etc/clamd.conf.sample.in.in
+similarity index 99%
+rename from etc/clamd.conf.sample
+rename to etc/clamd.conf.sample.in.in
+index 828dd5ad9..0e0ea4b12 100644
+--- a/etc/clamd.conf.sample
++++ b/etc/clamd.conf.sample.in.in
+@@ -74,7 +74,7 @@ Example
+ # It is recommended that the directory where this file is stored is
+ # also owned by root to keep other users from tampering with it.
+ # Default: disabled
+-#PidFile /var/run/clamd.pid
++#PidFile @RUNSTATEDIR@/clamd.pid
+ 
+ # Optional path to the global temporary directory.
+ # Default: system specific (usually /tmp or /var/tmp).
+@@ -93,7 +93,7 @@ Example
+ 
+ # Path to a local socket file the daemon will listen on.
+ # Default: disabled (must be specified by a user)
+-#LocalSocket /tmp/clamd.socket
++#LocalSocket @RUNSTATEDIR@/clamav/clamd.ctl
+ 
+ # Sets the group ownership on the unix socket.
+ # Default: disabled (the primary group of the user running clamd)
+diff --git a/etc/freshclam.conf.sample b/etc/freshclam.conf.sample.in.in
+similarity index 99%
+rename from etc/freshclam.conf.sample
+rename to etc/freshclam.conf.sample.in.in
+index 2f7d14618..3af3a3485 100644
+--- a/etc/freshclam.conf.sample
++++ b/etc/freshclam.conf.sample.in.in
+@@ -51,7 +51,7 @@ Example
+ # It is recommended that the directory where this file is stored is
+ # also owned by root to keep other users from tampering with it.
+ # Default: disabled
+-#PidFile /var/run/freshclam.pid
++#PidFile @RUNSTATEDIR@/freshclam.pid
+ 
+ # By default when started freshclam drops privileges and switches to the
+ # "clamav" user. This directive allows you to change the database owner.
+diff --git a/freshclam/Makefile.am b/freshclam/Makefile.am
+index ab6ac8f1c..6b16b3d3e 100644
+--- a/freshclam/Makefile.am
++++ b/freshclam/Makefile.am
+@@ -32,6 +32,26 @@ if INSTALL_SYSTEMD_UNITS
+ systemdsystemunit_DATA = clamav-freshclam.service
+ endif
+ 
++if INSTALL_OPENRC_SERVICES
++
++openrcdir = $(sysconfdir)/init.d
++
++# The next rule allows us to replace @RUNSTATEDIR@ and friends within
++# our OpenRC service scripts. This example is taken from the autoconf
++# documentation in the "Installation Directory Variables" section.
++openrc_SCRIPTS_src = openrc/freshclam.in.in
++openrc_SCRIPTS_intermediate = openrc/freshclam.in
++nodist_openrc_SCRIPTS = openrc/freshclam
++DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
++$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++
++endif
++EXTRA_DIST = $(openrc_SCRIPTS_src)
++
++
+ AM_CFLAGS=@WERR_CFLAGS@
+ DEFS = @DEFS@
+ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface -I$(top_srcdir)/libfreshclam @CURL_CPPFLAGS@ @SSL_CPPFLAGS@ @FRESHCLAM_CPPFLAGS@ @ZLIB_CFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
+diff --git a/freshclam/openrc/freshclam.in.in b/freshclam/openrc/freshclam.in.in
+new file mode 100644
+index 000000000..9feb73747
+--- /dev/null
++++ b/freshclam/openrc/freshclam.in.in
+@@ -0,0 +1,8 @@
++#!/sbin/openrc-run
++
++command="@BINDIR@/freshclam"
++pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
++
++# Ignore the value of "PidFile" set in freshclam.conf.
++command_args="-p ${pidfile}"
++command_args_background="--daemon"
+diff --git a/m4/reorganization/libs/openrc.m4 b/m4/reorganization/libs/openrc.m4
+new file mode 100644
+index 000000000..1a73d1589
+--- /dev/null
++++ b/m4/reorganization/libs/openrc.m4
+@@ -0,0 +1,8 @@
++dnl Should we install our OpenRC service files?
++AC_ARG_ENABLE([openrc],
++              AS_HELP_STRING([--enable-openrc],
++                             [Install OpenRC service files]),
++              [],
++              [enable_openrc=no])
++AM_CONDITIONAL(INSTALL_OPENRC_SERVICES,
++               [test "x$enable_openrc" = "xyes"])

diff --git a/app-antivirus/clamav/metadata.xml b/app-antivirus/clamav/metadata.xml
index 5433359bc41..f00c88d870a 100644
--- a/app-antivirus/clamav/metadata.xml
+++ b/app-antivirus/clamav/metadata.xml
@@ -6,6 +6,7 @@
     <name>Gentoo Antivirus Project</name>
   </maintainer>
   <use>
+    <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>
     <flag name="libclamav-only">Bypass building of libfreshclam and the ClamAV CLI applications.</flag>


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2020-09-23  3:34 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2020-09-23  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     124e3a9de085193aaed33e1394db2c8bdecfcf2f
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 22 15:45:22 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Wed Sep 23 03:23:24 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=124e3a9d

app-antivirus/clamav: update freshclamd.service for v0.103.0.

Our freshclam systemd service was wonky: by default, freshclam when
launched as root will drop privileges to the "clamav" user. Since our
systemd service is type=forking, it doesn't need to be launched as the
unprivileged user. And, since we're specifying a PID file, launching
as root means that the PID file directory (now /run) does not need to
be writable by the "clamav" user. All fixed in an -r1 of the service.

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 app-antivirus/clamav/clamav-0.103.0.ebuild       |  3 ++-
 app-antivirus/clamav/files/freshclamd.service-r1 | 10 ++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/app-antivirus/clamav/clamav-0.103.0.ebuild b/app-antivirus/clamav/clamav-0.103.0.ebuild
index f5e3d508cf5..4217bc62b77 100644
--- a/app-antivirus/clamav/clamav-0.103.0.ebuild
+++ b/app-antivirus/clamav/clamav-0.103.0.ebuild
@@ -129,7 +129,8 @@ src_install() {
 			dotmpfiles "${FILESDIR}/tmpfiles.d/clamav.conf"
 			systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
 			systemd_dounit "${FILESDIR}/clamd.service"
-			systemd_dounit "${FILESDIR}/freshclamd.service"
+			systemd_newunit "${FILESDIR}/freshclamd.service-r1" \
+							"freshclamd.service"
 		fi
 
 		insinto /etc/logrotate.d

diff --git a/app-antivirus/clamav/files/freshclamd.service-r1 b/app-antivirus/clamav/files/freshclamd.service-r1
new file mode 100644
index 00000000000..fa1e0139ddd
--- /dev/null
+++ b/app-antivirus/clamav/files/freshclamd.service-r1
@@ -0,0 +1,10 @@
+[Unit]
+Description=clamav updater
+
+[Service]
+Type=forking
+PIDFile=/run/freshclam.pid
+ExecStart=/usr/bin/freshclam -d -p /run/freshclam.pid
+
+[Install]
+WantedBy=multi-user.target


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2020-09-23  3:34 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2020-09-23  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     76622421052176c051df0c19a518d6c064aa5e5e
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 22 13:24:36 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Wed Sep 23 03:23:24 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76622421

app-antivirus/clamav: new logrotate files for v0.103.0.

Now that each ClamAV daemon has its own OpenRC service, we
separate the logrotate entries as well. This fixes an old
bug where we relied on the service manager being OpenRC.

Closes: https://bugs.gentoo.org/508520
Closes: https://bugs.gentoo.org/709780
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 app-antivirus/clamav/clamav-0.103.0.ebuild         |  5 ++++-
 app-antivirus/clamav/files/clamav-milter.logrotate | 25 ++++++++++++++++++++++
 app-antivirus/clamav/files/clamd.logrotate         | 17 +++++++++++++++
 app-antivirus/clamav/files/freshclam.logrotate     | 17 +++++++++++++++
 4 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/app-antivirus/clamav/clamav-0.103.0.ebuild b/app-antivirus/clamav/clamav-0.103.0.ebuild
index 9a1d28f8920..f5e3d508cf5 100644
--- a/app-antivirus/clamav/clamav-0.103.0.ebuild
+++ b/app-antivirus/clamav/clamav-0.103.0.ebuild
@@ -133,7 +133,10 @@ src_install() {
 		fi
 
 		insinto /etc/logrotate.d
-		newins "${FILESDIR}"/clamav.logrotate clamav
+		newins "${FILESDIR}/clamd.logrotate" clamd
+		newins "${FILESDIR}/freshclam.logrotate" freshclam
+		use milter && \
+			newins "${FILESDIR}/clamav-milter.logrotate" clamav-milter
 
 		# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
 		sed -i -e "s:^\(Example\):\# \1:" \

diff --git a/app-antivirus/clamav/files/clamav-milter.logrotate b/app-antivirus/clamav/files/clamav-milter.logrotate
new file mode 100644
index 00000000000..24782df604b
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-milter.logrotate
@@ -0,0 +1,25 @@
+# This script is intended to rotate the logs for clamav-milter in its
+# default configuration on Gentoo, where clamav-milter writes to its
+# own log file but does not rotate that file itself. The clamav-milter
+# daemon is capable of rotating its own logs; if you have "LogRotate
+# yes" in clamav-milter.conf then you do not need this script (and
+# should disable it). Likewise, if you are logging to syslog
+# (LogSyslog yes), this is redundant.
+#
+# This is more complicated than the clamd/freshclam scripts because
+# the milter doesn't yet reopen its log files when it receives a
+# SIGHUP. See https://bugzilla.clamav.net/show_bug.cgi?id=12615
+# for that. Instead we have to attempt OpenRC/systemd service
+# restarts on (only) the machines that support them.
+/var/log/clamav/clamav-milter.log {
+  su clamav clamav
+  missingok
+  postrotate
+    if command -v rc-service 2>/dev/null; then
+      rc-service clamav-milter status 2>/dev/null 1>&2 && rc-service clamav-milter restart 1>/dev/null
+    fi
+    if command -v systemctl 2>/dev/null; then
+      systemctl try-restart clamav-milter
+    fi
+  endscript
+}

diff --git a/app-antivirus/clamav/files/clamd.logrotate b/app-antivirus/clamav/files/clamd.logrotate
new file mode 100644
index 00000000000..68ee9b36166
--- /dev/null
+++ b/app-antivirus/clamav/files/clamd.logrotate
@@ -0,0 +1,17 @@
+# This script is intended to rotate the logs for clamd in its default
+# configuration on Gentoo, where clamd writes to its own log file but
+# does not rotate that file itself. The clamd daemon is capable of
+# rotating its own logs; if you have "LogRotate yes" in clamd.conf
+# then you do not need this script (and should disable it). Likewise,
+# if you are logging to syslog (LogSyslog yes), this is redundant.
+/var/log/clamav/clamd.log {
+  su clamav clamav
+  missingok
+  postrotate
+    if test -f /run/clamd.pid; then
+      /bin/kill -HUP $(cat /run/clamd.pid)
+    else
+      true
+    fi
+  endscript
+}

diff --git a/app-antivirus/clamav/files/freshclam.logrotate b/app-antivirus/clamav/files/freshclam.logrotate
new file mode 100644
index 00000000000..ba6b5de3ba1
--- /dev/null
+++ b/app-antivirus/clamav/files/freshclam.logrotate
@@ -0,0 +1,17 @@
+# This script is intended to rotate the logs for freshclam in its default
+# configuration on Gentoo, where freshclam writes to its own log file but
+# does not rotate that file itself. The freshclam daemon is capable of
+# rotating its own logs; if you have "LogRotate yes" in freshclam.conf
+# then you do not need this script (and should disable it). Likewise,
+# if you are logging to syslog (LogSyslog yes), this is redundant.
+/var/log/clamav/freshclam.log {
+  su clamav clamav
+  missingok
+  postrotate
+    if test -f /run/freshclam.pid; then
+      /bin/kill -HUP $(cat /run/freshclam.pid)
+    else
+      true
+    fi
+  endscript
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2021-02-09 19:48 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2021-02-09 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     a57654340b90fcb0004be856e63943244415e64d
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  9 19:45:38 2021 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Feb  9 19:46:29 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5765434

app-antivirus/clamav: new upstream version 0.103.1.

Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 app-antivirus/clamav/Manifest                      |  2 +-
 ...mav-0.103.0-r2.ebuild => clamav-0.103.1.ebuild} |  5 +-
 .../clamav-0.103.0-freshclam-db-test-fix.patch     | 27 --------
 ....patch => clamav-0.103.1-upstream-openrc.patch} | 79 ++++++++++++++++------
 4 files changed, 60 insertions(+), 53 deletions(-)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index 67f7c790109..2fad2fc449e 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -1,2 +1,2 @@
 DIST clamav-0.102.4.tar.gz 13234444 BLAKE2B 7109da3e2281472032777b8a9d14ca6ff345aead33e5aaf0b9d1ff4721459926062f789dd1f7e8637155e4b9f3bce9f78127bf450f32baf3f1006b8083d3431a SHA512 29893deb8d2d913dff72331875d3dc3a10356bfb254ddfe1c1933b3ea4f8b76c96a1b840f95e72be36cbc0e00b9ec35e395225ef264761f53e709bb1026a4f09
-DIST clamav-0.103.0.tar.gz 13357078 BLAKE2B 6c4b05043f560a56f967642094ba4a9f9bd52268994ac43a99446650a78dafe0ec851b9ebcfe95f3e216fd7942e4756f2e20bda67ca9187e55523fbba9ca56d8 SHA512 e0712ed3c068dc8dab1d31b7cbc19cd69c62875fdcf314abb28e6f42660daf162a3aae69e0a008919e7b809675b68d35f79d3cb98379442bcbc6f5c8ee4313bf
+DIST clamav-0.103.1.tar.gz 13369791 BLAKE2B 974716a17e67240ef606b074584a1ac344f1d5915347aaa02b388570ea543981433c482423b99f5d07054bdf4dce8a0d043afdd52b42d49ace468f3d801c3353 SHA512 f13e9542898ef42c0db6f7826bcb220b9cb57de2a88bfedc6c991b76ff06c59290522d31119132eaa2093da58c5069d63103f6260e271497bda2b472c3cd6ffb

diff --git a/app-antivirus/clamav/clamav-0.103.0-r2.ebuild b/app-antivirus/clamav/clamav-0.103.1.ebuild
similarity index 98%
rename from app-antivirus/clamav/clamav-0.103.0-r2.ebuild
rename to app-antivirus/clamav/clamav-0.103.1.ebuild
index 1ebe1bd96d9..6829a29906a 100644
--- a/app-antivirus/clamav/clamav-0.103.0-r2.ebuild
+++ b/app-antivirus/clamav/clamav-0.103.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -54,8 +54,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
 	"${FILESDIR}/${PN}-0.102.2-fix-curl-detection.patch" #709616
 	"${FILESDIR}/${PN}-0.103.0-system-tomsfastmath.patch" # 649394
-	"${FILESDIR}/${PN}-0.103.0-upstream-openrc.patch"
-	"${FILESDIR}/${PN}-0.103.0-freshclam-db-test-fix.patch"
+	"${FILESDIR}/${PN}-0.103.1-upstream-openrc.patch"
 )
 
 src_prepare() {

diff --git a/app-antivirus/clamav/files/clamav-0.103.0-freshclam-db-test-fix.patch b/app-antivirus/clamav/files/clamav-0.103.0-freshclam-db-test-fix.patch
deleted file mode 100644
index 25ae94b9fb8..00000000000
--- a/app-antivirus/clamav/files/clamav-0.103.0-freshclam-db-test-fix.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/freshclam/freshclam.c b/freshclam/freshclam.c
-index 8db3b8001..8cde8c9a8 100644
---- a/freshclam/freshclam.c
-+++ b/freshclam/freshclam.c
-@@ -280,6 +280,14 @@ fc_error_t download_complete_callback(const char *dbFilename, void *context)
-                 goto done;
-             }
-         } else {
-+            /*
-+             * Attempt to test database in a child process.
-+             */
-+
-+            /* We need to be able to wait for the child process ourselves.
-+             * We'll re-enable wait in the global handler when we're done. */
-+            g_sigchildWait = 0;
-+
-             switch (pid = fork()) {
-                 case -1: {
-                     /*
-@@ -391,6 +399,7 @@ done:
-         logg("!Database test FAILED.\n");
-     }
- 
-+    /* Re-enable the global handler's child process wait */
-     g_sigchildWait = 1;
- 
-     return status;

diff --git a/app-antivirus/clamav/files/clamav-0.103.0-upstream-openrc.patch b/app-antivirus/clamav/files/clamav-0.103.1-upstream-openrc.patch
similarity index 86%
rename from app-antivirus/clamav/files/clamav-0.103.0-upstream-openrc.patch
rename to app-antivirus/clamav/files/clamav-0.103.1-upstream-openrc.patch
index a7676f0ab82..a37d44fa934 100644
--- a/app-antivirus/clamav/files/clamav-0.103.0-upstream-openrc.patch
+++ b/app-antivirus/clamav/files/clamav-0.103.1-upstream-openrc.patch
@@ -1,5 +1,37 @@
+From 7d7ca4f425909368cd78cd587120703754bcd608 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Tue, 9 Feb 2021 14:24:09 -0500
+Subject: [PATCH 1/1] Add OpenRC service scripts integrated with the build
+ system.
+
+---
+ Makefile.am                                   | 11 ++++++
+ clamav-milter/Makefile.am                     | 21 ++++++++++++
+ clamav-milter/openrc/clamav-milter.in.in      | 34 +++++++++++++++++++
+ clamd/Makefile.am                             | 19 +++++++++++
+ clamd/openrc/clamd.in.in                      | 33 ++++++++++++++++++
+ clamonacc/Makefile.am                         | 19 +++++++++++
+ clamonacc/openrc/clamonacc.in.in              | 18 ++++++++++
+ configure.ac                                  | 16 ++++++++-
+ etc/Makefile.am                               | 22 +++++++++++-
+ ...sample => clamav-milter.conf.sample.in.in} |  5 +--
+ ...md.conf.sample => clamd.conf.sample.in.in} |  4 +--
+ ...onf.sample => freshclam.conf.sample.in.in} |  2 +-
+ freshclam/Makefile.am                         | 20 +++++++++++
+ freshclam/openrc/freshclam.in.in              |  8 +++++
+ m4/reorganization/libs/openrc.m4              |  8 +++++
+ 15 files changed, 233 insertions(+), 7 deletions(-)
+ create mode 100644 clamav-milter/openrc/clamav-milter.in.in
+ create mode 100644 clamd/openrc/clamd.in.in
+ create mode 100644 clamonacc/openrc/clamonacc.in.in
+ rename etc/{clamav-milter.conf.sample => clamav-milter.conf.sample.in.in} (98%)
+ rename etc/{clamd.conf.sample => clamd.conf.sample.in.in} (99%)
+ rename etc/{freshclam.conf.sample => freshclam.conf.sample.in.in} (99%)
+ create mode 100644 freshclam/openrc/freshclam.in.in
+ create mode 100644 m4/reorganization/libs/openrc.m4
+
 diff --git a/Makefile.am b/Makefile.am
-index 12e7fcc28..a3c47e23a 100644
+index 42a58e7..c4d82ad 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -52,6 +52,17 @@ nodist_include_HEADERS = clamav-types.h clamav-version.h
@@ -21,7 +53,7 @@ index 12e7fcc28..a3c47e23a 100644
  	($(MAKE); cd unit_tests; $(MAKE) lcov)
  quick-check:
 diff --git a/clamav-milter/Makefile.am b/clamav-milter/Makefile.am
-index 1ec4afff6..c75c2b4a3 100644
+index 38d9b94..46885a7 100644
 --- a/clamav-milter/Makefile.am
 +++ b/clamav-milter/Makefile.am
 @@ -35,6 +35,27 @@ clamav_milter_SOURCES = \
@@ -54,7 +86,7 @@ index 1ec4afff6..c75c2b4a3 100644
  LIBS = $(top_builddir)/libclamav/libclamav.la $(top_builddir)/shared/libshared.la @CLAMAV_MILTER_LIBS@ @THREAD_LIBS@
 diff --git a/clamav-milter/openrc/clamav-milter.in.in b/clamav-milter/openrc/clamav-milter.in.in
 new file mode 100644
-index 000000000..71053564a
+index 0000000..7105356
 --- /dev/null
 +++ b/clamav-milter/openrc/clamav-milter.in.in
 @@ -0,0 +1,34 @@
@@ -93,7 +125,7 @@ index 000000000..71053564a
 +           "@RUNSTATEDIR@/clamav"
 +}
 diff --git a/clamd/Makefile.am b/clamd/Makefile.am
-index 12b872b1f..725bc2fc1 100644
+index c161586..b59d94c 100644
 --- a/clamd/Makefile.am
 +++ b/clamd/Makefile.am
 @@ -44,6 +44,25 @@ if INSTALL_SYSTEMD_UNITS
@@ -124,7 +156,7 @@ index 12b872b1f..725bc2fc1 100644
  
 diff --git a/clamd/openrc/clamd.in.in b/clamd/openrc/clamd.in.in
 new file mode 100644
-index 000000000..5d38f9a84
+index 0000000..5d38f9a
 --- /dev/null
 +++ b/clamd/openrc/clamd.in.in
 @@ -0,0 +1,33 @@
@@ -162,10 +194,10 @@ index 000000000..5d38f9a84
 +  eend $?
 +}
 diff --git a/clamonacc/Makefile.am b/clamonacc/Makefile.am
-index 181e22056..864a7fc2a 100644
+index 4cb4886..39c2e5d 100644
 --- a/clamonacc/Makefile.am
 +++ b/clamonacc/Makefile.am
-@@ -56,6 +56,25 @@ if INSTALL_SYSTEMD_UNITS
+@@ -58,6 +58,25 @@ if INSTALL_SYSTEMD_UNITS
  systemdsystemunit_DATA = clamav-clamonacc.service
  endif
  
@@ -193,7 +225,7 @@ index 181e22056..864a7fc2a 100644
  
 diff --git a/clamonacc/openrc/clamonacc.in.in b/clamonacc/openrc/clamonacc.in.in
 new file mode 100644
-index 000000000..844cd49dd
+index 0000000..844cd49
 --- /dev/null
 +++ b/clamonacc/openrc/clamonacc.in.in
 @@ -0,0 +1,18 @@
@@ -216,7 +248,7 @@ index 000000000..844cd49dd
 +  need clamd
 +}
 diff --git a/configure.ac b/configure.ac
-index 7b2a777d4..8e0e810f8 100644
+index 33e252e..c8cd60f 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -79,6 +79,12 @@ if test "$enable_experimental" = "yes"; then
@@ -232,7 +264,7 @@ index 7b2a777d4..8e0e810f8 100644
  build_configure_args=`echo "$ac_configure_args" | sed -e 's/[\"]//g'`
  AC_SUBST([BUILD_CONFIGURE_FLAGS], [$build_configure_args])
  
-@@ -104,6 +110,7 @@ m4_include([m4/reorganization/libs/libz.m4])
+@@ -105,6 +111,7 @@ m4_include([m4/reorganization/libs/libz.m4])
  m4_include([m4/reorganization/libs/bzip.m4])
  m4_include([m4/reorganization/libs/unrar.m4])
  m4_include([m4/reorganization/libs/systemd.m4])
@@ -240,7 +272,7 @@ index 7b2a777d4..8e0e810f8 100644
  m4_include([m4/reorganization/code_checks/ipv6.m4])
  m4_include([m4/reorganization/code_checks/dns.m4])
  m4_include([m4/reorganization/code_checks/fanotify.m4])
-@@ -192,7 +199,10 @@ AC_CONFIG_FILES([
+@@ -193,7 +200,10 @@ AC_CONFIG_FILES([
                   libclamav.pc
                   platform.h
                   clamav-types.h
@@ -250,9 +282,9 @@ index 7b2a777d4..8e0e810f8 100644
 +                 etc/clamav-milter.conf.sample.in
 +                 etc/freshclam.conf.sample.in])
  if test "x$enable_libclamav_only" != "xyes"; then
-     AC_CONFIG_FILES([
-                      clamscan/Makefile
-@@ -202,10 +212,14 @@ if test "x$enable_libclamav_only" != "xyes"; then
+     if test "$have_curl" = "no"; then
+         AC_MSG_ERROR([libcurl not found. libcurl (e.g. libcurl-devel) is required in order to build freshclam and clamsubmit.])
+@@ -207,10 +217,14 @@ if test "x$enable_libclamav_only" != "xyes"; then
                       clamd/Makefile
                       clamd/clamav-daemon.service
                       clamd/clamav-daemon.socket
@@ -268,7 +300,7 @@ index 7b2a777d4..8e0e810f8 100644
                       sigtool/Makefile
                       clamconf/Makefile
 diff --git a/etc/Makefile.am b/etc/Makefile.am
-index 487c31429..bee68f1d0 100644
+index c694856..213a978 100644
 --- a/etc/Makefile.am
 +++ b/etc/Makefile.am
 @@ -18,11 +18,31 @@
@@ -303,12 +335,12 @@ index 487c31429..bee68f1d0 100644
 +	rm -f $@ $@.tmp
 +	$(editgnudirs) $@.in > $@.tmp
 +	mv $@.tmp $@
-+>>>>>>> ea2f2442b... etc: convert conf files to templates and make @VARIABLE@ substitutions.
++
 diff --git a/etc/clamav-milter.conf.sample b/etc/clamav-milter.conf.sample.in.in
 similarity index 98%
 rename from etc/clamav-milter.conf.sample
 rename to etc/clamav-milter.conf.sample.in.in
-index bf46b4fc5..c3c5d2000 100644
+index bf46b4f..c3c5d20 100644
 --- a/etc/clamav-milter.conf.sample
 +++ b/etc/clamav-milter.conf.sample.in.in
 @@ -17,7 +17,7 @@ Example
@@ -341,7 +373,7 @@ diff --git a/etc/clamd.conf.sample b/etc/clamd.conf.sample.in.in
 similarity index 99%
 rename from etc/clamd.conf.sample
 rename to etc/clamd.conf.sample.in.in
-index 828dd5ad9..0e0ea4b12 100644
+index a1ca9ec..82ef42c 100644
 --- a/etc/clamd.conf.sample
 +++ b/etc/clamd.conf.sample.in.in
 @@ -74,7 +74,7 @@ Example
@@ -366,7 +398,7 @@ diff --git a/etc/freshclam.conf.sample b/etc/freshclam.conf.sample.in.in
 similarity index 99%
 rename from etc/freshclam.conf.sample
 rename to etc/freshclam.conf.sample.in.in
-index 2f7d14618..3af3a3485 100644
+index 8f4dd49..5a5c42b 100644
 --- a/etc/freshclam.conf.sample
 +++ b/etc/freshclam.conf.sample.in.in
 @@ -51,7 +51,7 @@ Example
@@ -379,7 +411,7 @@ index 2f7d14618..3af3a3485 100644
  # By default when started freshclam drops privileges and switches to the
  # "clamav" user. This directive allows you to change the database owner.
 diff --git a/freshclam/Makefile.am b/freshclam/Makefile.am
-index ab6ac8f1c..6b16b3d3e 100644
+index 9e48119..46ef224 100644
 --- a/freshclam/Makefile.am
 +++ b/freshclam/Makefile.am
 @@ -32,6 +32,26 @@ if INSTALL_SYSTEMD_UNITS
@@ -411,7 +443,7 @@ index ab6ac8f1c..6b16b3d3e 100644
  AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface -I$(top_srcdir)/libfreshclam @CURL_CPPFLAGS@ @SSL_CPPFLAGS@ @FRESHCLAM_CPPFLAGS@ @ZLIB_CFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
 diff --git a/freshclam/openrc/freshclam.in.in b/freshclam/openrc/freshclam.in.in
 new file mode 100644
-index 000000000..9feb73747
+index 0000000..9feb737
 --- /dev/null
 +++ b/freshclam/openrc/freshclam.in.in
 @@ -0,0 +1,8 @@
@@ -425,7 +457,7 @@ index 000000000..9feb73747
 +command_args_background="--daemon"
 diff --git a/m4/reorganization/libs/openrc.m4 b/m4/reorganization/libs/openrc.m4
 new file mode 100644
-index 000000000..1a73d1589
+index 0000000..1a73d15
 --- /dev/null
 +++ b/m4/reorganization/libs/openrc.m4
 @@ -0,0 +1,8 @@
@@ -437,3 +469,6 @@ index 000000000..1a73d1589
 +              [enable_openrc=no])
 +AM_CONDITIONAL(INSTALL_OPENRC_SERVICES,
 +               [test "x$enable_openrc" = "xyes"])
+-- 
+2.26.2
+


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2021-10-16 12:26 Thomas Raschbacher
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Raschbacher @ 2021-10-16 12:26 UTC (permalink / raw
  To: gentoo-commits

commit:     5d5f8b5e7069bae69c6158f83bf3f581f9244a84
Author:     Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 16 12:24:19 2021 +0000
Commit:     Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
CommitDate: Sat Oct 16 12:26:00 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d5f8b5e

app-antivirus/clamav: new version (new build system and USE flags)

Closes: https://bugs.gentoo.org/811498
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Thomas Raschbacher <lordvan <AT> gentoo.org>

 app-antivirus/clamav/Manifest                      |   1 +
 app-antivirus/clamav/clamav-0.104.0.ebuild         | 210 +++++++++++++++++++++
 .../files/clamav-0.104.0-ncurses_detection.patch   |  27 +++
 app-antivirus/clamav/files/clamav-milter.initd     |  34 ++++
 .../clamav/files/clamav-milter.service-0.104.0     |  13 ++
 app-antivirus/clamav/files/clamd.initd             |  33 ++++
 .../clamav/files/clamd_at.service-0.104.0          |  12 ++
 app-antivirus/clamav/files/clamonacc.initd         |  18 ++
 app-antivirus/clamav/files/freshclam.initd         |   8 +
 app-antivirus/clamav/metadata.xml                  |   2 +
 10 files changed, 358 insertions(+)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index 8705b5f2668..48eb3537bac 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -1 +1,2 @@
 DIST clamav-0.103.3.tar.gz 13389239 BLAKE2B 1846cceed39fbd48fcf973d05a57901cf6f9ccdbb4d7eae501e712d84ab4d0a662e4477696aa6a1446116db85a89603428d7092a55e18f7acb805016d3cd5431 SHA512 c2ee24a6f63735c064140aa5baa347d51e8240b2f7eced3480d05435202aedd481fa7057fd40ecbc2e93a62fe8b0cefb574d8accdf9acede643ffbe0d396686f
+DIST clamav-0.104.0.tar.gz 11896747 BLAKE2B c3ca32c1277052301a8bff94fec66a2df8f589bc9a673a00d0f45aaf9d8fd23e8bb87dde787d4188a6318d6677c3364e377ccec16d8e44667430713ce7e2a78d SHA512 7a052e6310ef92068acc384d10a64eed6d54d2d408d203dab92defbb1a276e8a193a2096a8028c8982323ba0be83d25602f026aeffa056878ce36aa325c0046c

diff --git a/app-antivirus/clamav/clamav-0.104.0.ebuild b/app-antivirus/clamav/clamav-0.104.0.ebuild
new file mode 100644
index 00000000000..2869e22a678
--- /dev/null
+++ b/app-antivirus/clamav/clamav-0.104.0.ebuild
@@ -0,0 +1,210 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS=cmake
+inherit cmake 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"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE="doc clamonacc clamapp libclamav-only milter rar selinux systemd test uclibc"
+
+REQUIRED_USE="libclamav-only? ( !clamonacc !clamapp !milter )
+			  clamonacc? ( clamapp )
+			  milter? ( clamapp )"
+
+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
+	>=sys-libs/zlib-1.2.2:=
+	app-arch/bzip2
+	clamapp? ( sys-libs/ncurses:0 net-misc/curl dev-libs/json-c:= )
+	elibc_musl? ( sys-libs/fts-standalone )
+	virtual/libiconv
+	!libclamav-only? ( net-misc/curl )
+	dev-libs/openssl:0=
+	milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
+	dev-libs/libxml2
+	rar? ( app-arch/unrar )
+	test? ( dev-python/pytest )"
+# TODO: there is no way to use this with the new build system instead of the bundled one
+#	dev-libs/tomsfastmath
+
+BDEPEND=">=dev-util/cmake-3.14
+	virtual/pkgconfig"
+
+DEPEND="${CDEPEND}
+	clamapp? ( dev-libs/json-c:* )
+	test? ( dev-libs/check )"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-clamav )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.104.0-ncurses_detection.patch"
+)
+
+src_configure() {
+	use elibc_musl && append-ldflags -lfts
+	use ppc64 && append-flags -mminimal-toc
+	use uclibc && export ac_cv_type_error_t=yes
+
+	local mycmakeargs=(
+		-DDATABASE_DIRECTORY="${EPREFIX}"/var/lib/clamav
+		-DAPP_CONFIG_DIRECTORY="${EPREFIX}"/etc/clamav
+		-DENABLE_EXPERIMENTAL=OFF
+		-DENABLE_JSON_SHARED=ON
+		-DENABLE_APP=$(usex clamapp ON OFF)
+		-DENABLE_MILTER=$(usex milter ON OFF)
+		-DENABLE_CLAMONACC=$(usex clamonacc ON OFF)
+		-DCLAMAV_USER="clamav"
+		-DCLAMAV_GROUP="clamav"
+		-DBYTECODE_RUNTIME=interpreter
+		-DOPTIMIZE=ON
+		-DENABLE_EXTERNAL_MSPACK=ON
+		-DENABLE_MAN_PAGES=ON
+		-DENABLE_UNRAR=$(usex rar ON OFF)
+		-DENABLE_TESTS=$(usex test ON OFF)
+		-DENABLE_STATIC_LIB=OFF
+		-DENABLE_SHARED_LIB=ON
+		-DENABLE_SYSTEMD=$(usex systemd ON OFF)
+	)
+	cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+
+	# init scripts
+	newinitd "${FILESDIR}/clamd.initd" clamd
+	newinitd "${FILESDIR}/freshclam.initd" freshclam
+	use clamonacc && \
+		newinitd "${FILESDIR}/clamonacc.initd" clamonacc
+	use milter && \
+		newinitd "${FILESDIR}/clamav-milter.initd" clamav-milter
+
+	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
+			# upstream OpenRC service files should (and do) ensure that
+			# the directories they need exist and have the correct
+			# permissions without the help of opentmpfiles. There are
+			# years-old root exploits in opentmpfiles, the design is
+			# fundamentally flawed, and the maintainer is not up to
+			# the task of fixing it.
+			dotmpfiles "${FILESDIR}/tmpfiles.d/clamav.conf"
+			systemd_newunit "${FILESDIR}/clamd_at.service-0.104.0" "clamd@.service"
+			systemd_dounit "${FILESDIR}/clamd.service"
+			systemd_newunit "${FILESDIR}/freshclamd.service-r1" \
+							"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!
+			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
+
+		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."
+}

diff --git a/app-antivirus/clamav/files/clamav-0.104.0-ncurses_detection.patch b/app-antivirus/clamav/files/clamav-0.104.0-ncurses_detection.patch
new file mode 100644
index 00000000000..aa403a90bab
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.104.0-ncurses_detection.patch
@@ -0,0 +1,27 @@
+From cd99490efb82b66c75e92fab3ff97c480bfc9cf9 Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero@gentoo.org>
+Date: Sat, 16 Oct 2021 10:56:22 +0200
+Subject: [PATCH] Use all the link line from ncurses pkg-config
+
+Otherwise it would fail at link time if ncurses has a stand alone tinfo library.
+---
+ cmake/FindCURSES.cmake | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/cmake/FindCURSES.cmake b/cmake/FindCURSES.cmake
+index 35d4a570f6..528211c45c 100644
+--- a/cmake/FindCURSES.cmake
++++ b/cmake/FindCURSES.cmake
+@@ -58,11 +58,7 @@ if(NCURSES_NOT_FOUND EQUAL -1)
+     set(HAVE_LIBNCURSES 1)
+     set(CURSES_INCLUDE "<ncurses.h>")
+ 
+-    find_library(CURSES_LIBRARY
+-      NAMES ncurses
+-      PATHS ${PC_NCurses_LIBRARY_DIRS}
+-    )
+-
++    set(CURSES_LIBRARY ${PC_NCurses_LINK_LIBRARIES})
+     set(CURSES_VERSION ${PC_NCurses_VERSION})
+ 
+     include(FindPackageHandleStandardArgs)

diff --git a/app-antivirus/clamav/files/clamav-milter.initd b/app-antivirus/clamav/files/clamav-milter.initd
new file mode 100755
index 00000000000..049d908155d
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-milter.initd
@@ -0,0 +1,34 @@
+#!/sbin/openrc-run
+
+# Note: the "Foreground" option in clamav-milter.conf MUST
+# be set to "no".
+command="/usr/sbin/clamav-milter"
+
+# For now, must be manually synchronized with the PidFile
+# variable in clamav-milter.conf.
+#
+# https://bugzilla.clamav.net/show_bug.cgi?id=12595
+#
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+  # The milter can successfully launch without clamd, but it's not a
+  # great user experience to have the milter start accepting requests
+  # that it can't process. The "use" dependency below will start clamd
+  # before clamav-milter, so long as clamd is also present this runlevel.
+  use clamd
+}
+
+start_pre() {
+  # This exists to support the (disabled) default MilterSocket setting
+  # within clamav-milter.conf. The "clamav" user and group agree with
+  # the (disabled) default "User" and "MilterSocketGroup" settings.
+  #
+  # Creating this directory is harmless even when a local socket is
+  # not used. In fact, the clamd service that we depend on should
+  # create it as well, to hold its own local socket (if enabled).
+  checkpath --directory \
+           --mode 0755 \
+           --owner clamav:clamav \
+           "/run/clamav"
+}

diff --git a/app-antivirus/clamav/files/clamav-milter.service-0.104.0 b/app-antivirus/clamav/files/clamav-milter.service-0.104.0
new file mode 100644
index 00000000000..68acf0695ce
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-milter.service-0.104.0
@@ -0,0 +1,13 @@
+[Unit]
+Description=Milter module for the ClamAV scanner
+After=nss-lookup.target network.target
+Before=sendmail.service
+Before=postfix.service
+
+[Service]
+Type=forking
+PIDFile=/run/clamav/clamav-milter.pid
+ExecStart=/usr/sbin/clamav-milter -c /etc/clamav/clamav-milter.conf
+
+[Install]
+WantedBy=multi-user.target

diff --git a/app-antivirus/clamav/files/clamd.initd b/app-antivirus/clamav/files/clamd.initd
new file mode 100755
index 00000000000..efc01efc41b
--- /dev/null
+++ b/app-antivirus/clamav/files/clamd.initd
@@ -0,0 +1,33 @@
+#!/sbin/openrc-run
+
+# Note: the "Foreground" option in clamd.conf must be set to "no"
+command="/usr/sbin/clamd"
+extra_started_commands="reload"
+
+# For now, must be manually synchronized with the PidFile variable
+# in clamd.conf.
+#
+# https://bugzilla.clamav.net/show_bug.cgi?id=12595
+#
+pidfile="/run/${RC_SVCNAME}.pid"
+
+start_pre() {
+  # This exists to support the (disabled) default LocalSocket setting
+  # within clamd.conf. The "clamav" user and group agree with the
+  # (disabled) default "User" and "LocalSocketGroup" settings in
+  # clamd.conf. And everything here agrees with the
+  # clamav-daemon.socket systemd service.
+  #
+  # Creating this directory is harmless even when a local socket is
+  # not used.
+  checkpath --directory \
+           --mode 0755 \
+           --owner clamav:clamav \
+           "/run/clamav"
+}
+
+reload() {
+  ebegin "Reloading ${RC_SVCNAME}"
+  "/usr/bin/clamdscan" --reload
+  eend $?
+}

diff --git a/app-antivirus/clamav/files/clamd_at.service-0.104.0 b/app-antivirus/clamav/files/clamd_at.service-0.104.0
new file mode 100644
index 00000000000..5ab51e7fccf
--- /dev/null
+++ b/app-antivirus/clamav/files/clamd_at.service-0.104.0
@@ -0,0 +1,12 @@
+[Unit]
+Description=clamd scanner (%i) daemon
+After=nss-lookup.target network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/clamd -c /etc/clamav/clamd%i.conf
+Restart=on-failure
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target

diff --git a/app-antivirus/clamav/files/clamonacc.initd b/app-antivirus/clamav/files/clamonacc.initd
new file mode 100755
index 00000000000..f625707b171
--- /dev/null
+++ b/app-antivirus/clamav/files/clamonacc.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+command="/usr/sbin/clamonacc"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+# clamonacc doesn't support a PID file at the moment, so we
+# run it in the foreground and let OpenRC background it.
+#
+# https://bugzilla.clamav.net/show_bug.cgi?id=12595
+#
+command_args="--foreground"
+command_background=true
+
+depend() {
+  # Unlike the milter, the on-access scanner will simply fail to start
+  # until clamd is available.
+  need clamd
+}

diff --git a/app-antivirus/clamav/files/freshclam.initd b/app-antivirus/clamav/files/freshclam.initd
new file mode 100755
index 00000000000..415d94a8766
--- /dev/null
+++ b/app-antivirus/clamav/files/freshclam.initd
@@ -0,0 +1,8 @@
+#!/sbin/openrc-run
+
+command="/usr/bin/freshclam"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+# Ignore the value of "PidFile" set in freshclam.conf.
+command_args="-p ${pidfile}"
+command_args_background="--daemon"

diff --git a/app-antivirus/clamav/metadata.xml b/app-antivirus/clamav/metadata.xml
index 799ee7cad29..4c41e164aee 100644
--- a/app-antivirus/clamav/metadata.xml
+++ b/app-antivirus/clamav/metadata.xml
@@ -12,12 +12,14 @@
   </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="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>
     <flag name="libclamav-only">Bypass building of libfreshclam and the ClamAV CLI applications.</flag>
     <flag name="metadata-analysis-api">Enables collection of file property metadata using ClamAV API for analysis by ClamAV bytecode programs.</flag>
     <flag name="xml">DMG and XAR support</flag>
+    <flag name="rar">RAR support</flag>
   </use>
   <upstream>
     <remote-id type="sourceforge">clamav</remote-id>


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2022-12-05 21:03 Thomas Raschbacher
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Raschbacher @ 2022-12-05 21:03 UTC (permalink / raw
  To: gentoo-commits

commit:     4b3a0e7da98fb460ea241a7482ba2d7a9136f4c0
Author:     Matt Jolly <Matt.Jolly <AT> footclan <DOT> ninja>
AuthorDate: Tue Nov 29 23:03:01 2022 +0000
Commit:     Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
CommitDate: Mon Dec  5 21:03:31 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b3a0e7d

app-antivirus/clamav: add 1.0.0

Signed-off-by: Matt Jolly <Matt.Jolly <AT> footclan.ninja>
Signed-off-by: Thomas Raschbacher <lordvan <AT> gentoo.org>

 app-antivirus/clamav/Manifest                      |  10 +
 app-antivirus/clamav/clamav-1.0.0.ebuild           | 384 +++++++++++++++++++++
 .../clamav/files/clamav-1.0.0-select-python.patch  |  44 +++
 3 files changed, 438 insertions(+)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index 994668bb47eb..c0ab6d3b24bd 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -1,5 +1,6 @@
 DIST adler-1.0.2.crate 12778 BLAKE2B a1dc17786adae945ac09d3525e609ed944e6465690787bbb831a1b9d53793cba1989793d0a5606d5d23ee20d36457923d451b1b3530c9ec7072a487aa3e55bbd SHA512 7ab190d31890fc05b0b55d8e2c6527a505e06793d5496be0b3831e0513412f9ba97f8148f6f68ed0770fa9cd980a5092d885e058becf1d5506b7c74b82674aa1
 DIST aho-corasick-0.7.19.crate 113070 BLAKE2B 5ddaa0d415d19cf9922b5723bf3480750634ea68cb66fd05bfa2bf57607eb6383ba86d8c55f70adb87b71b98caa73d8f6ebd075c006493530c81979032899b60 SHA512 0d63d29079650bde4e8a9f8529716b9d8c42db076a1d74715116240c2628173f1e86fb29c08a25ad07a0148e48789ab20de0c186a8b3dfb193cbfeb0d76ae78c
+DIST aho-corasick-0.7.20.crate 111440 BLAKE2B 3f5d54fea2793ce1c2c4d5b3049b910f45a5721e7538cb2557df63dc3069ab3f6b66aceb5e9a48f21c43ae29778fd045428ea103b2a6de81659e605e30e64ca6 SHA512 ad31f3d1b3fe41e593d4ca7e721bbad62936f2e6a17fd1e0997353edb6fc906d1bef2b79f0ac7c7676abe637bbabb23ff22059947be379a2441011f8178983c5
 DIST ansi_term-0.12.1.crate 24838 BLAKE2B f636772c34e2d68cda7b8d3b2b86abda074585a62bd2654812ce92384244655a9197fa66e6939e19a674c0148ca605313d83de262bb18c2339a8a4eb4438a791 SHA512 b840e28b3e7700689a69a39659b1e066560078dd4a58326b91a028915819e7af883399ee53e920db68fd974c58d35bb1ddf8d427af5937d5f696f57c4376b671
 DIST atty-0.2.14.crate 5470 BLAKE2B 2db856a9e898a430258f059aeaf7c844a153293e8856d90ac81f7d91a888c89198768ad5cb09303c23241fe85c560a55148fa56a303651a82b0edb895616bfab SHA512 d7b6c4b9a0f898d91ddbc41a5ee45bbf45d1d269508c8cc87ee3e3990500e41e0ec387afb1f3bc7db55bedac396dd86c6509f4bf9e5148d809c3802edcc5e1d9
 DIST autocfg-1.1.0.crate 13272 BLAKE2B 7724055c337d562103f191f4e36cab469e578f0c51cc24d33624dea155d108a07578703766341fd6a4cc1ef52acda406e7dba1650d59115f18261281e5b40203 SHA512 df972c09abbdc0b6cb6bb55b1e29c7fed706ece38a62613d9e275bac46a19574a7f96f0152cccb0239efea04ee90083a146b58b15307696c4c81878cd12de28f
@@ -18,6 +19,7 @@ DIST clamav-0.103.7.tar.gz 16501741 BLAKE2B 49fc1c8c42ee8168dbaec4aa13ab0dfef7fa
 DIST clamav-0.104.4.tar.gz 12027448 BLAKE2B e8627b49b46e9bf5669b7186d829fd2caa76d9071b1533da252fea1bdeed1b78ec4a138db8957b0d121df1180eb37a6230f5f0db1e4d3f2de80bf7dddad5b47e SHA512 5aa8abe96ff49548cf74df47a7e56279c3082dc8ca98cab02f64f44b2da0230e75b5f634b3086ba8ca155052cbc22a2a47ab3dd159ae033d3f599dcde1f2420e
 DIST clamav-0.105.1.tar.gz 29467856 BLAKE2B be46d9afd76fb536d7de7363a45d38fef6a5983011e3cd0dcc25c2a209c8d37a2bbe1f7f4a5694152cabf622ef83e072b892ae12ba404da1955bb5b654e5216d SHA512 dcaa3eb90e5a8951f1750f0676791c33507206ae0d58a3da0d07f6f86b559799db09a4aed83fbd9d3eed8f1f17654f8304070e6770ba7e02de6f2be2cda65bec
 DIST clamav-1.0.0-rc2.tar.gz 10316876 BLAKE2B 038ca2924d88e20c2bfef8147098f6c281d9fd3de80252a3084705402e77ccea0e124c2e48f9dc56bcd91410a4fa9c07431e48737e3105518581b297ee67127e SHA512 f3e07a079eb3aea2159502f0a431b69a63b2b33d8ccbf8926207519059755644ca2abbe240e68d0a6bc704f5dbe2443c58ad2f343a58f1551e6e7204e1d45076
+DIST clamav-1.0.0.tar.gz 10311477 BLAKE2B 8d66c03e7717ed52cb90a139f565abe2ed3379e09d500530c260f129f1f8eb2549dca11898f6c1a85e7988ce06388c8967e6decea06c840220ffccb4010add60 SHA512 a1be526516e622fd3359461db7dd8eb0734f7ba8ecb0b63c1574e216885cd7bcdc69ffdbc5e507a0060d23769e3caa8423aa273ec57bb86e40049679a818152a
 DIST clang-sys-1.4.0.crate 38679 BLAKE2B d15bdae2142ed26b4f6bd037bd2062e8c4b7b87fc5b749b872a95ff1952d000066c255aa0984e5f9c4a5c88066db4a20cfd048db4ba5a59b331d5ffa5e9a281d SHA512 062189bb0a341e2e85de4987f4b564c1fc69e4005c9c42cfedb61dee5f48db9126a8114d1d97be1b9c21b8c885243751232fbe8cf532e1d2be593308fe45216a
 DIST clap-2.34.0.crate 202210 BLAKE2B f383adf1d757ac4b68995132b33837686ce451f85a02a8d05d2c746da398510d05d46330f3efade063c3952aacb1754cdac73dd0afcae0df5340a89f9353aa1c SHA512 c648a761b9996a7e7464a538bb53621bae22090b846a42c3b729beca3363958ae67e3da9f93f58b10a10e043cadf7ff930388680d168646178c2824177832db8
 DIST color_quant-1.1.0.crate 6649 BLAKE2B 9a2488dd00b7a33e15e05531ea49ef1961131f0be0922ba41e2d74d2b1a047daed483ac3a9dd87c847a81cce70a347395c557cad8228ab9a8dc5be7cc0f1bcaa SHA512 690c928bda4b7b57425f38ea68ac89cde2473b7a91b7e62c04a8f2c5a0fa3505e26b065d48b7ad0a8bb491f92f600f896fefdad3ce0e86e43cbf4f9a89e94201
@@ -26,7 +28,9 @@ DIST crc32fast-1.3.2.crate 38661 BLAKE2B ce3762b03d24d5367d89738991c060f4b3af784
 DIST crossbeam-channel-0.5.6.crate 90292 BLAKE2B 7da87ab15c384754d2493dd1a30e83550cd4b2b749b7f0c24de131f054e3a2e521e1bb4ba10094378c8f4c7bdf19218e35b10562c50b4ad1d2871bf6f821e488 SHA512 de6a42ffede95750a13e3b9af6ab26cbc498125860cd8e4d227c7361bd831e558254a48bdef5cf901585a915003071b0efa321f2011f282218c364780f62f44a
 DIST crossbeam-deque-0.8.2.crate 21237 BLAKE2B f00948fe90806fcbf1585c0404250dc84bca2cf27733bf7f2a0aa957e618f916162f41124333329a5b1e84909cbae3d93fb3b4461ab23e9dd97672c7d520d5b7 SHA512 a50a878d843d6eb1b5b92321ce6bfb87a23d3c16e820b1ff55472f0bd3d29b41d09ea95e1b9ccb2790f6687c043dd9ada1cd5124705e24292ccbd8fae1f243b3
 DIST crossbeam-epoch-0.9.11.crate 47900 BLAKE2B 2deb54409587df48e0686731dded6600816e4c2b82369c47fd2e00ecd59f29935cb3e7f9bf3457b99831bea088830a625370c4c07ce56cb78ccdc62a6ad7715c SHA512 3fff7ebe038993af5117460e0ff89318541afea8d16f3bb991cd37f9fabff58f1cf122a8163af03c275af4ba6802b264f516fbf12f9a9f8ec978f0f8024187a8
+DIST crossbeam-epoch-0.9.13.crate 48313 BLAKE2B 6e548cd39fb400732dc179c5b7185555bdb8a367b5d3a27dcabe9ad36db6e9858604dee210fe487de8f9127fd6d0db1ef1fd04a1cc8cdcf34bedcf980c048555 SHA512 a4578e0e535f301b73f0332778e79b327bafea6afa43284317fccc49b410118360866a2dea8ac22f2977f309d07c663e5d95fbfa852ab795d414c170ee4e06bf
 DIST crossbeam-utils-0.8.12.crate 41785 BLAKE2B 486aaa80eb0fff5740690d8a63c7b41dd06c19cd141f4e12c8f133f5ffa93a121d4e24e19390851051ef07ba63480d9ce3bf751621ada3a420ab6982a0445e28 SHA512 0e1f17887615b1883c3a0c4f0fb908999d550bd0041e8333eebbe43a964838d948fc1e5892e4ebd31e59ad53e5fbb5ebf6741dc1dd8b61907429f691c84de2d2
+DIST crossbeam-utils-0.8.14.crate 42127 BLAKE2B 3e31e6371e46aba6697501a34e1b737680dcb692c0d1ba7cc1ce7025ec70ee69f7595e3abd90fb52c11e42cb43fa5fae6103f97add35cf87b0a68ea83213d0d0 SHA512 fa00a57c41c9daa152f8a6c6f4d3c77986de1aa21585984adf577e244c2f121db014ba2beb92241590e1cf78710e77d9a703ce4a4d44d8854bc3e60690151393
 DIST crunchy-0.2.2.crate 2995 BLAKE2B 74ddf8c5e0deb2ceab65c20a2743e1230739ac6aa3af60c9e867a7852270697a1278b7dee00df8949fc4268f9756a4a098df1211ab3b3e31a122652c3ba0a6fb SHA512 36dc0aebc41a3aac5f1b178a7e61b65bcd9bb5c8539b2024f79428200f7c62daa7098af55c6ab0765febd2f8969bd6c0ac8096f73cdc0958e5c4e4eb6a4f7025
 DIST crypto-common-0.1.6.crate 8760 BLAKE2B f2422bfb89c15d47a8f91c8f6695e05eb56990a922e3cdf3d426044736f9932324c0d899a151a6df4d6683e6a6b21659c657d3988734014c02cd854bb4b924e7 SHA512 471dbc43f517089d2cfe0868e29510c6ca579875b3bb5d013c70796db969b609b6c4bb35c9a07b9a2917012dc5708b717d48e317a20038adbe7e7039bf3ada6f
 DIST digest-0.10.6.crate 19527 BLAKE2B 402009105a6ac055be062769dd4f162aabb977b9afe29f451eeb3e6b5dd1a579c371c5ec996b9c1bdba3b4ded83830ed2e1934a0505480bffba1e0d16775a8f7 SHA512 21d3c1dc64e640300c51e8a009af464d6e3cd2b10aa67c87a038165c11409d6e5faad1967236724a9a4cab8fdd88826cac1db4798245fd53ac2ff1a9b2b68b76
@@ -35,6 +39,7 @@ DIST env_logger-0.9.3.crate 33291 BLAKE2B ab0f0f85771bbdc6c7709f7cd4c86d9eaf436b
 DIST exr-1.5.2.crate 238855 BLAKE2B 586a8697adc788a23e4c6e4d7bb8f97e28b58cc59267bd7154b1690beec580413f8d4c623264fa1a75ec572182c5576b15bc038631611f9c4589e425acc5d2f1 SHA512 2d9f651c13a13adcb19e5b7c90b1c40cfe2bd1dde7e842aac3cf5f2f337a6fa642dd3cc36be4466f18686b209de802c6fc480981fc6784d8d17e9eca91903d0b
 DIST fastrand-1.8.0.crate 11369 BLAKE2B 93e911ffcec559e30b2fefa44c4d74d1ffa9b8ef1904ace608b8576210bcd41a2b4c7adffc00cd3bb40996110d07316cf8068f4754a879c6cb47e3d41304d406 SHA512 82cbc2b29b97fa3fa2c9372d3e8c390586a7b39f6c7d8c45f9b779bdfdaa2e8a3b44bc7bfcb3367c18120726facc753c9827cf63a8fb4ddc2667509b16333cb1
 DIST flate2-1.0.24.crate 70191 BLAKE2B f5ff04557dd0a57151b4c704cce60622157be4c847fb0a42eeb5a9d531ba28d34b41632bc1b34d2f935ab576f152479f72877dc4e6b296edf125becc6e6d52b2 SHA512 8faf97c28dcc4553f4880295677b1269b4acbc6518d006913d32d7e319990c6631e10f1baf7199b96e03f6de95b9e2de04502522bb1eb45bc301a0fbb0bfc0c5
+DIST flate2-1.0.25.crate 70210 BLAKE2B 992525ffeeb4433a222487cdfb0c3927ad77f914e1db94f612d80e81faef4a2c955c755c2b800251e3416d0b22726d5f7d7e432a81c3582c54b7de95ab7a324e SHA512 d81a463360ee2778f609ff297e04548120d1fda1f9e020fb2f429ea51189b8fe6cae57252fcd924d71fb65ad0f93ff7cdc7235913f8b78fa82925939cf884af7
 DIST flume-0.10.14.crate 65389 BLAKE2B c88deea78a5713728a6b6a94a4aaef570f6eee1af85fc489534d7b336a9ec9cfdd76890929a456a689ac196bef24cee68efadb30e06ad585063c5bb77fb2699f SHA512 ad31351031683453b77d85a89812304d63a12cce8bbd31dfaa508091cec52bc511739d4d13a085aa8bf9f2438fc1876a99f2e4ab2602bdbfe0d2ebb1df4eab0f
 DIST futures-core-0.3.25.crate 14623 BLAKE2B efc97e52dd0aeee34402018897a276a68cf94bf13fe37b4c0e4d971cc2dbc8cdf54d0744f0846049ff75192c0fcba906b3556f000fa8657f89a54d9356f8f578 SHA512 3b3c758c493255024df26a763023a5d403fcf1a9fd105b08c518bdd5891ada4fddfcbfc8cde6101157a209ab6d1555831bfeb49372b17e902b4fdd8a83cded4b
 DIST futures-sink-0.3.25.crate 7854 BLAKE2B af109917de26c608b21d2fd1be304428a6d78095168a0b14eb709136789acda0a6bee4332802c3fa3f1e65ad9057e765b43728b8aa6ebd6bebeb2f25d5f96adc SHA512 fc318461bcec3344c0658135944ce7ebf6756c9d1950c2c5e3ab3ddc7d4ef5b0f0858d09f14d7bbc9a9fec7da19236a10dec0e125e5550c965bae95255eb0089
@@ -63,6 +68,7 @@ DIST lock_api-0.4.9.crate 25685 BLAKE2B 8adf5c3cccebdf6aff6ec977f230cd2a208b0b18
 DIST log-0.4.17.crate 38028 BLAKE2B b46be3719fc0a53e50b1f342762e188587e9f1ceb692c72473ce2663edfb8253742d30024e68c1444780ab7fc0e2d5b0601b8ea7228dc3405a9342a57548e605 SHA512 2477d88db42b1d92c30708d88823212e236f613b3465e85eb425f83f8d16fadfaf0352f06c2999a1852102edd2f6ffb10ecb539d8a3b6c48f552a25622ccffa2
 DIST memchr-2.5.0.crate 65812 BLAKE2B 57966413a1f933dcb2d2d4ccb29c247070f65a83299b2a9f5aa83f5a48a5c5f1c4c7c632fa63bd19f9508e9291e7258db2f16e2813a56fd84e0856f70f1e67ab SHA512 444a163b484c233e78c0e2e4d51f01ce2da93d7d29f516a95e4b0866b20bdfd3f34137653abed53eb70387991ee3e2b5937d8d4360a85bbcb50a93005a75defa
 DIST memoffset-0.6.5.crate 7686 BLAKE2B 9a797388702389076c426052c3d54dc62802d5db8bc5c9c83990429f2ffaec4fab4c7dd3f09cd0704d1ea555e87976563bb43408ba54b5e66ce7e406d4604009 SHA512 11bdd9185b99dfee8e659e051b09ee301c7142a372a8117864745a5085c015436d2efbb1478192886f09cbc562529e209d2e3325d94938a64bc75b1d91d2bf3f
+DIST memoffset-0.7.1.crate 8556 BLAKE2B 1ef270f1c8dba32e66cf47a1835f10c342024762c0e56953f16e82d575250028154054d4c42b1324c60f955a40fad3bbb1c5fced147c11c9a4ad62f6f0e948c3 SHA512 40ca3c4b1fb929bec75bfcde0135037f81a6c5aa80181bc7dd7bbcd9c0946288eea8d23fca95e296567ccb02155ed0f66c7c23644b5cb3e6d3932be9f9742157
 DIST minimal-lexical-0.2.1.crate 94841 BLAKE2B e6b8919b80d938d0b98d60d4f5f29ce43d77ebfcf8b18bde08909141915c6ef4f0d07a543538d4f3ba8527a9f55926d4a8e83473248469d087e80b274d701d61 SHA512 385fab51884bdcc7b0f2728a219ab164d0dc8efe42160b918f2c09f79ecf853fb12bda006d11e649f097bae1499dcd41ddf2a8784ee7d178cf2c28059e46078c
 DIST miniz_oxide-0.5.4.crate 53485 BLAKE2B 8836697bdc3707f89fa869e6b09a36ee4d83ce2ae0a53bc7b06bbad70ed7ac25f8f67d841f3f611f6756d891f0eddb0abf7fcaf87570f8ab32220f113583ea6d SHA512 589dac16ca9c2f94e6fa92b68bcf51d140f46562cbb3a1b791b75c59feae51da5ec16042604bbd6bcb7d7f0c7f75e98ea1af8cf42d177133a5eaa86429cf3114
 DIST miniz_oxide-0.6.2.crate 54536 BLAKE2B 8127ebec5a2cee1c2101d9533da573e01ef1a0fcb169bb0fb1419973ddd2e6953d8dfe85f9509a5d1226643ad290f0ee1479fc68f1788ade7ddf9633d90bfe1e SHA512 250782e214572acdd11df87c2788cd5f78e8388d9b285d0a850918219678e262e8b9905cc88728f5b70d13920ef9d19c43d243dad8fbcc18f8c8462662ce1419
@@ -94,8 +100,11 @@ DIST ryu-1.0.11.crate 47007 BLAKE2B d03e8df69c3b21c1b2e4ffa91ece794f141e9f9bce4e
 DIST scoped_threadpool-0.1.9.crate 7800 BLAKE2B b6f887c1af054666ab7f717dfdafe5701bbc0a778169d885a1837202d4d215970af567ea620c6ef47db69fa664c6be65c782aa87d9efc1d9c8c280b6210e38f1 SHA512 df8034b347fb489735895d75e5489c264aea1b50f46a8dd512963df05cb9ba9274317b26aeca63b9b4edcf792e796659bad435ad3f3446cb397340e2bf0a5f33
 DIST scopeguard-1.1.0.crate 11470 BLAKE2B f774eb90b7d3ffb2efba47518e9d1dead4017ab4b38a4bd74914daa84a5af4bf9eb63da0496e3924499d79cd0439c37447aeda4a21226f95645bddcd6becfabe SHA512 368fa5726df8f42b599993681579a9ffd0196480ee3cd0f9f671e8493f3bedd1e1779bdf2beb329e77e0005fa09b816e3385f309490c0f2781568db275d4d17d
 DIST serde-1.0.147.crate 76697 BLAKE2B 90fb2df19ad225c96a30cf88dea82a5785bb110f256b882cadef8d1e09f91dd610637a104c2e7629847a14d4a422f89f7ae324c29845788aefb0a6bb51503886 SHA512 d993bd86c61bba602faf7286ff21d36c5d8c83176c5bbb203cb284a3f89dbc8a1ca893a09eb2657f9e98ccb5c5287f44aac06d2e60db96e78d99ee40bd1fe1b0
+DIST serde-1.0.148.crate 76637 BLAKE2B 41a88a684e96df8e7eec41602a5eb1e97b54799edf4fb8e17cbd1c12fc22425bad7fd7d6d3b2db92830b2275ce64de969f7883802aeccf2ffe1cee25115416f9 SHA512 89005c9372042bc509115604112997ddbc8df60cb6e033b2f83bb303844e1472ad538f5a8120fdd8fb6e9177614e5b16d4ed6ffea722d162eb801e5a564c7455
 DIST serde_derive-1.0.147.crate 54861 BLAKE2B c758a3c854f1474dd3fadd66d60a59408e30d5b658cde4c7ceb10c8d4b4210c8069cc13618f83f1faf36de928feeeb82b2f7011b457e8b9003a15177714f9c0f SHA512 434d65dc0d78c7c1c3f8832221389dc4b0c5d74d605ce1d2d660c2df9a92f5e5d0c6d543763e1462c58d6ea18001c823ca594e3dac92a47d8fe48319a5c52e59
+DIST serde_derive-1.0.148.crate 55562 BLAKE2B bfde4fb3eaa7d4fb0a96f744612d7cb249325281902d3fc03aaab2bdf55aea22fea2f63b14d00ebeccdb402ecf79cae6060065068af06be427df5cb1204ebdbb SHA512 c011e252ed1fa7578a51241a6147ddfdd462f3e1171666c193895691a295f72766cc48e325f14d389a128a8c146ef16454a7f257a52abae45e83fe5f23dffa12
 DIST serde_json-1.0.88.crate 144528 BLAKE2B ba14e2634a9bf718a08e0dd525e1bbdaf98a5c1d5c99129e4904c886285f40e6fce08699efcda34766860f2899f0db011ef2032298ad647072d73a1c8bfd248b SHA512 a09e4a26c5177d0faeb9190e668b72813ec1f6a318459480419c8471c1e0ef65310a6879d9b26f11cb8c161d84ff911f5d81e7a4aeb683757620c2e5c6541eb0
+DIST serde_json-1.0.89.crate 144638 BLAKE2B e296fd2fd3054b81349f246d207de4f7f8072e480a34f1c39afc2d46cdb6b861d1514a8bb64f2f68920e8db43b642814f7f4e989dab95cee62485ca2f8db2e8d SHA512 4bafa5693977e129f5787f2ff10f914e2a7740bf7e631bcdf51b27d0d9e5517873184b56649914371e1881107e7ed0a8fedf487617db334d4a7a4bf95c6c16a3
 DIST sha2-0.10.6.crate 20558 BLAKE2B ceae6f1e28606371f93f5e4fd617b2cb057ed9aa4aa2d81bf4c6af4ca47d639a51f50d0fe4fa77667022c770056d6d711beb4835b2341ae0a8d667f11a4a51a3 SHA512 38dea4c300ea8dee22587ab0af6d66dbde824e1cb071e02e7790bf978efff6bdb6d4076d61c5acb38e86e69261a65811a7bd0182299d53ef053202ee54d2b05c
 DIST shlex-1.1.0.crate 5199 BLAKE2B 325536bab9c9707566a099a161e7bc8448c7369cd9d7b2f144ed71543d551038ef1fd764376491e8076ccdcc928b5c4e177764a68584267a91386b8d542264c3 SHA512 e51892298dd79dc7cf04d7e6f0a03e4850a57b15cd75e6e3b56e2a0b15d4cb85ee8afcc14e3727d193c8b91baec8c2864a9c800834ee4d18a1be584f17591752
 DIST smallvec-1.10.0.crate 31564 BLAKE2B e3e46a0781d3a7892a739b001592d462d0704f010363984c439e3fe4f75aecb9720648aa1e9bcc56bb3be848dd40cee578212439f78f07a807c9441c3c3e0147 SHA512 a09110184582dcc01d7a0d3fa8f74c17bf726935126d3654667b8e9c4bc43ad16ccfd8fa94feae7d9b31913aa7ee030fe5936e4b44a36302b6ce5fe37372a7ae
@@ -103,6 +112,7 @@ DIST spin-0.9.4.crate 30180 BLAKE2B 24dfdab3e643abe5cd9ecdc14c07bafe7424ef19979b
 DIST strength_reduce-0.2.4.crate 17859 BLAKE2B 63ad1af9698ed3ced72f7c0e6d8c62ec35fd564d179286d6cde8975280dbc901303a3be5664b1902c135924dde8a03447a8e837ff0cc8037db50b053ad3c2c9b SHA512 2d44e54e4cf78f718faf482ade6c33fd42e73187a7e4fbbe41fa0905e6bf1ad5f5241c3d8ddfd7b18d9bbfa3f331c54ef2d817b254e1200b50b146f04327f157
 DIST strsim-0.8.0.crate 9309 BLAKE2B 40a8be506c43ee1ffe006ddc7dee98c3d418bdd205d57b78f5d1e4c9312feb57e1eaf952e02d92d4e0932db240c6fba45beb06ea8c4fc6de1cf1faa8b6a3a939 SHA512 1d55a8d946cd55f5f37d06aea536549ded95739fa58c0f2da285a0041154c181f663682bdcac643aa198b3e762d694a04f058db985c62ebe22b5c16327ba6d34
 DIST syn-1.0.103.crate 236495 BLAKE2B fd139b1a8b4449e9be6eddf0036c19b93b876182a03f36954f79eaf79abd5e53667a8a9fcb5c872c96639779307fa293f597831ff838a41d90e1ea201f8a4797 SHA512 3dc0f564ac1a4ce85060926c0897158da0baa127a46bb318506f4fdc79e53d9439295e8ed6a2d5ffcf15d9f6651081b7602cc2a091538e8df061b545f7e3bfe7
+DIST syn-1.0.104.crate 236683 BLAKE2B 865904923ecac469f1d92bab04ea9ee384be0592c7a303d9d0f2f4bc755744bd883372c215a8f1add8bc2728d7c2c27489ab292fc8a89bdce918fc4a32deae44 SHA512 8feabd8e6b1b5eb15077d7c92f0b3269e848d33b1f233b3df343b6d445ed332fb23e0222911a13edfd82cee969d25c43434268cd7a20ce1c0a608a1bbe327b29
 DIST tempfile-3.3.0.crate 27578 BLAKE2B e98c5ed4c59b6ff411e89ad4eb529bbe15264d6744edca8675c89bfb4397fbbb8da60bbc582da24bf9953afd9bb17cdb22654d933468697e9fa9e9903e6a7c77 SHA512 ba6faafb2dd56d694efe424752099a2efb50316afc0a4db9fdb7620ae3f1a31dfbb2a7b41724878cb977fa11f7568a406bd3b6a4f7cfc0b88b86b2cc616b953e
 DIST termcolor-1.1.3.crate 17242 BLAKE2B 5aef69c0004081bd3cc4d531d13d63627cc02313868c0faab62358d13abfa7b4ba82f142c2801d25a6ae46ecbc8b7bdbeaa21c9105ea3b8950ab6a38cdb88513 SHA512 5838fcbfd70f300cb4b62aab50565db52074c56b152ccc8ac1173e4676c0d5a636271bf5a645a77da6e1d4edbf0091af2cd4dd6d73b85c3d198c760898c06f3a
 DIST textwrap-0.11.0.crate 17322 BLAKE2B 257428908342774593bbd3528fcdae710712ff54e8a711393a24356d8ba0e16e466a4b20c05f942c48ca76b3b5b5aaa90ec202f782cad892caa8b71ccf124da6 SHA512 f5c0fe4f28ff1a3a0931e8e235b5157a45f67967985bcc752418c5ec3481fca44a8ae4800088889b37e8cd0533f53d3c456d5ffd19b767b3f83a87b49a2e209a

diff --git a/app-antivirus/clamav/clamav-1.0.0.ebuild b/app-antivirus/clamav/clamav-1.0.0.ebuild
new file mode 100644
index 000000000000..4f496ccb8d7a
--- /dev/null
+++ b/app-antivirus/clamav/clamav-1.0.0.ebuild
@@ -0,0 +1,384 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT=13
+PYTHON_COMPAT=( python3_{8..11} )
+
+# Auto-Generated by cargo-ebuild 0.5.2
+CRATES="
+	adler-1.0.2
+	aho-corasick-0.7.20
+	ansi_term-0.12.1
+	atty-0.2.14
+	autocfg-1.1.0
+	bindgen-0.59.2
+	bit_field-0.10.1
+	bitflags-1.3.2
+	block-buffer-0.10.3
+	bumpalo-3.11.1
+	bytemuck-1.12.3
+	byteorder-1.4.3
+	cbindgen-0.20.0
+	cexpr-0.6.0
+	cfg-if-1.0.0
+	clang-sys-1.4.0
+	clap-2.34.0
+	color_quant-1.1.0
+	cpufeatures-0.2.5
+	crc32fast-1.3.2
+	crossbeam-channel-0.5.6
+	crossbeam-deque-0.8.2
+	crossbeam-epoch-0.9.13
+	crossbeam-utils-0.8.14
+	crunchy-0.2.2
+	crypto-common-0.1.6
+	digest-0.10.6
+	either-1.8.0
+	env_logger-0.9.3
+	exr-1.5.2
+	fastrand-1.8.0
+	flate2-1.0.25
+	flume-0.10.14
+	futures-core-0.3.25
+	futures-sink-0.3.25
+	generic-array-0.14.6
+	getrandom-0.2.8
+	gif-0.11.4
+	glob-0.3.0
+	half-2.1.0
+	hashbrown-0.12.3
+	heck-0.3.3
+	hermit-abi-0.1.19
+	hex-0.4.3
+	humantime-2.1.0
+	image-0.24.5
+	indexmap-1.9.2
+	instant-0.1.12
+	itoa-1.0.4
+	jpeg-decoder-0.3.0
+	js-sys-0.3.60
+	lazy_static-1.4.0
+	lazycell-1.3.0
+	lebe-0.5.2
+	libc-0.2.137
+	libloading-0.7.4
+	lock_api-0.4.9
+	log-0.4.17
+	memchr-2.5.0
+	memoffset-0.7.1
+	minimal-lexical-0.2.1
+	miniz_oxide-0.6.2
+	nanorand-0.7.0
+	nom-7.1.1
+	num-complex-0.4.2
+	num-integer-0.1.45
+	num-rational-0.4.1
+	num-traits-0.2.15
+	num_cpus-1.14.0
+	once_cell-1.16.0
+	peeking_take_while-0.1.2
+	pin-project-1.0.12
+	pin-project-internal-1.0.12
+	png-0.17.7
+	primal-check-0.3.3
+	proc-macro2-1.0.47
+	quote-1.0.21
+	rayon-1.6.0
+	rayon-core-1.10.1
+	redox_syscall-0.2.16
+	regex-1.7.0
+	regex-syntax-0.6.28
+	remove_dir_all-0.5.3
+	rustc-hash-1.1.0
+	rustdct-0.7.1
+	rustfft-6.1.0
+	ryu-1.0.11
+	scoped_threadpool-0.1.9
+	scopeguard-1.1.0
+	serde-1.0.148
+	serde_derive-1.0.148
+	serde_json-1.0.89
+	sha2-0.10.6
+	shlex-1.1.0
+	smallvec-1.10.0
+	spin-0.9.4
+	strength_reduce-0.2.4
+	strsim-0.8.0
+	syn-1.0.104
+	tempfile-3.3.0
+	termcolor-1.1.3
+	textwrap-0.11.0
+	thiserror-1.0.37
+	thiserror-impl-1.0.37
+	threadpool-1.8.1
+	tiff-0.8.0
+	toml-0.5.9
+	transpose-0.2.2
+	typenum-1.15.0
+	unicode-ident-1.0.5
+	unicode-segmentation-1.10.0
+	unicode-width-0.1.10
+	vec_map-0.8.2
+	version_check-0.9.4
+	wasi-0.11.0+wasi-snapshot-preview1
+	wasm-bindgen-0.2.83
+	wasm-bindgen-backend-0.2.83
+	wasm-bindgen-macro-0.2.83
+	wasm-bindgen-macro-support-0.2.83
+	wasm-bindgen-shared-0.2.83
+	weezl-0.1.7
+	which-4.3.0
+	winapi-0.3.9
+	winapi-i686-pc-windows-gnu-0.4.0
+	winapi-util-0.1.5
+	winapi-x86_64-pc-windows-gnu-0.4.0
+"
+
+inherit cargo cmake flag-o-matic llvm python-any-r1 systemd tmpfiles
+
+MY_P=${P//_/-}
+
+DESCRIPTION="Clam Anti-Virus Scanner"
+HOMEPAGE="https://www.clamav.net/"
+SRC_URI="https://github.com/Cisco-Talos/clamav/archive/refs/tags/${MY_P}.tar.gz
+	$(cargo_crate_uris ${CRATES})"
+S=${WORKDIR}/clamav-${MY_P}
+
+LICENSE="Apache-2.0 BSD GPL-2 ISC MIT MPL-2.0 Unicode-DFS-2016 ZLIB"
+SLOT="0"
+if [[ ${PV} != *_rc* ]] ; then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+fi
+IUSE="doc clamonacc +clamapp experimental jit libclamav-only milter rar selinux systemd test"
+
+REQUIRED_USE="libclamav-only? ( !clamonacc !clamapp !milter )
+	clamonacc? ( clamapp )
+	milter? ( clamapp )
+	test? ( !libclamav-only )"
+
+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
+	app-arch/bzip2
+	dev-libs/json-c:=
+	dev-libs/libltdl
+	dev-libs/libmspack
+	dev-libs/libpcre2:=
+	dev-libs/libxml2
+	dev-libs/openssl:=
+	>=sys-libs/zlib-1.2.2:=
+	virtual/libiconv
+	!libclamav-only? ( net-misc/curl )
+	clamapp? ( sys-libs/ncurses:= net-misc/curl )
+	elibc_musl? ( sys-libs/fts-standalone )
+	jit? ( <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):= )
+	milter? ( mail-filter/libmilter:= )
+	rar? ( app-arch/unrar )
+	test? ( dev-python/pytest )
+"
+
+BDEPEND="
+	virtual/pkgconfig
+	>=virtual/rust-1.61
+	doc? ( app-doc/doxygen )
+	test? (
+		${PYTHON_DEPS}
+		$(python_gen_any_dep 'dev-python/pytest[${PYTHON_USEDEP}]')
+	)
+"
+
+DEPEND="${CDEPEND}
+	test? ( dev-libs/check )"
+
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-clamav )"
+
+python_check_deps() {
+	python_has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+	use jit && llvm_pkg_setup
+	use test && python-any-r1_pkg_setup
+}
+
+PATCHES=(
+	"${FILESDIR}/${P}-select-python.patch"
+)
+
+src_configure() {
+	use elibc_musl && append-ldflags -lfts
+	use ppc64 && append-flags -mminimal-toc
+
+	local mycmakeargs=(
+		-DAPP_CONFIG_DIRECTORY="${EPREFIX}"/etc/clamav
+		-DBYTECODE_RUNTIME=$(usex jit llvm interpreter)
+		-DCLAMAV_GROUP="clamav"
+		-DCLAMAV_USER="clamav"
+		-DDATABASE_DIRECTORY="${EPREFIX}"/var/lib/clamav
+		-DENABLE_APP=$(usex clamapp ON OFF)
+		-DENABLE_CLAMONACC=$(usex clamonacc ON OFF)
+		-DENABLE_DOXYGEN=$(usex doc)
+		-DENABLE_EXPERIMENTAL=$(usex experimental ON OFF)
+		-DENABLE_EXTERNAL_MSPACK=ON
+		-DENABLE_JSON_SHARED=ON
+		-DENABLE_MAN_PAGES=ON
+		-DENABLE_MILTER=$(usex milter ON OFF)
+		-DENABLE_SHARED_LIB=ON
+		-DENABLE_STATIC_LIB=OFF
+		-DENABLE_SYSTEMD=$(usex systemd ON OFF)
+		-DENABLE_TESTS=$(usex test ON OFF)
+		-DENABLE_UNRAR=$(usex rar ON OFF)
+		-DOPTIMIZE=ON
+	)
+
+	if use test ; then
+		# https://bugs.gentoo.org/818673
+		# Used to enable some more tests but doesn't behave well in
+		# sandbox necessarily(?) + needs certain debug symbols present
+		# in e.g. glibc.
+		mycmakeargs+=(
+			-DCMAKE_DISABLE_FIND_PACKAGE_Valgrind=ON
+			-DPYTHON_FIND_VERSION="${EPYTHON#python}"
+		)
+	fi
+
+	if use jit ; then
+		# Suppress CMake warnings that variables aren't consumed if we aren't using LLVM
+		# https://github.com/Cisco-Talos/clamav/blob/main/INSTALL.md#llvm-optional-see-bytecode-runtime-section
+		# https://github.com/Cisco-Talos/clamav/blob/main/INSTALL.md#bytecode-runtime
+		mycmakeargs+=(
+			-DLLVM_ROOT_DIR="$(get_llvm_prefix -d ${LLVM_MAX_SLOT})"
+			-DLLVM_FIND_VERSION="$(best_version sys-devel/llvm:${LLVM_MAX_SLOT} | cut -c 16-)"
+		)
+	fi
+
+	cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+	# init scripts
+	newinitd "${FILESDIR}/clamd.initd" clamd
+	newinitd "${FILESDIR}/freshclam.initd" freshclam
+	use clamonacc && \
+		newinitd "${FILESDIR}/clamonacc.initd" clamonacc
+	use milter && \
+		newinitd "${FILESDIR}/clamav-milter.initd" clamav-milter
+
+	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
+			# upstream OpenRC service files should (and do) ensure that
+			# the directories they need exist and have the correct
+			# permissions without the help of opentmpfiles. There are
+			# years-old root exploits in opentmpfiles, the design is
+			# fundamentally flawed, and the maintainer is not up to
+			# the task of fixing it.
+			dotmpfiles "${FILESDIR}/tmpfiles.d/clamav.conf"
+			systemd_newunit "${FILESDIR}/clamd_at.service-0.104.0" "clamd@.service"
+			systemd_dounit "${FILESDIR}/clamd.service"
+			systemd_newunit "${FILESDIR}/freshclamd.service-r1" \
+							"freshclamd.service"
+		fi
+
+		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/^#\(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/clamav/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
+
+			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
+		local HTML_DOCS=( docs/html/. )
+		einstalldocs
+	fi
+
+	# Don't install man pages for utilities we didn't install
+	if use libclamav-only ; then
+		rm -r "${ED}"/usr/share/man || die
+	fi
+
+	find "${ED}" -name '*.la' -delete || die
+}
+
+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
+
+	 if ! systemd_is_booted ; then
+		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."
+	fi
+}

diff --git a/app-antivirus/clamav/files/clamav-1.0.0-select-python.patch b/app-antivirus/clamav/files/clamav-1.0.0-select-python.patch
new file mode 100644
index 000000000000..70bedc029399
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-1.0.0-select-python.patch
@@ -0,0 +1,44 @@
+This patch enables us to tell CMake to find a particular python
+impl on a multi-impl system.
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -223,20 +223,26 @@ if(ENABLE_TESTS)
+     find_package(Libcheck REQUIRED)
+ 
+     # Used to generate the test files and for the application feature test framework
+-    find_package(Python3 REQUIRED)
++    # In distros that support multiple implementations of python it is helpful to specify the impl to use
++    if(DEFINED PYTHON_FIND_VERSION)
++        find_package(Python3 EXACT ${PYTHON_FIND_VERSION} REQUIRED)
++    else()
++        find_package(Python3 REQUIRED)
++        # Not requesting a specific python impl; try using pytest from the PATH
++        execute_process(
++            COMMAND pytest --version
++            RESULT_VARIABLE PYTEST_EXIT_CODE
++            ERROR_QUIET OUTPUT_QUIET
++        )
+ 
+-    # First try using pytest from the PATH
+-    execute_process(
+-        COMMAND pytest --version
+-        RESULT_VARIABLE PYTEST_EXIT_CODE
+-        ERROR_QUIET OUTPUT_QUIET
+-    )
++        if(${PYTEST_EXIT_CODE} EQUAL 0)
++            # pytest found in the path.
++            set(PythonTest_COMMAND "pytest;-v")
++        endif()
++    endif()
+ 
+-    if(${PYTEST_EXIT_CODE} EQUAL 0)
+-        # pytest found in the path.
+-        set(PythonTest_COMMAND "pytest;-v")
+-    else()
+-        # Not in the path, try using: python3 -m pytest
++    if("${PythonTest_COMMAND}" STREQUAL "")
++        # Not in the path or specified a python impl; try using: python3 -m pytest
+         execute_process(
+             COMMAND ${Python3_EXECUTABLE} -m pytest --version
+             RESULT_VARIABLE PYTEST_MODULE_EXIT_CODE


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2024-06-24 11:05 Matt Jolly
  0 siblings, 0 replies; 21+ messages in thread
From: Matt Jolly @ 2024-06-24 11:05 UTC (permalink / raw
  To: gentoo-commits

commit:     7b99345bb35e9a6a208a3aa3cd6660b4d606cdb3
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 10:24:55 2024 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 11:04:15 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b99345b

app-antivirus/clamav: package maintenance

revbump 1.3.1 with the following fixes:

- add postinst message for 'clamonacc'
- fix x32 builds
- fix PID paths
- drop py310; add py313

Bug: https://github.com/Cisco-Talos/clamav/issues/1076
Bug: https://bugs.gentoo.org/921088
Bug: https://bugs.gentoo.org/916147
Bug: https://bugs.gentoo.org/787233
Closes: https://bugs.gentoo.org/927214
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 app-antivirus/clamav/clamav-1.3.1-r1.ebuild        | 409 +++++++++++++++++++++
 .../clamav/files/clamav-1.3.1-onenote-rs.patch     |  30 ++
 2 files changed, 439 insertions(+)

diff --git a/app-antivirus/clamav/clamav-1.3.1-r1.ebuild b/app-antivirus/clamav/clamav-1.3.1-r1.ebuild
new file mode 100644
index 000000000000..05280603ec9e
--- /dev/null
+++ b/app-antivirus/clamav/clamav-1.3.1-r1.ebuild
@@ -0,0 +1,409 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+# Upstream are working on updating clamav's LLVM bytecode interpreter to work
+# with later versions of LLVM, but it's not ready yet. See:
+# https://github.com/Cisco-Talos/clamav/issues/581
+# This does not impact the ability of the package to build with llvm/clang otherwise.
+LLVM_MAX_SLOT=13
+PYTHON_COMPAT=( python3_{11..13} )
+
+# Autogenerated by pycargoebuild 0.13.2
+CRATES="
+	adler@1.0.2
+	aho-corasick@1.1.2
+	autocfg@1.1.0
+	base64@0.21.5
+	bindgen@0.65.1
+	bit_field@0.10.2
+	bitflags@1.3.2
+	bitflags@2.4.1
+	block-buffer@0.10.4
+	bytemuck@1.14.0
+	byteorder@1.5.0
+	bytes@1.5.0
+	cbindgen@0.25.0
+	cexpr@0.6.0
+	cfg-if@1.0.0
+	clang-sys@1.6.1
+	color_quant@1.1.0
+	cpufeatures@0.2.11
+	crc32fast@1.3.2
+	crossbeam-deque@0.8.4
+	crossbeam-epoch@0.9.16
+	crossbeam-utils@0.8.17
+	crunchy@0.2.2
+	crypto-common@0.1.6
+	digest@0.10.7
+	either@1.9.0
+	encoding_rs@0.8.33
+	enum-primitive-derive@0.2.2
+	errno@0.3.8
+	exr@1.71.0
+	fastrand@2.0.1
+	fdeflate@0.3.4
+	flate2@1.0.28
+	flume@0.11.0
+	generic-array@0.14.7
+	gif@0.12.0
+	glob@0.3.1
+	half@2.2.1
+	hashbrown@0.12.3
+	heck@0.4.1
+	hex-literal@0.4.1
+	hex@0.4.3
+	home@0.5.5
+	image@0.24.7
+	indexmap@1.9.3
+	itertools@0.10.5
+	itoa@1.0.10
+	jpeg-decoder@0.3.0
+	lazy_static@1.4.0
+	lazycell@1.3.0
+	lebe@0.5.2
+	libc@0.2.151
+	libloading@0.7.4
+	linux-raw-sys@0.4.12
+	lock_api@0.4.11
+	log@0.4.20
+	memchr@2.6.4
+	memoffset@0.9.0
+	minimal-lexical@0.2.1
+	miniz_oxide@0.7.1
+	nom@7.1.3
+	num-complex@0.4.4
+	num-integer@0.1.45
+	num-rational@0.4.1
+	num-traits@0.2.17
+	once_cell@1.19.0
+	paste@1.0.14
+	peeking_take_while@0.1.2
+	png@0.17.13
+	prettyplease@0.2.15
+	primal-check@0.3.3
+	proc-macro2@1.0.70
+	qoi@0.4.1
+	quote@1.0.33
+	rayon-core@1.12.0
+	rayon@1.8.0
+	redox_syscall@0.4.1
+	regex-automata@0.4.3
+	regex-syntax@0.8.2
+	regex@1.10.2
+	rustc-hash@1.1.0
+	rustdct@0.7.1
+	rustfft@6.1.0
+	rustix@0.38.28
+	ryu@1.0.16
+	scopeguard@1.2.0
+	serde@1.0.193
+	serde_derive@1.0.193
+	serde_json@1.0.108
+	sha1@0.10.6
+	sha2@0.10.8
+	shlex@1.3.0
+	simd-adler32@0.3.7
+	smallvec@1.11.2
+	spin@0.9.8
+	strength_reduce@0.2.4
+	syn@1.0.109
+	syn@2.0.41
+	tempfile@3.8.1
+	thiserror-impl@1.0.50
+	thiserror@1.0.50
+	tiff@0.9.0
+	toml@0.5.11
+	transpose@0.2.3
+	typenum@1.17.0
+	unicode-ident@1.0.12
+	unicode-segmentation@1.10.1
+	uuid@1.6.1
+	version_check@0.9.4
+	weezl@0.1.7
+	which@4.4.2
+	widestring@1.0.2
+	winapi-i686-pc-windows-gnu@0.4.0
+	winapi-x86_64-pc-windows-gnu@0.4.0
+	winapi@0.3.9
+	windows-sys@0.48.0
+	windows-sys@0.52.0
+	windows-targets@0.48.5
+	windows-targets@0.52.0
+	windows_aarch64_gnullvm@0.48.5
+	windows_aarch64_gnullvm@0.52.0
+	windows_aarch64_msvc@0.48.5
+	windows_aarch64_msvc@0.52.0
+	windows_i686_gnu@0.48.5
+	windows_i686_gnu@0.52.0
+	windows_i686_msvc@0.48.5
+	windows_i686_msvc@0.52.0
+	windows_x86_64_gnu@0.48.5
+	windows_x86_64_gnu@0.52.0
+	windows_x86_64_gnullvm@0.48.5
+	windows_x86_64_gnullvm@0.52.0
+	windows_x86_64_msvc@0.48.5
+	windows_x86_64_msvc@0.52.0
+	zune-inflate@0.2.54
+"
+
+# Get the commit from the CLAM-2329-new-from-slice branch
+declare -A GIT_CRATES=(
+	[onenote_parser]="https://github.com/Cisco-Talos/onenote.rs;8b450447e58143004b68dd21c11b710fdb79be92;onenote.rs-%commit%"
+)
+
+inherit cargo cmake flag-o-matic llvm python-any-r1 systemd tmpfiles
+
+MY_P=${P//_/-}
+
+DESCRIPTION="Clam Anti-Virus Scanner"
+HOMEPAGE="https://www.clamav.net/"
+SRC_URI="https://github.com/Cisco-Talos/clamav/archive/refs/tags/${MY_P}.tar.gz
+	${CARGO_CRATE_URIS}"
+S=${WORKDIR}/clamav-${MY_P}
+
+LICENSE="Apache-2.0 BSD GPL-2 ISC MIT MPL-2.0 Unicode-DFS-2016 ZLIB"
+# 0/sts (short term support) if not an LTS release
+SLOT="0/sts"
+if [[ ${PV} != *_rc* ]] ; then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+fi
+
+IUSE="doc clamonacc +clamapp experimental jit libclamav-only milter rar selinux +system-mspack systemd test"
+
+REQUIRED_USE="libclamav-only? ( !clamonacc !clamapp !milter )
+	clamonacc? ( clamapp )
+	milter? ( clamapp )
+	test? ( !libclamav-only )"
+
+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.
+COMMON_DEPEND="
+	acct-group/clamav
+	acct-user/clamav
+	app-arch/bzip2
+	dev-libs/json-c:=
+	dev-libs/libltdl
+	dev-libs/libpcre2:=
+	dev-libs/libxml2
+	dev-libs/openssl:=
+	>=sys-libs/zlib-1.2.2:=
+	virtual/libiconv
+	!libclamav-only? ( net-misc/curl )
+	clamapp? ( sys-libs/ncurses:= net-misc/curl )
+	elibc_musl? ( sys-libs/fts-standalone )
+	jit? ( <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):= )
+	milter? ( mail-filter/libmilter:= )
+	rar? ( app-arch/unrar )
+	system-mspack? ( dev-libs/libmspack )
+	test? ( dev-python/pytest )
+"
+# rust-bin < 1.71 has an executable stack
+# which is not supported on selinux #911589
+BDEPEND="
+	virtual/pkgconfig
+	>=virtual/rust-1.71
+	doc? ( app-text/doxygen )
+	test? (
+		${PYTHON_DEPS}
+		$(python_gen_any_dep 'dev-python/pytest[${PYTHON_USEDEP}]')
+	)
+"
+
+DEPEND="${COMMON_DEPEND}
+	test? ( dev-libs/check )"
+
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-clamav )"
+
+python_check_deps() {
+	python_has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+	use jit && llvm_pkg_setup
+	use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+	eapply --dir="${WORKDIR}/onenote.rs-8b450447e58143004b68dd21c11b710fdb79be92" \
+		"${FILESDIR}/${P}-onenote-rs.patch"
+	cmake_src_prepare
+}
+
+src_configure() {
+	use elibc_musl && append-ldflags -lfts
+	use ppc64 && append-flags -mminimal-toc
+
+	local mycmakeargs=(
+		-DAPP_CONFIG_DIRECTORY="${EPREFIX}"/etc/clamav
+		-DBYTECODE_RUNTIME=$(usex jit llvm interpreter)
+		-DCLAMAV_GROUP="clamav"
+		-DCLAMAV_USER="clamav"
+		-DDATABASE_DIRECTORY="${EPREFIX}"/var/lib/clamav
+		-DENABLE_APP=$(usex clamapp ON OFF)
+		-DENABLE_CLAMONACC=$(usex clamonacc ON OFF)
+		-DENABLE_DOXYGEN=$(usex doc)
+		-DENABLE_EXPERIMENTAL=$(usex experimental ON OFF)
+		-DENABLE_EXTERNAL_MSPACK=$(usex system-mspack ON OFF)
+		-DENABLE_JSON_SHARED=ON
+		-DENABLE_MAN_PAGES=ON
+		-DENABLE_MILTER=$(usex milter ON OFF)
+		-DENABLE_SHARED_LIB=ON
+		-DENABLE_STATIC_LIB=OFF
+		-DENABLE_SYSTEMD=$(usex systemd ON OFF)
+		-DENABLE_TESTS=$(usex test ON OFF)
+		-DENABLE_UNRAR=$(usex rar ON OFF)
+		-DOPTIMIZE=ON
+	)
+
+	if use test ; then
+		# https://bugs.gentoo.org/818673
+		# Used to enable some more tests but doesn't behave well in
+		# sandbox necessarily(?) + needs certain debug symbols present
+		# in e.g. glibc.
+		mycmakeargs+=(
+			-DCMAKE_DISABLE_FIND_PACKAGE_Valgrind=ON
+			-DPYTHON_FIND_VERSION="${EPYTHON#python}"
+		)
+	fi
+
+	if use jit ; then
+		# Suppress CMake warnings that variables aren't consumed if we aren't using LLVM
+		# https://github.com/Cisco-Talos/clamav/blob/main/INSTALL.md#llvm-optional-see-bytecode-runtime-section
+		# https://github.com/Cisco-Talos/clamav/blob/main/INSTALL.md#bytecode-runtime
+		mycmakeargs+=(
+			-DLLVM_ROOT_DIR="$(get_llvm_prefix -d ${LLVM_MAX_SLOT})"
+			-DLLVM_FIND_VERSION="$(best_version sys-devel/llvm:${LLVM_MAX_SLOT} | cut -c 16-)"
+		)
+	fi
+
+	cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+	# init scripts
+	newinitd "${FILESDIR}/clamd.initd" clamd
+	newinitd "${FILESDIR}/freshclam.initd" freshclam
+	use clamonacc && \
+		newinitd "${FILESDIR}/clamonacc.initd" clamonacc
+	use milter && \
+		newinitd "${FILESDIR}/clamav-milter.initd" clamav-milter
+
+	if ! use libclamav-only ; then
+		if use systemd ; then
+			# The tmpfiles entry is behind USE=systemd because the
+			# upstream OpenRC service files should (and do) ensure that
+			# the directories they need exist and have the correct
+			# permissions without the help of opentmpfiles. There are
+			# years-old root exploits in opentmpfiles, the design is
+			# fundamentally flawed, and the maintainer is not up to
+			# the task of fixing it.
+			dotmpfiles "${FILESDIR}/tmpfiles.d/clamav.conf"
+			systemd_newunit "${FILESDIR}/clamd_at.service-0.104.0" "clamd@.service"
+			systemd_dounit "${FILESDIR}/clamd.service"
+			systemd_newunit "${FILESDIR}/freshclamd.service-r1" \
+							"freshclamd.service"
+		fi
+
+				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 ${EPREFIX}/run/clamd.pid:" \
+				-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 ${EPREFIX}/run/freshclam.pid:" \
+				-e "s/^#\(DatabaseOwner .*\)/\1/" \
+				-e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
+				-e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamav/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 ${EPREFIX}/run/clamav-milter.pid:" \
+					-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
+
+			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
+		local HTML_DOCS=( docs/html/. )
+		einstalldocs
+	fi
+
+	# Don't install man pages for utilities we didn't install
+	if use libclamav-only ; then
+		rm -r "${ED}"/usr/share/man || die
+	fi
+
+	find "${ED}" -name '*.la' -delete || die
+}
+
+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
+
+	 if ! systemd_is_booted ; then
+		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."
+	fi
+
+	if [[ -z ${REPLACING_VERSIONS} ]] && use clamonacc; then
+		einfo "'clamonacc' requires additional configuration before it"
+		einfo "can be enabled, and may not produce any output if not properly"
+		einfo "configured. Read the appropriate man page if clamonacc is desired."
+	fi
+}

diff --git a/app-antivirus/clamav/files/clamav-1.3.1-onenote-rs.patch b/app-antivirus/clamav/files/clamav-1.3.1-onenote-rs.patch
new file mode 100644
index 000000000000..d8421a269606
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-1.3.1-onenote-rs.patch
@@ -0,0 +1,30 @@
+From bc17e5a2e1f324461024f5e3e5776085a6b6df37 Mon Sep 17 00:00:00 2001
+From: Matt Jolly <Matt.Jolly@footclan.ninja>
+Date: Mon, 24 Jun 2024 17:34:05 +1000
+Subject: [PATCH] PropertType: Specify type for custom discriminant values
+
+We use custom discriminant values for enum variants for "PropertType" without specifying the type.
+This causes it to default to "isize" which on 64bit platforms is big enough to hold the 32bit constants,
+but causes overflow when isize is 32bit.
+
+This issue was uncovered due to build failures on arm for Gentoo Linux as a dependency of ClamAV.
+
+Bug: https://bugs.gentoo.org/927214
+Signed-off-by: Matt Jolly <kangie@gentoo.org>
+Co-authored-by: Steven Newbury <steve@snewbury.org.uk>
+---
+ src/one/property/mod.rs | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/one/property/mod.rs b/src/one/property/mod.rs
+index 42841c6..fcc0481 100644
+--- a/src/one/property/mod.rs
++++ b/src/one/property/mod.rs
+@@ -23,6 +23,7 @@ mod references;
+ pub(crate) mod simple;
+ pub(crate) mod time;
+ 
++#[repr(u32)]
+ #[derive(Debug, Copy, Clone, PartialEq)]
+ #[allow(dead_code)]
+ #[allow(clippy::enum_clike_unportable_variant)]


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2024-09-23 11:12 Matt Jolly
  0 siblings, 0 replies; 21+ messages in thread
From: Matt Jolly @ 2024-09-23 11:12 UTC (permalink / raw
  To: gentoo-commits

commit:     6091414aa294862a44a98047c7a0f738b845d4cd
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 23 11:09:13 2024 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Sep 23 11:11:56 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6091414a

app-antivirus/clamav: add 1.0.7

Bug: https://bugs.gentoo.org/940140
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 app-antivirus/clamav/clamav-1.0.7.ebuild           | 404 +++++++++++++++++++++
 .../files/clamav-1.0.7-cmake-python-version.patch  |  51 +++
 2 files changed, 455 insertions(+)

diff --git a/app-antivirus/clamav/clamav-1.0.7.ebuild b/app-antivirus/clamav/clamav-1.0.7.ebuild
new file mode 100644
index 000000000000..fb626bfc7c34
--- /dev/null
+++ b/app-antivirus/clamav/clamav-1.0.7.ebuild
@@ -0,0 +1,404 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT=13
+PYTHON_COMPAT=( python3_{10..12} )
+
+# Auto-Generated by cargo-ebuild 0.5.4-r1
+CRATES="
+	adler@1.0.2
+	autocfg@1.1.0
+	bindgen@0.65.1
+	bit_field@0.10.1
+	bitflags@1.3.2
+	block-buffer@0.10.3
+	bumpalo@3.12.0
+	bytemuck@1.13.0
+	byteorder@1.4.3
+	cbindgen@0.20.0
+	cc@1.0.83
+	cexpr@0.6.0
+	cfg-if@1.0.0
+	clang-sys@1.4.0
+	color_quant@1.1.0
+	cpufeatures@0.2.5
+	crc32fast@1.3.2
+	crossbeam-channel@0.5.8
+	crossbeam-deque@0.8.2
+	crossbeam-epoch@0.9.13
+	crossbeam-utils@0.8.14
+	crunchy@0.2.2
+	crypto-common@0.1.6
+	digest@0.10.6
+	either@1.8.1
+	errno@0.3.3
+	errno-dragonfly@0.1.2
+	exr@1.5.3
+	fastrand@1.8.0
+	fdeflate@0.3.4
+	flate2@1.0.25
+	flume@0.10.14
+	futures-core@0.3.26
+	futures-sink@0.3.26
+	generic-array@0.14.6
+	getrandom@0.2.8
+	gif@0.11.4
+	glob@0.3.1
+	half@2.2.1
+	hashbrown@0.12.3
+	heck@0.3.3
+	hermit-abi@0.2.6
+	hermit-abi@0.3.3
+	hex@0.4.3
+	image@0.24.5
+	indexmap@1.9.2
+	instant@0.1.12
+	io-lifetimes@1.0.11
+	itoa@1.0.5
+	jpeg-decoder@0.3.0
+	js-sys@0.3.61
+	lazy_static@1.4.0
+	lazycell@1.3.0
+	lebe@0.5.2
+	libc@0.2.139
+	libloading@0.7.4
+	linux-raw-sys@0.1.4
+	lock_api@0.4.9
+	log@0.4.17
+	memchr@2.5.0
+	memoffset@0.7.1
+	minimal-lexical@0.2.1
+	miniz_oxide@0.6.2
+	miniz_oxide@0.7.2
+	nanorand@0.7.0
+	nom@7.1.3
+	num-complex@0.4.3
+	num-integer@0.1.45
+	num-rational@0.4.1
+	num-traits@0.2.15
+	num_cpus@1.15.0
+	once_cell@1.17.0
+	peeking_take_while@0.1.2
+	pin-project@1.0.12
+	pin-project-internal@1.0.12
+	png@0.17.13
+	prettyplease@0.2.4
+	primal-check@0.3.3
+	proc-macro2@1.0.66
+	quote@1.0.26
+	rayon@1.6.1
+	rayon-core@1.10.2
+	redox_syscall@0.2.16
+	regex@1.7.1
+	regex-syntax@0.6.28
+	rustc-hash@1.1.0
+	rustdct@0.7.1
+	rustfft@6.1.0
+	rustix@0.36.15
+	ryu@1.0.12
+	scoped_threadpool@0.1.9
+	scopeguard@1.1.0
+	serde@1.0.152
+	serde_derive@1.0.152
+	serde_json@1.0.93
+	sha2@0.10.6
+	shlex@1.3.0
+	simd-adler32@0.3.4
+	smallvec@1.10.0
+	spin@0.9.8
+	strength_reduce@0.2.4
+	syn@1.0.107
+	syn@2.0.15
+	tempfile@3.4.0
+	thiserror@1.0.38
+	thiserror-impl@1.0.38
+	threadpool@1.8.1
+	tiff@0.8.1
+	toml@0.5.11
+	transpose@0.2.3
+	typenum@1.16.0
+	unicode-ident@1.0.6
+	unicode-segmentation@1.10.1
+	version_check@0.9.4
+	wasi@0.11.0+wasi-snapshot-preview1
+	wasm-bindgen@0.2.84
+	wasm-bindgen-backend@0.2.84
+	wasm-bindgen-macro@0.2.84
+	wasm-bindgen-macro-support@0.2.84
+	wasm-bindgen-shared@0.2.84
+	weezl@0.1.7
+	which@4.4.0
+	winapi@0.3.9
+	winapi-i686-pc-windows-gnu@0.4.0
+	winapi-x86_64-pc-windows-gnu@0.4.0
+	windows-sys@0.42.0
+	windows-sys@0.45.0
+	windows-sys@0.48.0
+	windows-targets@0.42.2
+	windows-targets@0.48.5
+	windows_aarch64_gnullvm@0.42.2
+	windows_aarch64_gnullvm@0.48.5
+	windows_aarch64_msvc@0.42.2
+	windows_aarch64_msvc@0.48.5
+	windows_i686_gnu@0.42.2
+	windows_i686_gnu@0.48.5
+	windows_i686_msvc@0.42.2
+	windows_i686_msvc@0.48.5
+	windows_x86_64_gnu@0.42.2
+	windows_x86_64_gnu@0.48.5
+	windows_x86_64_gnullvm@0.42.2
+	windows_x86_64_gnullvm@0.48.5
+	windows_x86_64_msvc@0.42.2
+	windows_x86_64_msvc@0.48.5
+	zune-inflate@0.2.42
+"
+
+inherit cargo cmake flag-o-matic llvm python-any-r1 systemd tmpfiles
+
+MY_P=${P//_/-}
+
+DESCRIPTION="Clam Anti-Virus Scanner"
+HOMEPAGE="https://www.clamav.net/"
+SRC_URI="https://github.com/Cisco-Talos/clamav/archive/refs/tags/${MY_P}.tar.gz
+	${CARGO_CRATE_URIS}"
+S=${WORKDIR}/clamav-${MY_P}
+
+LICENSE="Apache-2.0 BSD GPL-2 ISC MIT MPL-2.0 Unicode-DFS-2016 ZLIB"
+SLOT="0/lts"
+if [[ ${PV} != *_rc* ]] ; then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+fi
+
+IUSE="doc clamonacc +clamapp experimental jit libclamav-only milter rar selinux +system-mspack systemd test"
+
+REQUIRED_USE="libclamav-only? ( !clamonacc !clamapp !milter )
+	clamonacc? ( clamapp )
+	milter? ( clamapp )
+	test? ( !libclamav-only )"
+
+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.
+COMMON_DEPEND="
+	acct-group/clamav
+	acct-user/clamav
+	app-arch/bzip2
+	dev-libs/json-c:=
+	dev-libs/libltdl
+	dev-libs/libpcre2:=
+	dev-libs/libxml2
+	dev-libs/openssl:=
+	>=sys-libs/zlib-1.2.2:=
+	virtual/libiconv
+	!libclamav-only? ( net-misc/curl )
+	clamapp? ( sys-libs/ncurses:= net-misc/curl )
+	elibc_musl? ( sys-libs/fts-standalone )
+	jit? ( <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):= )
+	milter? ( mail-filter/libmilter:= )
+	rar? ( app-arch/unrar )
+	system-mspack? ( dev-libs/libmspack )
+	test? ( dev-python/pytest )
+"
+
+# rust-bin < 1.71 has an executable stack
+# which is not supported on selinux #911589
+BDEPEND="
+	virtual/pkgconfig
+	>=virtual/rust-1.71
+	doc? ( app-text/doxygen )
+	test? (
+		${PYTHON_DEPS}
+		$(python_gen_any_dep 'dev-python/pytest[${PYTHON_USEDEP}]')
+	)
+"
+
+DEPEND="${COMMON_DEPEND}
+	test? ( dev-libs/check )"
+
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-clamav )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-1.0.7-cmake-python-version.patch"
+)
+
+python_check_deps() {
+	python_has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+	use jit && llvm_pkg_setup
+	use test && python-any-r1_pkg_setup
+}
+
+src_configure() {
+	use elibc_musl && append-ldflags -lfts
+	use ppc64 && append-flags -mminimal-toc
+
+	local mycmakeargs=(
+		-DAPP_CONFIG_DIRECTORY="${EPREFIX}"/etc/clamav
+		-DBYTECODE_RUNTIME=$(usex jit llvm interpreter)
+		-DCLAMAV_GROUP="clamav"
+		-DCLAMAV_USER="clamav"
+		-DDATABASE_DIRECTORY="${EPREFIX}"/var/lib/clamav
+		-DENABLE_APP=$(usex clamapp ON OFF)
+		-DENABLE_CLAMONACC=$(usex clamonacc ON OFF)
+		-DENABLE_DOXYGEN=$(usex doc)
+		-DENABLE_EXPERIMENTAL=$(usex experimental ON OFF)
+		-DENABLE_EXTERNAL_MSPACK=$(usex system-mspack ON OFF)
+		-DENABLE_JSON_SHARED=ON
+		-DENABLE_MAN_PAGES=ON
+		-DENABLE_MILTER=$(usex milter ON OFF)
+		-DENABLE_SHARED_LIB=ON
+		-DENABLE_STATIC_LIB=OFF
+		-DENABLE_SYSTEMD=$(usex systemd ON OFF)
+		-DENABLE_TESTS=$(usex test ON OFF)
+		-DENABLE_UNRAR=$(usex rar ON OFF)
+		-DOPTIMIZE=ON
+	)
+
+	if use test ; then
+		# https://bugs.gentoo.org/818673
+		# Used to enable some more tests but doesn't behave well in
+		# sandbox necessarily(?) + needs certain debug symbols present
+		# in e.g. glibc.
+		mycmakeargs+=(
+			-DCMAKE_DISABLE_FIND_PACKAGE_Valgrind=ON
+			-DPYTHON_FIND_VERSION="${EPYTHON#python}"
+		)
+	fi
+
+	if use jit ; then
+		# Suppress CMake warnings that variables aren't consumed if we aren't using LLVM
+		# https://github.com/Cisco-Talos/clamav/blob/main/INSTALL.md#llvm-optional-see-bytecode-runtime-section
+		# https://github.com/Cisco-Talos/clamav/blob/main/INSTALL.md#bytecode-runtime
+		mycmakeargs+=(
+			-DLLVM_ROOT_DIR="$(get_llvm_prefix -d ${LLVM_MAX_SLOT})"
+			-DLLVM_FIND_VERSION="$(best_version sys-devel/llvm:${LLVM_MAX_SLOT} | cut -c 16-)"
+		)
+	fi
+
+	cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+	# init scripts
+	newinitd "${FILESDIR}/clamd.initd" clamd
+	newinitd "${FILESDIR}/freshclam.initd" freshclam
+	use clamonacc && \
+		newinitd "${FILESDIR}/clamonacc.initd" clamonacc
+	use milter && \
+		newinitd "${FILESDIR}/clamav-milter.initd" clamav-milter
+
+	if ! use libclamav-only ; then
+		if use systemd ; then
+			# The tmpfiles entry is behind USE=systemd because the
+			# upstream OpenRC service files should (and do) ensure that
+			# the directories they need exist and have the correct
+			# permissions without the help of opentmpfiles. There are
+			# years-old root exploits in opentmpfiles, the design is
+			# fundamentally flawed, and the maintainer is not up to
+			# the task of fixing it.
+			dotmpfiles "${FILESDIR}/tmpfiles.d/clamav.conf"
+			systemd_newunit "${FILESDIR}/clamd_at.service-0.104.0" "clamd@.service"
+			systemd_dounit "${FILESDIR}/clamd.service"
+			systemd_newunit "${FILESDIR}/freshclamd.service-r1" \
+							"freshclamd.service"
+		fi
+
+		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/^#\(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/clamav/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
+
+			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
+		local HTML_DOCS=( docs/html/. )
+		einstalldocs
+	fi
+
+	# Don't install man pages for utilities we didn't install
+	if use libclamav-only ; then
+		rm -r "${ED}"/usr/share/man || die
+	fi
+
+	find "${ED}" -name '*.la' -delete || die
+}
+
+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
+
+	 if ! systemd_is_booted ; then
+		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."
+	fi
+}

diff --git a/app-antivirus/clamav/files/clamav-1.0.7-cmake-python-version.patch b/app-antivirus/clamav/files/clamav-1.0.7-cmake-python-version.patch
new file mode 100644
index 000000000000..58ed0d29ee40
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-1.0.7-cmake-python-version.patch
@@ -0,0 +1,51 @@
+https://github.com/Cisco-Talos/clamav/commit/f4280e9a690f2a5b657118e515b089f494a1e464
+From: Matt Jolly <Matt.Jolly@footclan.ninja>
+Date: Wed, 30 Nov 2022 16:14:39 +1100
+Subject: [PATCH] CMake: Enable selection of a specific python impl
+
+On distros with multiple python impls it can be useful to select
+a specific version rather than whatever CMake thinks is appopriate.
+
+This patch enables users to instruct CMake to look for a specific
+version of python by passing `-DPYTHON_FIND_VER`.
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -223,20 +223,26 @@ if(ENABLE_TESTS)
+     find_package(Libcheck REQUIRED)
+ 
+     # Used to generate the test files and for the application feature test framework
+-    find_package(Python3 REQUIRED)
++    # In distros that support multiple implementations of python it is helpful to specify the impl to use
++    if(DEFINED PYTHON_FIND_VERSION)
++        find_package(Python3 EXACT ${PYTHON_FIND_VERSION} REQUIRED)
++    else()
++        find_package(Python3 REQUIRED)
++        # Not requesting a specific python impl; try using pytest from the PATH
++        execute_process(
++            COMMAND pytest --version
++            RESULT_VARIABLE PYTEST_EXIT_CODE
++            ERROR_QUIET OUTPUT_QUIET
++        )
+ 
+-    # First try using pytest from the PATH
+-    execute_process(
+-        COMMAND pytest --version
+-        RESULT_VARIABLE PYTEST_EXIT_CODE
+-        ERROR_QUIET OUTPUT_QUIET
+-    )
++        if(${PYTEST_EXIT_CODE} EQUAL 0)
++            # pytest found in the path.
++            set(PythonTest_COMMAND "pytest;-v")
++        endif()
++    endif()
+ 
+-    if(${PYTEST_EXIT_CODE} EQUAL 0)
+-        # pytest found in the path.
+-        set(PythonTest_COMMAND "pytest;-v")
+-    else()
+-        # Not in the path, try using: python3 -m pytest
++    if("${PythonTest_COMMAND}" STREQUAL "")
++        # Not in the path or specified a python impl; try using: python3 -m pytest
+         execute_process(
+             COMMAND ${Python3_EXECUTABLE} -m pytest --version
+             RESULT_VARIABLE PYTEST_MODULE_EXIT_CODE


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2024-09-23 11:48 Matt Jolly
  0 siblings, 0 replies; 21+ messages in thread
From: Matt Jolly @ 2024-09-23 11:48 UTC (permalink / raw
  To: gentoo-commits

commit:     35103ea68be91720c95f67ca32b6ac2b35238d62
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 23 11:43:38 2024 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Sep 23 11:47:36 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35103ea6

app-antivirus/clamav: add 1.4.1-r1

Swap out 1.4.0 for 1.4.0-r1 - noticed an incompatible-pointer-type
warning just after pushing.

As a side benefit we can drop the old onenote-rs patch in favour
of a later revision of upstream's git crate!

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 app-antivirus/clamav/Manifest                      |  2 +-
 ...{clamav-1.4.1.ebuild => clamav-1.4.1-r1.ebuild} |  8 +++---
 .../clamav/files/clamav-1.3.1-onenote-rs.patch     | 30 ----------------------
 .../clamav/files/clamav-1.4.1-pointer-types.patch  | 29 +++++++++++++++++++++
 4 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index 7212a5c955f5..d5636a04acd1 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -170,7 +170,7 @@ DIST num_cpus-1.16.0.crate 15713 BLAKE2B 11b432fc7c7496d48918f09ed0954e0f1d08455
 DIST once_cell-1.17.0.crate 32736 BLAKE2B 767fc8f362ce5ed7a9eafceb2f0764a2a1c7f4070e22d1e6e2498b3c841c5f761e77fb66a34b899a75d48f1563f6b9b73b90aa9431055d4e0269c47a1b043c1f SHA512 291d87380c0ea17fb3ffc9fdff8620d2ff55601c06ef65b2f0c54254fecd5b488645c6e94c6026b82071893f4d420491ff712399a782e14efa1e323e5c299c46
 DIST once_cell-1.18.0.crate 32969 BLAKE2B a08d5beee50a7add28bd9e50b18709e7b34574f0f55f80909d5efb7ac5917e5f30bdcf3fb43ddd0a4f420a427390c7ffe1cc1c7191a3a1d939bc6e3139e6eef7 SHA512 9328968afdf3535b2d9e0113d75afa725259d76994ef2e1948ad7efa4ec8a65bac7cfdc31b749d5cd55ad4e28d2e28ac57b871e3067b89182453c7e2413a13b8
 DIST once_cell-1.19.0.crate 33046 BLAKE2B c14b374eaf4ac0f60acc2e02f7bba270a0e8e0a6978d749cd3cb0ab3eb26907e4fbea70dd5132982f90290381ed18ff8a87fd530f1415fabffac864f157ea380 SHA512 4154876afd34a699ee650d1a8a1c5ee5a25f0ebd9388b8bef2564e33629fae68f113d7507488c68abbe7ea1acf9bbc41813cbbf3ef3e464e3f3b9cc7a51d870c
-DIST onenote.rs-8b450447e58143004b68dd21c11b710fdb79be92.gh.tar.gz 725441 BLAKE2B e4ad2b41d47db5318f792624d9cc793c9fa1b77cab6811d13d9cfeb7f4239639f4191d5d3207d27549426b9414e04f4aa0e18ed00e221cea49a9e4a5b3423470 SHA512 4a29e1f9a77e7174481b0d9e3cd860dcbe593a2fc28f60823197e52a1067cc1674758c97b13605fb7d58cb35d518941bc117b49458a58a1e887f15981df4e8a0
+DIST onenote.rs-29c08532252b917543ff268284f926f30876bb79.gh.tar.gz 725455 BLAKE2B d89839fe5254895376b7a0d793feb246f2244a277fb97d9753ae661e6cd393765a009e3c957a139c9f3f26cfb989e2ec3b14df4099b81e0969334a885e54e61c SHA512 cbae71d1b28ef7465729d19c70e59ccc8690a21131827d3d627128fbe3a178abcf7c3ddf1fd7e7ede0e024c329c26c77474388e343f8758537faa0d570d4fd15
 DIST paste-1.0.14.crate 18157 BLAKE2B 35e8548611c51ee75f4d04926149e5e54870d7073d9b635d550a6fa0f85891f57f326bdbcff3dd8618cf40f8e08cf903ef87d9c034d5921d8b91e1db842cdd7c SHA512 3a793f0e5e773a7f7defc798a4c17ae9a40d715144632ea6cb0a8c785e14c4212046491df016bb9838281f8eaf327a79f01c1e2ac5f26785c028bc880faff9ee
 DIST peeking_take_while-0.1.2.crate 6697 BLAKE2B 31571604d00872900abcb677a483da93654de523bbdb0331c326dc9a3e531f246e571bebcb983e79dc46e33ed6dd32b978be509841ec0d9f1e7209c06289c22a SHA512 7bf8721987c3e2e1986683dd897746592a909382f02b840b777effec7d8b0a864c1a83b03c73d555e359f22c423168a54b75448a7e7b996b739527ce8c88b721
 DIST pin-project-1.0.12.crate 56972 BLAKE2B 1f6b106cd55b9692bb1d671bfd51011d9f89cfe8bbbe030c64e7ea57b6efb0765838b03812708a7aa38c197d3b43328a9d88fdf93abb51f4d1a3061301b74414 SHA512 434ce0a0e16441c7aa6f12dc98584a0e7986e9491eb08d5143e3f64e1f73dfa4db9d0fb2098f16e5a36f3653201aff735437d2d1d366c11160c09534c75fbfe7

diff --git a/app-antivirus/clamav/clamav-1.4.1.ebuild b/app-antivirus/clamav/clamav-1.4.1-r1.ebuild
similarity index 97%
rename from app-antivirus/clamav/clamav-1.4.1.ebuild
rename to app-antivirus/clamav/clamav-1.4.1-r1.ebuild
index 4dc3275f4755..b5509223351b 100644
--- a/app-antivirus/clamav/clamav-1.4.1.ebuild
+++ b/app-antivirus/clamav/clamav-1.4.1-r1.ebuild
@@ -154,7 +154,7 @@ CRATES="
 
 # Get the commit from the CLAM-2329-new-from-slice branch
 declare -A GIT_CRATES=(
-	[onenote_parser]="https://github.com/Cisco-Talos/onenote.rs;8b450447e58143004b68dd21c11b710fdb79be92;onenote.rs-%commit%"
+	[onenote_parser]="https://github.com/Cisco-Talos/onenote.rs;29c08532252b917543ff268284f926f30876bb79;onenote.rs-%commit%"
 )
 
 inherit cargo cmake flag-o-matic llvm python-any-r1 systemd tmpfiles
@@ -224,6 +224,10 @@ DEPEND="${COMMON_DEPEND}
 RDEPEND="${COMMON_DEPEND}
 	selinux? ( sec-policy/selinux-clamav )"
 
+PATCHES=(
+	"${FILESDIR}/${P}-pointer-types.patch"
+)
+
 python_check_deps() {
 	python_has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
 }
@@ -234,8 +238,6 @@ pkg_setup() {
 }
 
 src_prepare() {
-	eapply --dir="${WORKDIR}/onenote.rs-8b450447e58143004b68dd21c11b710fdb79be92" \
-		"${FILESDIR}/${PN}-1.3.1-onenote-rs.patch"
 	cmake_src_prepare
 }
 

diff --git a/app-antivirus/clamav/files/clamav-1.3.1-onenote-rs.patch b/app-antivirus/clamav/files/clamav-1.3.1-onenote-rs.patch
deleted file mode 100644
index d8421a269606..000000000000
--- a/app-antivirus/clamav/files/clamav-1.3.1-onenote-rs.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From bc17e5a2e1f324461024f5e3e5776085a6b6df37 Mon Sep 17 00:00:00 2001
-From: Matt Jolly <Matt.Jolly@footclan.ninja>
-Date: Mon, 24 Jun 2024 17:34:05 +1000
-Subject: [PATCH] PropertType: Specify type for custom discriminant values
-
-We use custom discriminant values for enum variants for "PropertType" without specifying the type.
-This causes it to default to "isize" which on 64bit platforms is big enough to hold the 32bit constants,
-but causes overflow when isize is 32bit.
-
-This issue was uncovered due to build failures on arm for Gentoo Linux as a dependency of ClamAV.
-
-Bug: https://bugs.gentoo.org/927214
-Signed-off-by: Matt Jolly <kangie@gentoo.org>
-Co-authored-by: Steven Newbury <steve@snewbury.org.uk>
----
- src/one/property/mod.rs | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/one/property/mod.rs b/src/one/property/mod.rs
-index 42841c6..fcc0481 100644
---- a/src/one/property/mod.rs
-+++ b/src/one/property/mod.rs
-@@ -23,6 +23,7 @@ mod references;
- pub(crate) mod simple;
- pub(crate) mod time;
- 
-+#[repr(u32)]
- #[derive(Debug, Copy, Clone, PartialEq)]
- #[allow(dead_code)]
- #[allow(clippy::enum_clike_unportable_variant)]

diff --git a/app-antivirus/clamav/files/clamav-1.4.1-pointer-types.patch b/app-antivirus/clamav/files/clamav-1.4.1-pointer-types.patch
new file mode 100644
index 000000000000..b6ad930008b6
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-1.4.1-pointer-types.patch
@@ -0,0 +1,29 @@
+From 26c465b562f08d4b4c3da688a6a3b051ddc51b01 Mon Sep 17 00:00:00 2001
+From: Matt Jolly <kangie@gentoo.org>
+Date: Mon, 23 Sep 2024 21:25:07 +1000
+Subject: [PATCH] Resolve incompatible-pointer-types
+
+Explicitly cast regex match to `const char **`; we don't modify the
+value once it's set like this; we should be safe.
+
+Signed-off-by: Matt Jolly <kangie@gentoo.org>
+---
+ libclamav/regex/engine.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libclamav/regex/engine.c b/libclamav/regex/engine.c
+index 68a1767fb..38add7d15 100644
+--- a/libclamav/regex/engine.c
++++ b/libclamav/regex/engine.c
+@@ -223,7 +223,7 @@ matcher(struct re_guts *g, const char *string, size_t nmatch,
+ 			dp = dissect(m, m->coldp, endp, gf, gl);
+ 		} else {
+ 			if (g->nplus > 0 && m->lastpos == NULL)
+-				m->lastpos = (char **)cli_max_malloc((g->nplus+1) *
++				m->lastpos = (const char **)cli_max_malloc((g->nplus+1) *
+ 							sizeof(char *));
+ 			if (g->nplus > 0 && m->lastpos == NULL) {
+ 				free(m->pmatch);
+-- 
+2.45.2
+


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2024-10-27 11:22 Andreas K. Hüttel
  0 siblings, 0 replies; 21+ messages in thread
From: Andreas K. Hüttel @ 2024-10-27 11:22 UTC (permalink / raw
  To: gentoo-commits

commit:     b8921c8cca743d458262c1d112decc3339826bf6
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 27 11:22:02 2024 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Oct 27 11:22:02 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8921c8c

app-antivirus/clamav: drop 0.103.11-r1, 0.103.12

Bug: https://bugs.gentoo.org/871252
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 app-antivirus/clamav/Manifest                      |   2 -
 app-antivirus/clamav/clamav-0.103.11-r1.ebuild     | 236 ----------
 app-antivirus/clamav/clamav-0.103.12.ebuild        | 237 -----------
 .../files/clamav-0.102.1-libxml2_pkgconfig.patch   | 120 ------
 .../files/clamav-0.102.2-fix-curl-detection.patch  |  26 --
 .../files/clamav-0.103.0-system-tomsfastmath.patch | 115 -----
 .../files/clamav-0.103.1-upstream-openrc.patch     | 474 ---------------------
 .../files/clamav-0.103.12-missing-const.patch      |  13 -
 8 files changed, 1223 deletions(-)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index d5636a04acd1..2687a67509c8 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -33,8 +33,6 @@ DIST cc-1.0.97.crate 76951 BLAKE2B ec2e65797dfe13223b64f28bf6d143e00362f8bdd14e4
 DIST cexpr-0.6.0.crate 17966 BLAKE2B cb46f066eb1f4dbac00ec86dc3e562db7ee8ea5ff17d16a60004fa020405e455b8aeb3d001f669cb33d1b62525bfd04ec657ffca4ed44a83af4a5e75b2c820e3 SHA512 766bff7ca7f9bf0885aee6f014bcfc084e7fdfcd567a49443d5340acfe8f257db109de17b24588504fc35c53f2d4303e2d22da21f73669125cfca984950cf886
 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.11.tar.gz 16550978 BLAKE2B 9fba6d5b41ef07b017be26b7ebd832ca03146a68545f794924332c67429ba27603745e2ad7fc0f58c341c6d9267e5b5265c37525dba9cbb15ab616915ec2d605 SHA512 86241ee8058d9a3ccc13b89bb41aa16cfbeb65717fbcfeea6117b7885e8854f5673c22475e7d33ee4210a15d583e806f252657c07933f072455027f1531427b8
-DIST clamav-0.103.12.tar.gz 16507685 BLAKE2B bc31787625f85867bf21c4555aa2fd2998514986fb571fa4e6cb9fa3fedf61b493c517291b662054edc0bbe8d45649d9c244d943df01950e204baa9e537e3e32 SHA512 0e870a5fd035fbf090359ef7634b1b36e346ff3066b896ff17c2c6ace04f4c17e16181a21fead8b8b2f397de9ea47b928515b717a41996bac4c8efed4d16ec4e
 DIST clamav-1.0.5.tar.gz 10344955 BLAKE2B 1deceff859c9eec6185f6c83833333d1a030edd1c9dcc6788f669259b4922f332b564a7c6f3fa7f03ebe2051524132becb35cbd67526aac43e95ca3978793517 SHA512 7d46cf5555107d2856430a5f09f5dfd011b597d3dc7e691db3c956867b1314b50fd23008bf45b377d31493a12716c527159d163748d6ae759e97a041780da0d9
 DIST clamav-1.0.7.tar.gz 10348714 BLAKE2B cd57fd9eb7ca5a4ea980cdedcf5977c1d11b28afccaa5807ada7315659dfdbd2d122af4a7cf5c0849df25b41a85b2186c5bbfe0621582955b82b2cc8dced759f SHA512 31b04c795d5a25b6b66f8dc6bb53193e969119f8682c1b5d5194629b7a075e60d2ac9e88e2ababde149e906b0c2e45a3869a0071cef4c1a6f9d5a165a7fa5c67
 DIST clamav-1.2.2.tar.gz 10372690 BLAKE2B 47940236e38296ac908be4c5d1c5ce8bbc9ec5c69fa87b2472c941d2de9642e0ab6a59c63038aa706079e8efeb161083db69ad03eaaf27a6d05f4f1a5bb70aff SHA512 32562230f367a230f70dfca5ed5000ee8829a0da7452b0113e9dbaa47ef6b21901001f741b0e52ce52c02fe8f834bd559bcbdf1ea20495bead9c4976c3a4cc92

diff --git a/app-antivirus/clamav/clamav-0.103.11-r1.ebuild b/app-antivirus/clamav/clamav-0.103.11-r1.ebuild
deleted file mode 100644
index c78491725f72..000000000000
--- a/app-antivirus/clamav/clamav-0.103.11-r1.ebuild
+++ /dev/null
@@ -1,236 +0,0 @@
-# Copyright 1999-2024 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"
-
-LICENSE="GPL-2 unRAR"
-SLOT="0/lts"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
-IUSE="bzip2 doc clamonacc clamdtop clamsubmit iconv ipv6 libclamav-only milter metadata-analysis-api selinux systemd test xml"
-
-REQUIRED_USE="libclamav-only? ( !clamonacc !clamdtop !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-6 )
-	dev-libs/tomsfastmath
-	>=sys-libs/zlib-1.2.2:=
-	bzip2? ( app-arch/bzip2 )
-	clamdtop? ( sys-libs/ncurses:0 )
-	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 )"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
-	"${FILESDIR}/${PN}-0.102.2-fix-curl-detection.patch" #709616
-	"${FILESDIR}/${PN}-0.103.0-system-tomsfastmath.patch" # 649394
-	"${FILESDIR}/${PN}-0.103.1-upstream-openrc.patch"
-)
-
-src_prepare() {
-	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 clamdtop)
-		$(use_enable ipv6)
-		$(use_enable milter)
-		$(use_enable test check)
-		$(use_with xml)
-		$(use_with iconv)
-		${JSONUSE}
-		$(use_enable libclamav-only)
-		$(use_with !libclamav-only libcurl)
-		--with-system-libmspack
-		--cache-file="${S}"/config.cache
-		--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."
-}

diff --git a/app-antivirus/clamav/clamav-0.103.12.ebuild b/app-antivirus/clamav/clamav-0.103.12.ebuild
deleted file mode 100644
index 403147a45936..000000000000
--- a/app-antivirus/clamav/clamav-0.103.12.ebuild
+++ /dev/null
@@ -1,237 +0,0 @@
-# Copyright 1999-2024 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"
-
-LICENSE="GPL-2 unRAR"
-SLOT="0/lts"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
-IUSE="bzip2 doc clamonacc clamdtop clamsubmit iconv libclamav-only milter metadata-analysis-api selinux systemd test xml"
-
-REQUIRED_USE="libclamav-only? ( !clamonacc !clamdtop !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-6 )
-	dev-libs/tomsfastmath
-	>=sys-libs/zlib-1.2.2:=
-	bzip2? ( app-arch/bzip2 )
-	clamdtop? ( sys-libs/ncurses:0 )
-	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 )"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
-	"${FILESDIR}/${PN}-0.102.2-fix-curl-detection.patch" #709616
-	"${FILESDIR}/${PN}-0.103.0-system-tomsfastmath.patch" # 649394
-	"${FILESDIR}/${PN}-0.103.1-upstream-openrc.patch"
-	"${FILESDIR}/${PN}-0.103.12-missing-const.patch"
-)
-
-src_prepare() {
-	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 clamdtop)
-		$(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-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."
-}

diff --git a/app-antivirus/clamav/files/clamav-0.102.1-libxml2_pkgconfig.patch b/app-antivirus/clamav/files/clamav-0.102.1-libxml2_pkgconfig.patch
deleted file mode 100644
index ea39173c8ba1..000000000000
--- a/app-antivirus/clamav/files/clamav-0.102.1-libxml2_pkgconfig.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From 25b9fccdae3a05561b6b7c9c82018a9a3dfec819 Mon Sep 17 00:00:00 2001
-From: Lars Wendler <polynomial-c@gentoo.org>
-Date: Mon, 25 Nov 2019 15:54:09 +0100
-Subject: [PATCH] build: Use pkg-config to find libxml2
-
-Otherwise we get unneccesary linkage to icu and other unwanted stuff
-
-Bug: https://bugzilla.clamav.net/show_bug.cgi?id=12202
-Gentoo-bug: https://bugs.gentoo.org/661328
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- m4/reorganization/libs/xml.m4 | 82 ++++++-----------------------------
- 1 file changed, 13 insertions(+), 69 deletions(-)
-
-diff --git a/m4/reorganization/libs/xml.m4 b/m4/reorganization/libs/xml.m4
-index 24f0cfa92..d143e3a47 100644
---- a/m4/reorganization/libs/xml.m4
-+++ b/m4/reorganization/libs/xml.m4
-@@ -4,85 +4,29 @@ AC_ARG_ENABLE([xml],
- [AS_HELP_STRING([--disable-xml], [do not include DMG and XAR support])],
- want_xml=$enableval, want_xml="auto")
- 
--XML_HOME=""
--xmlconfig=""
- if test "X$want_xml" != "Xno"; then
--  AC_MSG_CHECKING([for libxml2 installation])
--  AC_ARG_WITH([xml],
--    AS_HELP_STRING([--with-xml@<:@=DIR@:>@], [path to directory containing libxml2 library
--                    @<:@default=/usr/local or /usr if not found in /usr/local@:>@]),
--    [with_xml_val=$withval]
--  )
--
--  AS_IF([test "x$with_xml_val" = "xno"], [XML_HOME=""],
--    [test "x$with_xml_val" = "xyes"], [XML_HOME="/usr/local"],
--    [XML_HOME="$with_xml_val"])
--
--  AS_IF([test "x$XML_HOME" != "x"], [
--     AS_IF([test ! -x "$XML_HOME/bin/xml2-config"], [XML_HOME=""])
--     ])
--
--  AS_IF([test "x$XML_HOME" = "x" -a "x$with_xml_val" = "xyes"], [
--     AS_IF([test -x "/usr/bin/xml2-config"], [XML_HOME="/usr"])
--     ])
--
--  if test "x$XML_HOME" != "x"; then
--    AC_MSG_RESULT([$XML_HOME])
--    with_xml="yes"
--  else
--    AC_MSG_RESULT([not found])
--  fi
--
--  found_xml="no"
--  XMLCONF_VERSION=""
--  XML_CPPFLAGS=""
--  XML_LIBS=""
--  case "$with_xml" in
--    yes) AC_PATH_PROG([xmlconfig], [xml2-config])
--        if test "x$xmlconfig" = x ; then
--            AC_MSG_NOTICE([can not locate xml2-config in PATH, will search default XML_HOME variants])
--            
--            if test "x$XML_HOME" != "x"; then
--                AC_MSG_CHECKING([xml2-config version])
--                XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`"
--
--                if test "x%XMLCONF_VERSION" != "x"; then
--                    AC_MSG_RESULT([$XMLCONF_VERSION])
--                    found_xml="yes"
--                    XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`"
--                    XML_LIBS="`$XML_HOME/bin/xml2-config --libs`"
--                    AS_ECHO("$XML_CPPFLAGS")
--                    AS_ECHO("$XML_LIBS")
--                else
--                    AC_MSG_ERROR([xml2-config failed])
--                fi
--            fi
--        else
--            found_xml="yes"
--            XMLCONF_VERSION="`$xmlconfig --version`"
--            XML_CPPFLAGS="`$xmlconfig --cflags`"
--            XML_LIBS="`$xmlconfig --libs`"
--        fi
--  esac
-+    PKG_CHECK_MODULES([XML], [libxml-2.0],
-+	[found_xml=yes],
-+	[
-+	    found_xml=no
-+	    AS_IF([test "x$want_xml" = xyes],
-+		[AC_MSG_ERROR([--enable-xml set but cannot find libxml2])]
-+	    )
-+	]
-+    )
- 
-   working_xml="no"
-   if test "X$found_xml" != "Xno"; then
--
--    readerresult=""
--    if test "x$xmlconfig" = x ; then
--        readerresult="$XML_HOME/include/libxml2/libxml/xmlreader.h"
--    else
--        readerresult="`$xmlconfig --prefix`/include/libxml2/libxml/xmlreader.h"
--    fi
--    
-+    XML_HOME=$(${PKG_CONFIG} --variable prefix libxml-2.0)
-     AC_MSG_CHECKING([for xmlreader.h in $readerresult])
--    
--    if test ! -f "$readerresult"; then
-+
-+    if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then
-       AC_MSG_RESULT([not found])
-     else
-       AC_MSG_RESULT([found])
-       save_LIBS="$LIBS"
-       save_CPPFLAGS="$CPPFLAGS"
-+      XML_CPPFLAGS="$XML_CFLAGS"
-       CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
-       save_LDFLAGS="$LDFLAGS"
-       LDFLAGS="$LDFLAGS $XML_LIBS"
--- 
-2.24.0
-

diff --git a/app-antivirus/clamav/files/clamav-0.102.2-fix-curl-detection.patch b/app-antivirus/clamav/files/clamav-0.102.2-fix-curl-detection.patch
deleted file mode 100644
index f89a704ea3e0..000000000000
--- a/app-antivirus/clamav/files/clamav-0.102.2-fix-curl-detection.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-https://bugs.gentoo.org/709616
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -197,6 +197,10 @@ AC_CONFIG_FILES([
-                  clamav-types.h
-                  clamav-version.h])
- if test "x$enable_libclamav_only" != "xyes"; then
-+    if test "$have_curl" = "no"; then
-+        AC_MSG_ERROR([libcurl not found. libcurl (e.g. libcurl-devel) is required in order to build freshclam and clamsubmit.])
-+    fi
-+
-     AC_CONFIG_FILES([
-                      clamscan/Makefile
-                      database/Makefile
---- a/m4/reorganization/libs/curl.m4
-+++ b/m4/reorganization/libs/curl.m4
-@@ -92,8 +92,6 @@ if test "X$have_curl" = "Xyes"; then
-     )
- 
-     LDFLAGS="$save_LDFLAGS"
--else
--    AC_MSG_ERROR([libcurl not found. libcurl (e.g. libcurl-devel) is required in order to build freshclam and clamsubmit.])
- fi
- 
- AC_SUBST([CLAMSUBMIT_LIBS])

diff --git a/app-antivirus/clamav/files/clamav-0.103.0-system-tomsfastmath.patch b/app-antivirus/clamav/files/clamav-0.103.0-system-tomsfastmath.patch
deleted file mode 100644
index ad9276c1ad01..000000000000
--- a/app-antivirus/clamav/files/clamav-0.103.0-system-tomsfastmath.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 70cc96407302cf0fd4eee2b6a401253ed50fe4df Mon Sep 17 00:00:00 2001
-From: Michael Orlitzky <michael@orlitzky.com>
-Date: Sun, 20 Sep 2020 11:16:06 -0400
-Subject: [PATCH 1/1] autotools: use system tomsfastmath if possible.
-
----
- configure.ac                           |  2 ++
- libclamav/Makefile.am                  | 10 ++++++++--
- libclamav/bignum.h                     |  6 +++++-
- libclamav/xdp.c                        |  2 +-
- m4/reorganization/libs/tomsfastmath.m4 | 12 ++++++++++++
- 5 files changed, 28 insertions(+), 4 deletions(-)
- create mode 100644 m4/reorganization/libs/tomsfastmath.m4
-
-diff --git a/configure.ac b/configure.ac
-index 8e0e810f8..773787e49 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -104,6 +104,7 @@ m4_include([m4/reorganization/libs/libmspack.m4])
- if test "x$use_internal_mspack" = "xno"; then
-     mspack_msg="External, $LIBMSPACK_CFLAGS $LIBMSPACK_LIBS"
- fi
-+m4_include([m4/reorganization/libs/tomsfastmath.m4])
- 
- AM_MAINTAINER_MODE
- m4_include([m4/reorganization/libs/libz.m4])
-@@ -376,6 +377,7 @@ fi
- CL_MSG_STATUS([yara        ],[$enable_yara],[$enable_yara])
- CL_MSG_STATUS([fts         ],[yes],[$lfs_fts_msg])
- 
-+CL_MSG_STATUS([tomsfastmath],[yes],[$tomsfastmath_msg])
- 
- # Yep, downgrading the compiler avoids the bug too:
- # 4.0.x, and 4.1.0 are the known buggy versions
-diff --git a/libclamav/Makefile.am b/libclamav/Makefile.am
-index ae655cfec..240fa23f8 100644
---- a/libclamav/Makefile.am
-+++ b/libclamav/Makefile.am
-@@ -588,8 +588,10 @@ libclamav_la_SOURCES += yara_arena.c \
- 	yara_clam.h
- endif
- 
--libclamav_la_SOURCES += bignum.h\
--	bignum_fast.h\
-+libclamav_la_SOURCES += bignum.h
-+
-+if !SYSTEM_TOMSFASTMATH
-+libclamav_la_SOURCES += bignum_fast.h\
- 	tomsfastmath/addsub/fp_add.c\
- 	tomsfastmath/addsub/fp_add_d.c\
- 	tomsfastmath/addsub/fp_addmod.c\
-@@ -671,6 +673,10 @@ libclamav_la_SOURCES += bignum.h\
- 	tomsfastmath/sqr/fp_sqr_comba_generic.c\
- 	tomsfastmath/sqr/fp_sqr_comba_small_set.c\
- 	tomsfastmath/sqr/fp_sqrmod.c
-+else
-+libclamav_la_CFLAGS += $(TOMSFASTMATH_CFLAGS)
-+libclamav_la_LIBADD += $(TOMSFASTMATH_LIBS)
-+endif
- 
- .PHONY2: version.h.tmp
- version.c: version.h
-diff --git a/libclamav/bignum.h b/libclamav/bignum.h
-index 8fdc956bb..56dfa957e 100644
---- a/libclamav/bignum.h
-+++ b/libclamav/bignum.h
-@@ -1,9 +1,13 @@
- #ifndef BIGNUM_H_
- #define BIGNUM_H_
- 
-+#if HAVE_SYSTEM_TOMSFASTMATH
-+#include <tfm.h>
-+#else
- #define TFM_CHECK
--
- #include "bignum_fast.h"
-+#endif
-+
- typedef fp_int mp_int;
- #define mp_cmp fp_cmp
- #define mp_toradix_n(a, b, c, d) fp_toradix_n(a, b, c, d)
-diff --git a/libclamav/xdp.c b/libclamav/xdp.c
-index 87423421d..6370221ff 100644
---- a/libclamav/xdp.c
-+++ b/libclamav/xdp.c
-@@ -52,7 +52,7 @@
- #include "scanners.h"
- #include "conv.h"
- #include "xdp.h"
--#include "bignum_fast.h"
-+#include "bignum.h"
- #include "filetypes.h"
- 
- static char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz);
-diff --git a/m4/reorganization/libs/tomsfastmath.m4 b/m4/reorganization/libs/tomsfastmath.m4
-new file mode 100644
-index 000000000..2a821a14d
---- /dev/null
-+++ b/m4/reorganization/libs/tomsfastmath.m4
-@@ -0,0 +1,12 @@
-+dnl Check for system tomsfastmath
-+PKG_CHECK_MODULES([TOMSFASTMATH], [tomsfastmath], [have_system_tomsfastmath=yes], [have_system_tomsfastmath=no])
-+
-+AM_CONDITIONAL([SYSTEM_TOMSFASTMATH], [test "x$have_system_tomsfastmath" = "xyes"])
-+
-+if test "x$have_system_tomsfastmath" = "xyes"; then
-+    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [1], [link against system-wide tomsfastmath library])
-+    tomsfastmath_msg="External, $TOMSFASTMATH_CFLAGS $TOMSFASTMATH_LIBS"
-+else
-+    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [0], [don't link against system-wide tomsfastmath library])
-+    tomsfastmath_msg="Internal"
-+fi
--- 
-2.26.2
-

diff --git a/app-antivirus/clamav/files/clamav-0.103.1-upstream-openrc.patch b/app-antivirus/clamav/files/clamav-0.103.1-upstream-openrc.patch
deleted file mode 100644
index a37d44fa934d..000000000000
--- a/app-antivirus/clamav/files/clamav-0.103.1-upstream-openrc.patch
+++ /dev/null
@@ -1,474 +0,0 @@
-From 7d7ca4f425909368cd78cd587120703754bcd608 Mon Sep 17 00:00:00 2001
-From: Michael Orlitzky <michael@orlitzky.com>
-Date: Tue, 9 Feb 2021 14:24:09 -0500
-Subject: [PATCH 1/1] Add OpenRC service scripts integrated with the build
- system.
-
----
- Makefile.am                                   | 11 ++++++
- clamav-milter/Makefile.am                     | 21 ++++++++++++
- clamav-milter/openrc/clamav-milter.in.in      | 34 +++++++++++++++++++
- clamd/Makefile.am                             | 19 +++++++++++
- clamd/openrc/clamd.in.in                      | 33 ++++++++++++++++++
- clamonacc/Makefile.am                         | 19 +++++++++++
- clamonacc/openrc/clamonacc.in.in              | 18 ++++++++++
- configure.ac                                  | 16 ++++++++-
- etc/Makefile.am                               | 22 +++++++++++-
- ...sample => clamav-milter.conf.sample.in.in} |  5 +--
- ...md.conf.sample => clamd.conf.sample.in.in} |  4 +--
- ...onf.sample => freshclam.conf.sample.in.in} |  2 +-
- freshclam/Makefile.am                         | 20 +++++++++++
- freshclam/openrc/freshclam.in.in              |  8 +++++
- m4/reorganization/libs/openrc.m4              |  8 +++++
- 15 files changed, 233 insertions(+), 7 deletions(-)
- create mode 100644 clamav-milter/openrc/clamav-milter.in.in
- create mode 100644 clamd/openrc/clamd.in.in
- create mode 100644 clamonacc/openrc/clamonacc.in.in
- rename etc/{clamav-milter.conf.sample => clamav-milter.conf.sample.in.in} (98%)
- rename etc/{clamd.conf.sample => clamd.conf.sample.in.in} (99%)
- rename etc/{freshclam.conf.sample => freshclam.conf.sample.in.in} (99%)
- create mode 100644 freshclam/openrc/freshclam.in.in
- create mode 100644 m4/reorganization/libs/openrc.m4
-
-diff --git a/Makefile.am b/Makefile.am
-index 42a58e7..c4d82ad 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -52,6 +52,17 @@ nodist_include_HEADERS = clamav-types.h clamav-version.h
- distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print
- DISTCLEANFILES = target.h
- DISTCHECK_CONFIGURE_FLAGS=--enable-milter --disable-clamav --enable-all-jit-targets --enable-llvm=yes --with-system-llvm=no --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) CC="$(CC)" CXX="$(CXX)" YACC="$(YACC)" LEX="$(LEX)" AR="$(AR)" AS="$(AS)"
-+
-+
-+# This command allows us to replace bindir, libdir, etc.
-+# within our script and conf file. The example is taken
-+# from the autoconf documentation and can be found in the
-+# "Installation Directory Variables" section.
-+editgnudirs = sed -e 's|@BINDIR[@]|$(bindir)|g' \
-+                  -e 's|@SBINDIR[@]|$(sbindir)|g' \
-+                  -e 's|@RUNSTATEDIR[@]|$(runstatedir)|g'
-+export editgnudirs
-+
- lcov:
- 	($(MAKE); cd unit_tests; $(MAKE) lcov)
- quick-check:
-diff --git a/clamav-milter/Makefile.am b/clamav-milter/Makefile.am
-index 38d9b94..46885a7 100644
---- a/clamav-milter/Makefile.am
-+++ b/clamav-milter/Makefile.am
-@@ -35,6 +35,27 @@ clamav_milter_SOURCES = \
- man_MANS = $(top_builddir)/docs/man/clamav-milter.8
- AM_CFLAGS=@WERR_CFLAGS_MILTER@
- 
-+
-+if INSTALL_OPENRC_SERVICES
-+
-+openrcdir = $(sysconfdir)/init.d
-+
-+# The next rule allows us to replace @RUNSTATEDIR@ and friends within
-+# our OpenRC service scripts. This example is taken from the autoconf
-+# documentation in the "Installation Directory Variables" section.
-+openrc_SCRIPTS_src = openrc/clamav-milter.in.in
-+openrc_SCRIPTS_intermediate = openrc/clamav-milter.in
-+nodist_openrc_SCRIPTS = openrc/clamav-milter
-+DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
-+$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
-+	rm -f $@ $@.tmp
-+	$(editgnudirs) $@.in > $@.tmp
-+	mv $@.tmp $@
-+
-+endif
-+EXTRA_DIST = $(openrc_SCRIPTS_src)
-+
-+
- endif
- 
- LIBS = $(top_builddir)/libclamav/libclamav.la $(top_builddir)/shared/libshared.la @CLAMAV_MILTER_LIBS@ @THREAD_LIBS@
-diff --git a/clamav-milter/openrc/clamav-milter.in.in b/clamav-milter/openrc/clamav-milter.in.in
-new file mode 100644
-index 0000000..7105356
---- /dev/null
-+++ b/clamav-milter/openrc/clamav-milter.in.in
-@@ -0,0 +1,34 @@
-+#!/sbin/openrc-run
-+
-+# Note: the "Foreground" option in clamav-milter.conf MUST
-+# be set to "no".
-+command="@SBINDIR@/clamav-milter"
-+
-+# For now, must be manually synchronized with the PidFile
-+# variable in clamav-milter.conf.
-+#
-+# https://bugzilla.clamav.net/show_bug.cgi?id=12595
-+#
-+pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
-+
-+depend() {
-+  # The milter can successfully launch without clamd, but it's not a
-+  # great user experience to have the milter start accepting requests
-+  # that it can't process. The "use" dependency below will start clamd
-+  # before clamav-milter, so long as clamd is also present this runlevel.
-+  use clamd
-+}
-+
-+start_pre() {
-+  # This exists to support the (disabled) default MilterSocket setting
-+  # within clamav-milter.conf. The "clamav" user and group agree with
-+  # the (disabled) default "User" and "MilterSocketGroup" settings.
-+  #
-+  # Creating this directory is harmless even when a local socket is
-+  # not used. In fact, the clamd service that we depend on should
-+  # create it as well, to hold its own local socket (if enabled).
-+  checkpath --directory \
-+           --mode 0755 \
-+           --owner clamav:clamav \
-+           "@RUNSTATEDIR@/clamav"
-+}
-diff --git a/clamd/Makefile.am b/clamd/Makefile.am
-index c161586..b59d94c 100644
---- a/clamd/Makefile.am
-+++ b/clamd/Makefile.am
-@@ -44,6 +44,25 @@ if INSTALL_SYSTEMD_UNITS
- systemdsystemunit_DATA = clamav-daemon.socket clamav-daemon.service
- endif
- 
-+if INSTALL_OPENRC_SERVICES
-+
-+openrcdir = $(sysconfdir)/init.d
-+
-+# The next rule allows us to replace @RUNSTATEDIR@ and friends within
-+# our OpenRC service scripts. This example is taken from the autoconf
-+# documentation in the "Installation Directory Variables" section.
-+openrc_SCRIPTS_src = openrc/clamd.in.in
-+openrc_SCRIPTS_intermediate = openrc/clamd.in
-+nodist_openrc_SCRIPTS = openrc/clamd
-+DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
-+$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
-+	rm -f $@ $@.tmp
-+	$(editgnudirs) $@.in > $@.tmp
-+	mv $@.tmp $@
-+
-+endif
-+EXTRA_DIST = $(openrc_SCRIPTS_src)
-+
- LIBS = $(top_builddir)/libclamav/libclamav.la $(top_builddir)/shared/libshared.la @CLAMD_LIBS@ @THREAD_LIBS@
- AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface @SSL_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
- 
-diff --git a/clamd/openrc/clamd.in.in b/clamd/openrc/clamd.in.in
-new file mode 100644
-index 0000000..5d38f9a
---- /dev/null
-+++ b/clamd/openrc/clamd.in.in
-@@ -0,0 +1,33 @@
-+#!/sbin/openrc-run
-+
-+# Note: the "Foreground" option in clamd.conf must be set to "no"
-+command="@SBINDIR@/clamd"
-+extra_started_commands="reload"
-+
-+# For now, must be manually synchronized with the PidFile variable
-+# in clamd.conf.
-+#
-+# https://bugzilla.clamav.net/show_bug.cgi?id=12595
-+#
-+pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
-+
-+start_pre() {
-+  # This exists to support the (disabled) default LocalSocket setting
-+  # within clamd.conf. The "clamav" user and group agree with the
-+  # (disabled) default "User" and "LocalSocketGroup" settings in
-+  # clamd.conf. And everything here agrees with the
-+  # clamav-daemon.socket systemd service.
-+  #
-+  # Creating this directory is harmless even when a local socket is
-+  # not used.
-+  checkpath --directory \
-+           --mode 0755 \
-+           --owner clamav:clamav \
-+           "@RUNSTATEDIR@/clamav"
-+}
-+
-+reload() {
-+  ebegin "Reloading ${RC_SVCNAME}"
-+  "@BINDIR@/clamdscan" --reload
-+  eend $?
-+}
-diff --git a/clamonacc/Makefile.am b/clamonacc/Makefile.am
-index 4cb4886..39c2e5d 100644
---- a/clamonacc/Makefile.am
-+++ b/clamonacc/Makefile.am
-@@ -58,6 +58,25 @@ if INSTALL_SYSTEMD_UNITS
- systemdsystemunit_DATA = clamav-clamonacc.service
- endif
- 
-+if INSTALL_OPENRC_SERVICES
-+
-+openrcdir = $(sysconfdir)/init.d
-+
-+# The next rules allow us to replace @RUNSTATEDIR@ and friends within
-+# our OpenRC service scripts. This example is taken from the autoconf
-+# documentation in the "Installation Directory Variables" section.
-+openrc_SCRIPTS_src = openrc/clamonacc.in.in
-+openrc_SCRIPTS_intermediate = openrc/clamonacc.in
-+nodist_openrc_SCRIPTS = openrc/clamonacc
-+DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
-+$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
-+	rm -f $@ $@.tmp
-+	$(editgnudirs) $@.in > $@.tmp
-+	mv $@.tmp $@
-+
-+endif
-+EXTRA_DIST = $(openrc_SCRIPTS_src)
-+
- LIBS = $(top_builddir)/shared/libshared.la $(top_builddir)/libclamav/libclamav.la @CURL_LIBS@ @CLAMONACC_LIBS@ @THREAD_LIBS@
- AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/clamonacc -I$(top_srcdir)/shared -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface @CURL_CPPFLAGS@ @SSL_CPPFLAGS@ @CLAMONACC_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
- 
-diff --git a/clamonacc/openrc/clamonacc.in.in b/clamonacc/openrc/clamonacc.in.in
-new file mode 100644
-index 0000000..844cd49
---- /dev/null
-+++ b/clamonacc/openrc/clamonacc.in.in
-@@ -0,0 +1,18 @@
-+#!/sbin/openrc-run
-+
-+command="@SBINDIR@/clamonacc"
-+pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
-+
-+# clamonacc doesn't support a PID file at the moment, so we
-+# run it in the foreground and let OpenRC background it.
-+#
-+# https://bugzilla.clamav.net/show_bug.cgi?id=12595
-+#
-+command_args="--foreground"
-+command_background=true
-+
-+depend() {
-+  # Unlike the milter, the on-access scanner will simply fail to start
-+  # until clamd is available.
-+  need clamd
-+}
-diff --git a/configure.ac b/configure.ac
-index 33e252e..c8cd60f 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -79,6 +79,12 @@ if test "$enable_experimental" = "yes"; then
-   VERSION_SUFFIX="$VERSION_SUFFIX-exp"
- fi
- 
-+# Autoconf 2.70 will support this, and many distros patch it in,
-+# but Autoconf 2.70 hasn't actually been released yet (it's in beta).
-+AS_IF([test -z "${runstatedir}"], [runstatedir='${localstatedir}/run'])
-+AC_SUBST([runstatedir])
-+
-+
- build_configure_args=`echo "$ac_configure_args" | sed -e 's/[\"]//g'`
- AC_SUBST([BUILD_CONFIGURE_FLAGS], [$build_configure_args])
- 
-@@ -105,6 +111,7 @@ m4_include([m4/reorganization/libs/libz.m4])
- m4_include([m4/reorganization/libs/bzip.m4])
- m4_include([m4/reorganization/libs/unrar.m4])
- m4_include([m4/reorganization/libs/systemd.m4])
-+m4_include([m4/reorganization/libs/openrc.m4])
- m4_include([m4/reorganization/code_checks/ipv6.m4])
- m4_include([m4/reorganization/code_checks/dns.m4])
- m4_include([m4/reorganization/code_checks/fanotify.m4])
-@@ -193,7 +200,10 @@ AC_CONFIG_FILES([
-                  libclamav.pc
-                  platform.h
-                  clamav-types.h
--                 clamav-version.h])
-+                 clamav-version.h
-+                 etc/clamd.conf.sample.in
-+                 etc/clamav-milter.conf.sample.in
-+                 etc/freshclam.conf.sample.in])
- if test "x$enable_libclamav_only" != "xyes"; then
-     if test "$have_curl" = "no"; then
-         AC_MSG_ERROR([libcurl not found. libcurl (e.g. libcurl-devel) is required in order to build freshclam and clamsubmit.])
-@@ -207,10 +217,14 @@ if test "x$enable_libclamav_only" != "xyes"; then
-                      clamd/Makefile
-                      clamd/clamav-daemon.service
-                      clamd/clamav-daemon.socket
-+                     clamd/openrc/clamd.in
-                      clamdscan/Makefile
-                      clamsubmit/Makefile
-+                     clamonacc/openrc/clamonacc.in
-                      clamav-milter/Makefile
-+                     clamav-milter/openrc/clamav-milter.in
-                      freshclam/clamav-freshclam.service
-+                     freshclam/openrc/freshclam.in
-                      freshclam/Makefile
-                      sigtool/Makefile
-                      clamconf/Makefile
-diff --git a/etc/Makefile.am b/etc/Makefile.am
-index c694856..213a978 100644
---- a/etc/Makefile.am
-+++ b/etc/Makefile.am
-@@ -18,11 +18,31 @@
- #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- #  MA 02110-1301, USA.
- 
--EXTRA_DIST = clamd.conf.sample freshclam.conf.sample clamav-milter.conf.sample
-+EXTRA_DIST = clamd.conf.sample.in.in \
-+             freshclam.conf.sample.in.in \
-+             clamav-milter.conf.sample.in.in
- CFGINST = @CFGDIR@
- 
- sysconf_DATA = clamd.conf.sample freshclam.conf.sample
- 
-+# Custom variable to simplify the "edit" rule below.
-+sysconf_DATA_intermediate = clamd.conf.sample.in freshclam.conf.sample.in
-+
- if HAVE_MILTER
- sysconf_DATA += clamav-milter.conf.sample
-+sysconf_DATA_intermediate += clamav-milter.conf.sample.in
- endif
-+
-+# Otherwise these don't get cleaned up by "make distclean",
-+# even though they are auto-generated.
-+DISTCLEANFILES = $(sysconf_DATA) $(sysconf_DATA_intermediate)
-+
-+# This rule includes EVERY source/intermediate file as a dependency of
-+# EVERY output file, which is clearly wrong, but it may be the best we
-+# can do without duplication. At least it's the right kind of wrong,
-+# and rebuilds too often rather than not often enough.
-+$(sysconf_DATA): $(sysconf_DATA_intermediate) $(EXTRA_DIST) Makefile
-+	rm -f $@ $@.tmp
-+	$(editgnudirs) $@.in > $@.tmp
-+	mv $@.tmp $@
-+
-diff --git a/etc/clamav-milter.conf.sample b/etc/clamav-milter.conf.sample.in.in
-similarity index 98%
-rename from etc/clamav-milter.conf.sample
-rename to etc/clamav-milter.conf.sample.in.in
-index bf46b4f..c3c5d20 100644
---- a/etc/clamav-milter.conf.sample
-+++ b/etc/clamav-milter.conf.sample.in.in
-@@ -17,7 +17,7 @@ Example
- # inet6:port@[hostname|ip-address] - to specify an ipv6 socket
- #
- # Default: no default
--#MilterSocket /tmp/clamav-milter.socket
-+#MilterSocket unix:@RUNSTATEDIR@/clamav/clamav-milter.socket
- #MilterSocket inet:7357
- 
- # Define the group ownership for the (unix) milter socket.
-@@ -64,7 +64,7 @@ Example
- # also owned by root to keep other users from tampering with it.
- #
- # Default: disabled
--#PidFile /var/run/clamav-milter.pid
-+#PidFile @RUNSTATEDIR@/clamav-milter.pid
- 
- # Optional path to the global temporary directory.
- # Default: system specific (usually /tmp or /var/tmp).
-@@ -91,6 +91,7 @@ Example
- # fashion.
- #
- # Default: no default
-+#ClamdSocket unix:@RUNSTATEDIR@/clamav/clamd.ctl
- #ClamdSocket tcp:scanner.mydomain:7357
- 
- 
-diff --git a/etc/clamd.conf.sample b/etc/clamd.conf.sample.in.in
-similarity index 99%
-rename from etc/clamd.conf.sample
-rename to etc/clamd.conf.sample.in.in
-index a1ca9ec..82ef42c 100644
---- a/etc/clamd.conf.sample
-+++ b/etc/clamd.conf.sample.in.in
-@@ -74,7 +74,7 @@ Example
- # It is recommended that the directory where this file is stored is
- # also owned by root to keep other users from tampering with it.
- # Default: disabled
--#PidFile /var/run/clamd.pid
-+#PidFile @RUNSTATEDIR@/clamd.pid
- 
- # Optional path to the global temporary directory.
- # Default: system specific (usually /tmp or /var/tmp).
-@@ -93,7 +93,7 @@ Example
- 
- # Path to a local socket file the daemon will listen on.
- # Default: disabled (must be specified by a user)
--#LocalSocket /tmp/clamd.socket
-+#LocalSocket @RUNSTATEDIR@/clamav/clamd.ctl
- 
- # Sets the group ownership on the unix socket.
- # Default: disabled (the primary group of the user running clamd)
-diff --git a/etc/freshclam.conf.sample b/etc/freshclam.conf.sample.in.in
-similarity index 99%
-rename from etc/freshclam.conf.sample
-rename to etc/freshclam.conf.sample.in.in
-index 8f4dd49..5a5c42b 100644
---- a/etc/freshclam.conf.sample
-+++ b/etc/freshclam.conf.sample.in.in
-@@ -51,7 +51,7 @@ Example
- # It is recommended that the directory where this file is stored is
- # also owned by root to keep other users from tampering with it.
- # Default: disabled
--#PidFile /var/run/freshclam.pid
-+#PidFile @RUNSTATEDIR@/freshclam.pid
- 
- # By default when started freshclam drops privileges and switches to the
- # "clamav" user. This directive allows you to change the database owner.
-diff --git a/freshclam/Makefile.am b/freshclam/Makefile.am
-index 9e48119..46ef224 100644
---- a/freshclam/Makefile.am
-+++ b/freshclam/Makefile.am
-@@ -32,6 +32,26 @@ if INSTALL_SYSTEMD_UNITS
- systemdsystemunit_DATA = clamav-freshclam.service
- endif
- 
-+if INSTALL_OPENRC_SERVICES
-+
-+openrcdir = $(sysconfdir)/init.d
-+
-+# The next rule allows us to replace @RUNSTATEDIR@ and friends within
-+# our OpenRC service scripts. This example is taken from the autoconf
-+# documentation in the "Installation Directory Variables" section.
-+openrc_SCRIPTS_src = openrc/freshclam.in.in
-+openrc_SCRIPTS_intermediate = openrc/freshclam.in
-+nodist_openrc_SCRIPTS = openrc/freshclam
-+DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
-+$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
-+	rm -f $@ $@.tmp
-+	$(editgnudirs) $@.in > $@.tmp
-+	mv $@.tmp $@
-+
-+endif
-+EXTRA_DIST = $(openrc_SCRIPTS_src)
-+
-+
- AM_CFLAGS=@WERR_CFLAGS@
- DEFS = @DEFS@
- AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface -I$(top_srcdir)/libfreshclam @CURL_CPPFLAGS@ @SSL_CPPFLAGS@ @FRESHCLAM_CPPFLAGS@ @ZLIB_CFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
-diff --git a/freshclam/openrc/freshclam.in.in b/freshclam/openrc/freshclam.in.in
-new file mode 100644
-index 0000000..9feb737
---- /dev/null
-+++ b/freshclam/openrc/freshclam.in.in
-@@ -0,0 +1,8 @@
-+#!/sbin/openrc-run
-+
-+command="@BINDIR@/freshclam"
-+pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
-+
-+# Ignore the value of "PidFile" set in freshclam.conf.
-+command_args="-p ${pidfile}"
-+command_args_background="--daemon"
-diff --git a/m4/reorganization/libs/openrc.m4 b/m4/reorganization/libs/openrc.m4
-new file mode 100644
-index 0000000..1a73d15
---- /dev/null
-+++ b/m4/reorganization/libs/openrc.m4
-@@ -0,0 +1,8 @@
-+dnl Should we install our OpenRC service files?
-+AC_ARG_ENABLE([openrc],
-+              AS_HELP_STRING([--enable-openrc],
-+                             [Install OpenRC service files]),
-+              [],
-+              [enable_openrc=no])
-+AM_CONDITIONAL(INSTALL_OPENRC_SERVICES,
-+               [test "x$enable_openrc" = "xyes"])
--- 
-2.26.2
-

diff --git a/app-antivirus/clamav/files/clamav-0.103.12-missing-const.patch b/app-antivirus/clamav/files/clamav-0.103.12-missing-const.patch
deleted file mode 100644
index 39b98b7f4732..000000000000
--- a/app-antivirus/clamav/files/clamav-0.103.12-missing-const.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/libclamav/regex/engine.c b/libclamav/regex/engine.c
-index ed359c3..3c25398 100644
---- a/libclamav/regex/engine.c
-+++ b/libclamav/regex/engine.c
-@@ -223,7 +223,7 @@ matcher(struct re_guts *g, const char *string, size_t nmatch,
- 			dp = dissect(m, m->coldp, endp, gf, gl);
- 		} else {
- 			if (g->nplus > 0 && m->lastpos == NULL)
--				m->lastpos = (char **)cli_malloc((g->nplus+1) *
-+				m->lastpos = (const char **)cli_malloc((g->nplus+1) *
- 							sizeof(char *));
- 			if (g->nplus > 0 && m->lastpos == NULL) {
- 				free(m->pmatch);


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
@ 2024-10-27 11:32 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2024-10-27 11:32 UTC (permalink / raw
  To: gentoo-commits

commit:     43ffce837b38f6dcded86950884b9e2b55d01357
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 27 11:26:36 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sun Oct 27 11:32:00 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43ffce83

app-antivirus/clamav: revert "drop 0.103.11-r1, 0.103.12"

I'm sure this looks like old junk, but it's the last version in the tree
that doesn't require rust / bundle a bunch of libraries, and it's still
supported.

Reverts: b8921c8cca743d458262c1d112decc3339826bf6
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 app-antivirus/clamav/Manifest                      |   2 +
 app-antivirus/clamav/clamav-0.103.11-r1.ebuild     | 236 ++++++++++
 app-antivirus/clamav/clamav-0.103.12.ebuild        | 237 +++++++++++
 .../files/clamav-0.102.1-libxml2_pkgconfig.patch   | 120 ++++++
 .../files/clamav-0.102.2-fix-curl-detection.patch  |  26 ++
 .../files/clamav-0.103.0-system-tomsfastmath.patch | 115 +++++
 .../files/clamav-0.103.1-upstream-openrc.patch     | 474 +++++++++++++++++++++
 .../files/clamav-0.103.12-missing-const.patch      |  13 +
 8 files changed, 1223 insertions(+)

diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index 2687a67509c8..d5636a04acd1 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -33,6 +33,8 @@ DIST cc-1.0.97.crate 76951 BLAKE2B ec2e65797dfe13223b64f28bf6d143e00362f8bdd14e4
 DIST cexpr-0.6.0.crate 17966 BLAKE2B cb46f066eb1f4dbac00ec86dc3e562db7ee8ea5ff17d16a60004fa020405e455b8aeb3d001f669cb33d1b62525bfd04ec657ffca4ed44a83af4a5e75b2c820e3 SHA512 766bff7ca7f9bf0885aee6f014bcfc084e7fdfcd567a49443d5340acfe8f257db109de17b24588504fc35c53f2d4303e2d22da21f73669125cfca984950cf886
 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.11.tar.gz 16550978 BLAKE2B 9fba6d5b41ef07b017be26b7ebd832ca03146a68545f794924332c67429ba27603745e2ad7fc0f58c341c6d9267e5b5265c37525dba9cbb15ab616915ec2d605 SHA512 86241ee8058d9a3ccc13b89bb41aa16cfbeb65717fbcfeea6117b7885e8854f5673c22475e7d33ee4210a15d583e806f252657c07933f072455027f1531427b8
+DIST clamav-0.103.12.tar.gz 16507685 BLAKE2B bc31787625f85867bf21c4555aa2fd2998514986fb571fa4e6cb9fa3fedf61b493c517291b662054edc0bbe8d45649d9c244d943df01950e204baa9e537e3e32 SHA512 0e870a5fd035fbf090359ef7634b1b36e346ff3066b896ff17c2c6ace04f4c17e16181a21fead8b8b2f397de9ea47b928515b717a41996bac4c8efed4d16ec4e
 DIST clamav-1.0.5.tar.gz 10344955 BLAKE2B 1deceff859c9eec6185f6c83833333d1a030edd1c9dcc6788f669259b4922f332b564a7c6f3fa7f03ebe2051524132becb35cbd67526aac43e95ca3978793517 SHA512 7d46cf5555107d2856430a5f09f5dfd011b597d3dc7e691db3c956867b1314b50fd23008bf45b377d31493a12716c527159d163748d6ae759e97a041780da0d9
 DIST clamav-1.0.7.tar.gz 10348714 BLAKE2B cd57fd9eb7ca5a4ea980cdedcf5977c1d11b28afccaa5807ada7315659dfdbd2d122af4a7cf5c0849df25b41a85b2186c5bbfe0621582955b82b2cc8dced759f SHA512 31b04c795d5a25b6b66f8dc6bb53193e969119f8682c1b5d5194629b7a075e60d2ac9e88e2ababde149e906b0c2e45a3869a0071cef4c1a6f9d5a165a7fa5c67
 DIST clamav-1.2.2.tar.gz 10372690 BLAKE2B 47940236e38296ac908be4c5d1c5ce8bbc9ec5c69fa87b2472c941d2de9642e0ab6a59c63038aa706079e8efeb161083db69ad03eaaf27a6d05f4f1a5bb70aff SHA512 32562230f367a230f70dfca5ed5000ee8829a0da7452b0113e9dbaa47ef6b21901001f741b0e52ce52c02fe8f834bd559bcbdf1ea20495bead9c4976c3a4cc92

diff --git a/app-antivirus/clamav/clamav-0.103.11-r1.ebuild b/app-antivirus/clamav/clamav-0.103.11-r1.ebuild
new file mode 100644
index 000000000000..c78491725f72
--- /dev/null
+++ b/app-antivirus/clamav/clamav-0.103.11-r1.ebuild
@@ -0,0 +1,236 @@
+# Copyright 1999-2024 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"
+
+LICENSE="GPL-2 unRAR"
+SLOT="0/lts"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="bzip2 doc clamonacc clamdtop clamsubmit iconv ipv6 libclamav-only milter metadata-analysis-api selinux systemd test xml"
+
+REQUIRED_USE="libclamav-only? ( !clamonacc !clamdtop !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-6 )
+	dev-libs/tomsfastmath
+	>=sys-libs/zlib-1.2.2:=
+	bzip2? ( app-arch/bzip2 )
+	clamdtop? ( sys-libs/ncurses:0 )
+	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 )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
+	"${FILESDIR}/${PN}-0.102.2-fix-curl-detection.patch" #709616
+	"${FILESDIR}/${PN}-0.103.0-system-tomsfastmath.patch" # 649394
+	"${FILESDIR}/${PN}-0.103.1-upstream-openrc.patch"
+)
+
+src_prepare() {
+	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 clamdtop)
+		$(use_enable ipv6)
+		$(use_enable milter)
+		$(use_enable test check)
+		$(use_with xml)
+		$(use_with iconv)
+		${JSONUSE}
+		$(use_enable libclamav-only)
+		$(use_with !libclamav-only libcurl)
+		--with-system-libmspack
+		--cache-file="${S}"/config.cache
+		--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."
+}

diff --git a/app-antivirus/clamav/clamav-0.103.12.ebuild b/app-antivirus/clamav/clamav-0.103.12.ebuild
new file mode 100644
index 000000000000..403147a45936
--- /dev/null
+++ b/app-antivirus/clamav/clamav-0.103.12.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2024 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"
+
+LICENSE="GPL-2 unRAR"
+SLOT="0/lts"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="bzip2 doc clamonacc clamdtop clamsubmit iconv libclamav-only milter metadata-analysis-api selinux systemd test xml"
+
+REQUIRED_USE="libclamav-only? ( !clamonacc !clamdtop !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-6 )
+	dev-libs/tomsfastmath
+	>=sys-libs/zlib-1.2.2:=
+	bzip2? ( app-arch/bzip2 )
+	clamdtop? ( sys-libs/ncurses:0 )
+	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 )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
+	"${FILESDIR}/${PN}-0.102.2-fix-curl-detection.patch" #709616
+	"${FILESDIR}/${PN}-0.103.0-system-tomsfastmath.patch" # 649394
+	"${FILESDIR}/${PN}-0.103.1-upstream-openrc.patch"
+	"${FILESDIR}/${PN}-0.103.12-missing-const.patch"
+)
+
+src_prepare() {
+	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 clamdtop)
+		$(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-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."
+}

diff --git a/app-antivirus/clamav/files/clamav-0.102.1-libxml2_pkgconfig.patch b/app-antivirus/clamav/files/clamav-0.102.1-libxml2_pkgconfig.patch
new file mode 100644
index 000000000000..ea39173c8ba1
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.102.1-libxml2_pkgconfig.patch
@@ -0,0 +1,120 @@
+From 25b9fccdae3a05561b6b7c9c82018a9a3dfec819 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Mon, 25 Nov 2019 15:54:09 +0100
+Subject: [PATCH] build: Use pkg-config to find libxml2
+
+Otherwise we get unneccesary linkage to icu and other unwanted stuff
+
+Bug: https://bugzilla.clamav.net/show_bug.cgi?id=12202
+Gentoo-bug: https://bugs.gentoo.org/661328
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ m4/reorganization/libs/xml.m4 | 82 ++++++-----------------------------
+ 1 file changed, 13 insertions(+), 69 deletions(-)
+
+diff --git a/m4/reorganization/libs/xml.m4 b/m4/reorganization/libs/xml.m4
+index 24f0cfa92..d143e3a47 100644
+--- a/m4/reorganization/libs/xml.m4
++++ b/m4/reorganization/libs/xml.m4
+@@ -4,85 +4,29 @@ AC_ARG_ENABLE([xml],
+ [AS_HELP_STRING([--disable-xml], [do not include DMG and XAR support])],
+ want_xml=$enableval, want_xml="auto")
+ 
+-XML_HOME=""
+-xmlconfig=""
+ if test "X$want_xml" != "Xno"; then
+-  AC_MSG_CHECKING([for libxml2 installation])
+-  AC_ARG_WITH([xml],
+-    AS_HELP_STRING([--with-xml@<:@=DIR@:>@], [path to directory containing libxml2 library
+-                    @<:@default=/usr/local or /usr if not found in /usr/local@:>@]),
+-    [with_xml_val=$withval]
+-  )
+-
+-  AS_IF([test "x$with_xml_val" = "xno"], [XML_HOME=""],
+-    [test "x$with_xml_val" = "xyes"], [XML_HOME="/usr/local"],
+-    [XML_HOME="$with_xml_val"])
+-
+-  AS_IF([test "x$XML_HOME" != "x"], [
+-     AS_IF([test ! -x "$XML_HOME/bin/xml2-config"], [XML_HOME=""])
+-     ])
+-
+-  AS_IF([test "x$XML_HOME" = "x" -a "x$with_xml_val" = "xyes"], [
+-     AS_IF([test -x "/usr/bin/xml2-config"], [XML_HOME="/usr"])
+-     ])
+-
+-  if test "x$XML_HOME" != "x"; then
+-    AC_MSG_RESULT([$XML_HOME])
+-    with_xml="yes"
+-  else
+-    AC_MSG_RESULT([not found])
+-  fi
+-
+-  found_xml="no"
+-  XMLCONF_VERSION=""
+-  XML_CPPFLAGS=""
+-  XML_LIBS=""
+-  case "$with_xml" in
+-    yes) AC_PATH_PROG([xmlconfig], [xml2-config])
+-        if test "x$xmlconfig" = x ; then
+-            AC_MSG_NOTICE([can not locate xml2-config in PATH, will search default XML_HOME variants])
+-            
+-            if test "x$XML_HOME" != "x"; then
+-                AC_MSG_CHECKING([xml2-config version])
+-                XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`"
+-
+-                if test "x%XMLCONF_VERSION" != "x"; then
+-                    AC_MSG_RESULT([$XMLCONF_VERSION])
+-                    found_xml="yes"
+-                    XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`"
+-                    XML_LIBS="`$XML_HOME/bin/xml2-config --libs`"
+-                    AS_ECHO("$XML_CPPFLAGS")
+-                    AS_ECHO("$XML_LIBS")
+-                else
+-                    AC_MSG_ERROR([xml2-config failed])
+-                fi
+-            fi
+-        else
+-            found_xml="yes"
+-            XMLCONF_VERSION="`$xmlconfig --version`"
+-            XML_CPPFLAGS="`$xmlconfig --cflags`"
+-            XML_LIBS="`$xmlconfig --libs`"
+-        fi
+-  esac
++    PKG_CHECK_MODULES([XML], [libxml-2.0],
++	[found_xml=yes],
++	[
++	    found_xml=no
++	    AS_IF([test "x$want_xml" = xyes],
++		[AC_MSG_ERROR([--enable-xml set but cannot find libxml2])]
++	    )
++	]
++    )
+ 
+   working_xml="no"
+   if test "X$found_xml" != "Xno"; then
+-
+-    readerresult=""
+-    if test "x$xmlconfig" = x ; then
+-        readerresult="$XML_HOME/include/libxml2/libxml/xmlreader.h"
+-    else
+-        readerresult="`$xmlconfig --prefix`/include/libxml2/libxml/xmlreader.h"
+-    fi
+-    
++    XML_HOME=$(${PKG_CONFIG} --variable prefix libxml-2.0)
+     AC_MSG_CHECKING([for xmlreader.h in $readerresult])
+-    
+-    if test ! -f "$readerresult"; then
++
++    if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then
+       AC_MSG_RESULT([not found])
+     else
+       AC_MSG_RESULT([found])
+       save_LIBS="$LIBS"
+       save_CPPFLAGS="$CPPFLAGS"
++      XML_CPPFLAGS="$XML_CFLAGS"
+       CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+       save_LDFLAGS="$LDFLAGS"
+       LDFLAGS="$LDFLAGS $XML_LIBS"
+-- 
+2.24.0
+

diff --git a/app-antivirus/clamav/files/clamav-0.102.2-fix-curl-detection.patch b/app-antivirus/clamav/files/clamav-0.102.2-fix-curl-detection.patch
new file mode 100644
index 000000000000..f89a704ea3e0
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.102.2-fix-curl-detection.patch
@@ -0,0 +1,26 @@
+https://bugs.gentoo.org/709616
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -197,6 +197,10 @@ AC_CONFIG_FILES([
+                  clamav-types.h
+                  clamav-version.h])
+ if test "x$enable_libclamav_only" != "xyes"; then
++    if test "$have_curl" = "no"; then
++        AC_MSG_ERROR([libcurl not found. libcurl (e.g. libcurl-devel) is required in order to build freshclam and clamsubmit.])
++    fi
++
+     AC_CONFIG_FILES([
+                      clamscan/Makefile
+                      database/Makefile
+--- a/m4/reorganization/libs/curl.m4
++++ b/m4/reorganization/libs/curl.m4
+@@ -92,8 +92,6 @@ if test "X$have_curl" = "Xyes"; then
+     )
+ 
+     LDFLAGS="$save_LDFLAGS"
+-else
+-    AC_MSG_ERROR([libcurl not found. libcurl (e.g. libcurl-devel) is required in order to build freshclam and clamsubmit.])
+ fi
+ 
+ AC_SUBST([CLAMSUBMIT_LIBS])

diff --git a/app-antivirus/clamav/files/clamav-0.103.0-system-tomsfastmath.patch b/app-antivirus/clamav/files/clamav-0.103.0-system-tomsfastmath.patch
new file mode 100644
index 000000000000..ad9276c1ad01
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.103.0-system-tomsfastmath.patch
@@ -0,0 +1,115 @@
+From 70cc96407302cf0fd4eee2b6a401253ed50fe4df Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sun, 20 Sep 2020 11:16:06 -0400
+Subject: [PATCH 1/1] autotools: use system tomsfastmath if possible.
+
+---
+ configure.ac                           |  2 ++
+ libclamav/Makefile.am                  | 10 ++++++++--
+ libclamav/bignum.h                     |  6 +++++-
+ libclamav/xdp.c                        |  2 +-
+ m4/reorganization/libs/tomsfastmath.m4 | 12 ++++++++++++
+ 5 files changed, 28 insertions(+), 4 deletions(-)
+ create mode 100644 m4/reorganization/libs/tomsfastmath.m4
+
+diff --git a/configure.ac b/configure.ac
+index 8e0e810f8..773787e49 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -104,6 +104,7 @@ m4_include([m4/reorganization/libs/libmspack.m4])
+ if test "x$use_internal_mspack" = "xno"; then
+     mspack_msg="External, $LIBMSPACK_CFLAGS $LIBMSPACK_LIBS"
+ fi
++m4_include([m4/reorganization/libs/tomsfastmath.m4])
+ 
+ AM_MAINTAINER_MODE
+ m4_include([m4/reorganization/libs/libz.m4])
+@@ -376,6 +377,7 @@ fi
+ CL_MSG_STATUS([yara        ],[$enable_yara],[$enable_yara])
+ CL_MSG_STATUS([fts         ],[yes],[$lfs_fts_msg])
+ 
++CL_MSG_STATUS([tomsfastmath],[yes],[$tomsfastmath_msg])
+ 
+ # Yep, downgrading the compiler avoids the bug too:
+ # 4.0.x, and 4.1.0 are the known buggy versions
+diff --git a/libclamav/Makefile.am b/libclamav/Makefile.am
+index ae655cfec..240fa23f8 100644
+--- a/libclamav/Makefile.am
++++ b/libclamav/Makefile.am
+@@ -588,8 +588,10 @@ libclamav_la_SOURCES += yara_arena.c \
+ 	yara_clam.h
+ endif
+ 
+-libclamav_la_SOURCES += bignum.h\
+-	bignum_fast.h\
++libclamav_la_SOURCES += bignum.h
++
++if !SYSTEM_TOMSFASTMATH
++libclamav_la_SOURCES += bignum_fast.h\
+ 	tomsfastmath/addsub/fp_add.c\
+ 	tomsfastmath/addsub/fp_add_d.c\
+ 	tomsfastmath/addsub/fp_addmod.c\
+@@ -671,6 +673,10 @@ libclamav_la_SOURCES += bignum.h\
+ 	tomsfastmath/sqr/fp_sqr_comba_generic.c\
+ 	tomsfastmath/sqr/fp_sqr_comba_small_set.c\
+ 	tomsfastmath/sqr/fp_sqrmod.c
++else
++libclamav_la_CFLAGS += $(TOMSFASTMATH_CFLAGS)
++libclamav_la_LIBADD += $(TOMSFASTMATH_LIBS)
++endif
+ 
+ .PHONY2: version.h.tmp
+ version.c: version.h
+diff --git a/libclamav/bignum.h b/libclamav/bignum.h
+index 8fdc956bb..56dfa957e 100644
+--- a/libclamav/bignum.h
++++ b/libclamav/bignum.h
+@@ -1,9 +1,13 @@
+ #ifndef BIGNUM_H_
+ #define BIGNUM_H_
+ 
++#if HAVE_SYSTEM_TOMSFASTMATH
++#include <tfm.h>
++#else
+ #define TFM_CHECK
+-
+ #include "bignum_fast.h"
++#endif
++
+ typedef fp_int mp_int;
+ #define mp_cmp fp_cmp
+ #define mp_toradix_n(a, b, c, d) fp_toradix_n(a, b, c, d)
+diff --git a/libclamav/xdp.c b/libclamav/xdp.c
+index 87423421d..6370221ff 100644
+--- a/libclamav/xdp.c
++++ b/libclamav/xdp.c
+@@ -52,7 +52,7 @@
+ #include "scanners.h"
+ #include "conv.h"
+ #include "xdp.h"
+-#include "bignum_fast.h"
++#include "bignum.h"
+ #include "filetypes.h"
+ 
+ static char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz);
+diff --git a/m4/reorganization/libs/tomsfastmath.m4 b/m4/reorganization/libs/tomsfastmath.m4
+new file mode 100644
+index 000000000..2a821a14d
+--- /dev/null
++++ b/m4/reorganization/libs/tomsfastmath.m4
+@@ -0,0 +1,12 @@
++dnl Check for system tomsfastmath
++PKG_CHECK_MODULES([TOMSFASTMATH], [tomsfastmath], [have_system_tomsfastmath=yes], [have_system_tomsfastmath=no])
++
++AM_CONDITIONAL([SYSTEM_TOMSFASTMATH], [test "x$have_system_tomsfastmath" = "xyes"])
++
++if test "x$have_system_tomsfastmath" = "xyes"; then
++    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [1], [link against system-wide tomsfastmath library])
++    tomsfastmath_msg="External, $TOMSFASTMATH_CFLAGS $TOMSFASTMATH_LIBS"
++else
++    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [0], [don't link against system-wide tomsfastmath library])
++    tomsfastmath_msg="Internal"
++fi
+-- 
+2.26.2
+

diff --git a/app-antivirus/clamav/files/clamav-0.103.1-upstream-openrc.patch b/app-antivirus/clamav/files/clamav-0.103.1-upstream-openrc.patch
new file mode 100644
index 000000000000..a37d44fa934d
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.103.1-upstream-openrc.patch
@@ -0,0 +1,474 @@
+From 7d7ca4f425909368cd78cd587120703754bcd608 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Tue, 9 Feb 2021 14:24:09 -0500
+Subject: [PATCH 1/1] Add OpenRC service scripts integrated with the build
+ system.
+
+---
+ Makefile.am                                   | 11 ++++++
+ clamav-milter/Makefile.am                     | 21 ++++++++++++
+ clamav-milter/openrc/clamav-milter.in.in      | 34 +++++++++++++++++++
+ clamd/Makefile.am                             | 19 +++++++++++
+ clamd/openrc/clamd.in.in                      | 33 ++++++++++++++++++
+ clamonacc/Makefile.am                         | 19 +++++++++++
+ clamonacc/openrc/clamonacc.in.in              | 18 ++++++++++
+ configure.ac                                  | 16 ++++++++-
+ etc/Makefile.am                               | 22 +++++++++++-
+ ...sample => clamav-milter.conf.sample.in.in} |  5 +--
+ ...md.conf.sample => clamd.conf.sample.in.in} |  4 +--
+ ...onf.sample => freshclam.conf.sample.in.in} |  2 +-
+ freshclam/Makefile.am                         | 20 +++++++++++
+ freshclam/openrc/freshclam.in.in              |  8 +++++
+ m4/reorganization/libs/openrc.m4              |  8 +++++
+ 15 files changed, 233 insertions(+), 7 deletions(-)
+ create mode 100644 clamav-milter/openrc/clamav-milter.in.in
+ create mode 100644 clamd/openrc/clamd.in.in
+ create mode 100644 clamonacc/openrc/clamonacc.in.in
+ rename etc/{clamav-milter.conf.sample => clamav-milter.conf.sample.in.in} (98%)
+ rename etc/{clamd.conf.sample => clamd.conf.sample.in.in} (99%)
+ rename etc/{freshclam.conf.sample => freshclam.conf.sample.in.in} (99%)
+ create mode 100644 freshclam/openrc/freshclam.in.in
+ create mode 100644 m4/reorganization/libs/openrc.m4
+
+diff --git a/Makefile.am b/Makefile.am
+index 42a58e7..c4d82ad 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -52,6 +52,17 @@ nodist_include_HEADERS = clamav-types.h clamav-version.h
+ distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print
+ DISTCLEANFILES = target.h
+ DISTCHECK_CONFIGURE_FLAGS=--enable-milter --disable-clamav --enable-all-jit-targets --enable-llvm=yes --with-system-llvm=no --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) CC="$(CC)" CXX="$(CXX)" YACC="$(YACC)" LEX="$(LEX)" AR="$(AR)" AS="$(AS)"
++
++
++# This command allows us to replace bindir, libdir, etc.
++# within our script and conf file. The example is taken
++# from the autoconf documentation and can be found in the
++# "Installation Directory Variables" section.
++editgnudirs = sed -e 's|@BINDIR[@]|$(bindir)|g' \
++                  -e 's|@SBINDIR[@]|$(sbindir)|g' \
++                  -e 's|@RUNSTATEDIR[@]|$(runstatedir)|g'
++export editgnudirs
++
+ lcov:
+ 	($(MAKE); cd unit_tests; $(MAKE) lcov)
+ quick-check:
+diff --git a/clamav-milter/Makefile.am b/clamav-milter/Makefile.am
+index 38d9b94..46885a7 100644
+--- a/clamav-milter/Makefile.am
++++ b/clamav-milter/Makefile.am
+@@ -35,6 +35,27 @@ clamav_milter_SOURCES = \
+ man_MANS = $(top_builddir)/docs/man/clamav-milter.8
+ AM_CFLAGS=@WERR_CFLAGS_MILTER@
+ 
++
++if INSTALL_OPENRC_SERVICES
++
++openrcdir = $(sysconfdir)/init.d
++
++# The next rule allows us to replace @RUNSTATEDIR@ and friends within
++# our OpenRC service scripts. This example is taken from the autoconf
++# documentation in the "Installation Directory Variables" section.
++openrc_SCRIPTS_src = openrc/clamav-milter.in.in
++openrc_SCRIPTS_intermediate = openrc/clamav-milter.in
++nodist_openrc_SCRIPTS = openrc/clamav-milter
++DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
++$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++
++endif
++EXTRA_DIST = $(openrc_SCRIPTS_src)
++
++
+ endif
+ 
+ LIBS = $(top_builddir)/libclamav/libclamav.la $(top_builddir)/shared/libshared.la @CLAMAV_MILTER_LIBS@ @THREAD_LIBS@
+diff --git a/clamav-milter/openrc/clamav-milter.in.in b/clamav-milter/openrc/clamav-milter.in.in
+new file mode 100644
+index 0000000..7105356
+--- /dev/null
++++ b/clamav-milter/openrc/clamav-milter.in.in
+@@ -0,0 +1,34 @@
++#!/sbin/openrc-run
++
++# Note: the "Foreground" option in clamav-milter.conf MUST
++# be set to "no".
++command="@SBINDIR@/clamav-milter"
++
++# For now, must be manually synchronized with the PidFile
++# variable in clamav-milter.conf.
++#
++# https://bugzilla.clamav.net/show_bug.cgi?id=12595
++#
++pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
++
++depend() {
++  # The milter can successfully launch without clamd, but it's not a
++  # great user experience to have the milter start accepting requests
++  # that it can't process. The "use" dependency below will start clamd
++  # before clamav-milter, so long as clamd is also present this runlevel.
++  use clamd
++}
++
++start_pre() {
++  # This exists to support the (disabled) default MilterSocket setting
++  # within clamav-milter.conf. The "clamav" user and group agree with
++  # the (disabled) default "User" and "MilterSocketGroup" settings.
++  #
++  # Creating this directory is harmless even when a local socket is
++  # not used. In fact, the clamd service that we depend on should
++  # create it as well, to hold its own local socket (if enabled).
++  checkpath --directory \
++           --mode 0755 \
++           --owner clamav:clamav \
++           "@RUNSTATEDIR@/clamav"
++}
+diff --git a/clamd/Makefile.am b/clamd/Makefile.am
+index c161586..b59d94c 100644
+--- a/clamd/Makefile.am
++++ b/clamd/Makefile.am
+@@ -44,6 +44,25 @@ if INSTALL_SYSTEMD_UNITS
+ systemdsystemunit_DATA = clamav-daemon.socket clamav-daemon.service
+ endif
+ 
++if INSTALL_OPENRC_SERVICES
++
++openrcdir = $(sysconfdir)/init.d
++
++# The next rule allows us to replace @RUNSTATEDIR@ and friends within
++# our OpenRC service scripts. This example is taken from the autoconf
++# documentation in the "Installation Directory Variables" section.
++openrc_SCRIPTS_src = openrc/clamd.in.in
++openrc_SCRIPTS_intermediate = openrc/clamd.in
++nodist_openrc_SCRIPTS = openrc/clamd
++DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
++$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++
++endif
++EXTRA_DIST = $(openrc_SCRIPTS_src)
++
+ LIBS = $(top_builddir)/libclamav/libclamav.la $(top_builddir)/shared/libshared.la @CLAMD_LIBS@ @THREAD_LIBS@
+ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface @SSL_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
+ 
+diff --git a/clamd/openrc/clamd.in.in b/clamd/openrc/clamd.in.in
+new file mode 100644
+index 0000000..5d38f9a
+--- /dev/null
++++ b/clamd/openrc/clamd.in.in
+@@ -0,0 +1,33 @@
++#!/sbin/openrc-run
++
++# Note: the "Foreground" option in clamd.conf must be set to "no"
++command="@SBINDIR@/clamd"
++extra_started_commands="reload"
++
++# For now, must be manually synchronized with the PidFile variable
++# in clamd.conf.
++#
++# https://bugzilla.clamav.net/show_bug.cgi?id=12595
++#
++pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
++
++start_pre() {
++  # This exists to support the (disabled) default LocalSocket setting
++  # within clamd.conf. The "clamav" user and group agree with the
++  # (disabled) default "User" and "LocalSocketGroup" settings in
++  # clamd.conf. And everything here agrees with the
++  # clamav-daemon.socket systemd service.
++  #
++  # Creating this directory is harmless even when a local socket is
++  # not used.
++  checkpath --directory \
++           --mode 0755 \
++           --owner clamav:clamav \
++           "@RUNSTATEDIR@/clamav"
++}
++
++reload() {
++  ebegin "Reloading ${RC_SVCNAME}"
++  "@BINDIR@/clamdscan" --reload
++  eend $?
++}
+diff --git a/clamonacc/Makefile.am b/clamonacc/Makefile.am
+index 4cb4886..39c2e5d 100644
+--- a/clamonacc/Makefile.am
++++ b/clamonacc/Makefile.am
+@@ -58,6 +58,25 @@ if INSTALL_SYSTEMD_UNITS
+ systemdsystemunit_DATA = clamav-clamonacc.service
+ endif
+ 
++if INSTALL_OPENRC_SERVICES
++
++openrcdir = $(sysconfdir)/init.d
++
++# The next rules allow us to replace @RUNSTATEDIR@ and friends within
++# our OpenRC service scripts. This example is taken from the autoconf
++# documentation in the "Installation Directory Variables" section.
++openrc_SCRIPTS_src = openrc/clamonacc.in.in
++openrc_SCRIPTS_intermediate = openrc/clamonacc.in
++nodist_openrc_SCRIPTS = openrc/clamonacc
++DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
++$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++
++endif
++EXTRA_DIST = $(openrc_SCRIPTS_src)
++
+ LIBS = $(top_builddir)/shared/libshared.la $(top_builddir)/libclamav/libclamav.la @CURL_LIBS@ @CLAMONACC_LIBS@ @THREAD_LIBS@
+ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/clamonacc -I$(top_srcdir)/shared -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface @CURL_CPPFLAGS@ @SSL_CPPFLAGS@ @CLAMONACC_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
+ 
+diff --git a/clamonacc/openrc/clamonacc.in.in b/clamonacc/openrc/clamonacc.in.in
+new file mode 100644
+index 0000000..844cd49
+--- /dev/null
++++ b/clamonacc/openrc/clamonacc.in.in
+@@ -0,0 +1,18 @@
++#!/sbin/openrc-run
++
++command="@SBINDIR@/clamonacc"
++pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
++
++# clamonacc doesn't support a PID file at the moment, so we
++# run it in the foreground and let OpenRC background it.
++#
++# https://bugzilla.clamav.net/show_bug.cgi?id=12595
++#
++command_args="--foreground"
++command_background=true
++
++depend() {
++  # Unlike the milter, the on-access scanner will simply fail to start
++  # until clamd is available.
++  need clamd
++}
+diff --git a/configure.ac b/configure.ac
+index 33e252e..c8cd60f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -79,6 +79,12 @@ if test "$enable_experimental" = "yes"; then
+   VERSION_SUFFIX="$VERSION_SUFFIX-exp"
+ fi
+ 
++# Autoconf 2.70 will support this, and many distros patch it in,
++# but Autoconf 2.70 hasn't actually been released yet (it's in beta).
++AS_IF([test -z "${runstatedir}"], [runstatedir='${localstatedir}/run'])
++AC_SUBST([runstatedir])
++
++
+ build_configure_args=`echo "$ac_configure_args" | sed -e 's/[\"]//g'`
+ AC_SUBST([BUILD_CONFIGURE_FLAGS], [$build_configure_args])
+ 
+@@ -105,6 +111,7 @@ m4_include([m4/reorganization/libs/libz.m4])
+ m4_include([m4/reorganization/libs/bzip.m4])
+ m4_include([m4/reorganization/libs/unrar.m4])
+ m4_include([m4/reorganization/libs/systemd.m4])
++m4_include([m4/reorganization/libs/openrc.m4])
+ m4_include([m4/reorganization/code_checks/ipv6.m4])
+ m4_include([m4/reorganization/code_checks/dns.m4])
+ m4_include([m4/reorganization/code_checks/fanotify.m4])
+@@ -193,7 +200,10 @@ AC_CONFIG_FILES([
+                  libclamav.pc
+                  platform.h
+                  clamav-types.h
+-                 clamav-version.h])
++                 clamav-version.h
++                 etc/clamd.conf.sample.in
++                 etc/clamav-milter.conf.sample.in
++                 etc/freshclam.conf.sample.in])
+ if test "x$enable_libclamav_only" != "xyes"; then
+     if test "$have_curl" = "no"; then
+         AC_MSG_ERROR([libcurl not found. libcurl (e.g. libcurl-devel) is required in order to build freshclam and clamsubmit.])
+@@ -207,10 +217,14 @@ if test "x$enable_libclamav_only" != "xyes"; then
+                      clamd/Makefile
+                      clamd/clamav-daemon.service
+                      clamd/clamav-daemon.socket
++                     clamd/openrc/clamd.in
+                      clamdscan/Makefile
+                      clamsubmit/Makefile
++                     clamonacc/openrc/clamonacc.in
+                      clamav-milter/Makefile
++                     clamav-milter/openrc/clamav-milter.in
+                      freshclam/clamav-freshclam.service
++                     freshclam/openrc/freshclam.in
+                      freshclam/Makefile
+                      sigtool/Makefile
+                      clamconf/Makefile
+diff --git a/etc/Makefile.am b/etc/Makefile.am
+index c694856..213a978 100644
+--- a/etc/Makefile.am
++++ b/etc/Makefile.am
+@@ -18,11 +18,31 @@
+ #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ #  MA 02110-1301, USA.
+ 
+-EXTRA_DIST = clamd.conf.sample freshclam.conf.sample clamav-milter.conf.sample
++EXTRA_DIST = clamd.conf.sample.in.in \
++             freshclam.conf.sample.in.in \
++             clamav-milter.conf.sample.in.in
+ CFGINST = @CFGDIR@
+ 
+ sysconf_DATA = clamd.conf.sample freshclam.conf.sample
+ 
++# Custom variable to simplify the "edit" rule below.
++sysconf_DATA_intermediate = clamd.conf.sample.in freshclam.conf.sample.in
++
+ if HAVE_MILTER
+ sysconf_DATA += clamav-milter.conf.sample
++sysconf_DATA_intermediate += clamav-milter.conf.sample.in
+ endif
++
++# Otherwise these don't get cleaned up by "make distclean",
++# even though they are auto-generated.
++DISTCLEANFILES = $(sysconf_DATA) $(sysconf_DATA_intermediate)
++
++# This rule includes EVERY source/intermediate file as a dependency of
++# EVERY output file, which is clearly wrong, but it may be the best we
++# can do without duplication. At least it's the right kind of wrong,
++# and rebuilds too often rather than not often enough.
++$(sysconf_DATA): $(sysconf_DATA_intermediate) $(EXTRA_DIST) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++
+diff --git a/etc/clamav-milter.conf.sample b/etc/clamav-milter.conf.sample.in.in
+similarity index 98%
+rename from etc/clamav-milter.conf.sample
+rename to etc/clamav-milter.conf.sample.in.in
+index bf46b4f..c3c5d20 100644
+--- a/etc/clamav-milter.conf.sample
++++ b/etc/clamav-milter.conf.sample.in.in
+@@ -17,7 +17,7 @@ Example
+ # inet6:port@[hostname|ip-address] - to specify an ipv6 socket
+ #
+ # Default: no default
+-#MilterSocket /tmp/clamav-milter.socket
++#MilterSocket unix:@RUNSTATEDIR@/clamav/clamav-milter.socket
+ #MilterSocket inet:7357
+ 
+ # Define the group ownership for the (unix) milter socket.
+@@ -64,7 +64,7 @@ Example
+ # also owned by root to keep other users from tampering with it.
+ #
+ # Default: disabled
+-#PidFile /var/run/clamav-milter.pid
++#PidFile @RUNSTATEDIR@/clamav-milter.pid
+ 
+ # Optional path to the global temporary directory.
+ # Default: system specific (usually /tmp or /var/tmp).
+@@ -91,6 +91,7 @@ Example
+ # fashion.
+ #
+ # Default: no default
++#ClamdSocket unix:@RUNSTATEDIR@/clamav/clamd.ctl
+ #ClamdSocket tcp:scanner.mydomain:7357
+ 
+ 
+diff --git a/etc/clamd.conf.sample b/etc/clamd.conf.sample.in.in
+similarity index 99%
+rename from etc/clamd.conf.sample
+rename to etc/clamd.conf.sample.in.in
+index a1ca9ec..82ef42c 100644
+--- a/etc/clamd.conf.sample
++++ b/etc/clamd.conf.sample.in.in
+@@ -74,7 +74,7 @@ Example
+ # It is recommended that the directory where this file is stored is
+ # also owned by root to keep other users from tampering with it.
+ # Default: disabled
+-#PidFile /var/run/clamd.pid
++#PidFile @RUNSTATEDIR@/clamd.pid
+ 
+ # Optional path to the global temporary directory.
+ # Default: system specific (usually /tmp or /var/tmp).
+@@ -93,7 +93,7 @@ Example
+ 
+ # Path to a local socket file the daemon will listen on.
+ # Default: disabled (must be specified by a user)
+-#LocalSocket /tmp/clamd.socket
++#LocalSocket @RUNSTATEDIR@/clamav/clamd.ctl
+ 
+ # Sets the group ownership on the unix socket.
+ # Default: disabled (the primary group of the user running clamd)
+diff --git a/etc/freshclam.conf.sample b/etc/freshclam.conf.sample.in.in
+similarity index 99%
+rename from etc/freshclam.conf.sample
+rename to etc/freshclam.conf.sample.in.in
+index 8f4dd49..5a5c42b 100644
+--- a/etc/freshclam.conf.sample
++++ b/etc/freshclam.conf.sample.in.in
+@@ -51,7 +51,7 @@ Example
+ # It is recommended that the directory where this file is stored is
+ # also owned by root to keep other users from tampering with it.
+ # Default: disabled
+-#PidFile /var/run/freshclam.pid
++#PidFile @RUNSTATEDIR@/freshclam.pid
+ 
+ # By default when started freshclam drops privileges and switches to the
+ # "clamav" user. This directive allows you to change the database owner.
+diff --git a/freshclam/Makefile.am b/freshclam/Makefile.am
+index 9e48119..46ef224 100644
+--- a/freshclam/Makefile.am
++++ b/freshclam/Makefile.am
+@@ -32,6 +32,26 @@ if INSTALL_SYSTEMD_UNITS
+ systemdsystemunit_DATA = clamav-freshclam.service
+ endif
+ 
++if INSTALL_OPENRC_SERVICES
++
++openrcdir = $(sysconfdir)/init.d
++
++# The next rule allows us to replace @RUNSTATEDIR@ and friends within
++# our OpenRC service scripts. This example is taken from the autoconf
++# documentation in the "Installation Directory Variables" section.
++openrc_SCRIPTS_src = openrc/freshclam.in.in
++openrc_SCRIPTS_intermediate = openrc/freshclam.in
++nodist_openrc_SCRIPTS = openrc/freshclam
++DISTCLEANFILES = $(nodist_openrc_SCRIPTS) $(openrc_SCRIPTS_intermediate)
++$(nodist_openrc_SCRIPTS): $(openrc_SCRIPTS_src) $(openrc_SCRIPTS_intermediate) Makefile
++	rm -f $@ $@.tmp
++	$(editgnudirs) $@.in > $@.tmp
++	mv $@.tmp $@
++
++endif
++EXTRA_DIST = $(openrc_SCRIPTS_src)
++
++
+ AM_CFLAGS=@WERR_CFLAGS@
+ DEFS = @DEFS@
+ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav -I$(top_builddir)/libclamav -I$(top_srcdir)/libclamunrar_iface -I$(top_srcdir)/libfreshclam @CURL_CPPFLAGS@ @SSL_CPPFLAGS@ @FRESHCLAM_CPPFLAGS@ @ZLIB_CFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
+diff --git a/freshclam/openrc/freshclam.in.in b/freshclam/openrc/freshclam.in.in
+new file mode 100644
+index 0000000..9feb737
+--- /dev/null
++++ b/freshclam/openrc/freshclam.in.in
+@@ -0,0 +1,8 @@
++#!/sbin/openrc-run
++
++command="@BINDIR@/freshclam"
++pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid"
++
++# Ignore the value of "PidFile" set in freshclam.conf.
++command_args="-p ${pidfile}"
++command_args_background="--daemon"
+diff --git a/m4/reorganization/libs/openrc.m4 b/m4/reorganization/libs/openrc.m4
+new file mode 100644
+index 0000000..1a73d15
+--- /dev/null
++++ b/m4/reorganization/libs/openrc.m4
+@@ -0,0 +1,8 @@
++dnl Should we install our OpenRC service files?
++AC_ARG_ENABLE([openrc],
++              AS_HELP_STRING([--enable-openrc],
++                             [Install OpenRC service files]),
++              [],
++              [enable_openrc=no])
++AM_CONDITIONAL(INSTALL_OPENRC_SERVICES,
++               [test "x$enable_openrc" = "xyes"])
+-- 
+2.26.2
+

diff --git a/app-antivirus/clamav/files/clamav-0.103.12-missing-const.patch b/app-antivirus/clamav/files/clamav-0.103.12-missing-const.patch
new file mode 100644
index 000000000000..39b98b7f4732
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.103.12-missing-const.patch
@@ -0,0 +1,13 @@
+diff --git a/libclamav/regex/engine.c b/libclamav/regex/engine.c
+index ed359c3..3c25398 100644
+--- a/libclamav/regex/engine.c
++++ b/libclamav/regex/engine.c
+@@ -223,7 +223,7 @@ matcher(struct re_guts *g, const char *string, size_t nmatch,
+ 			dp = dissect(m, m->coldp, endp, gf, gl);
+ 		} else {
+ 			if (g->nplus > 0 && m->lastpos == NULL)
+-				m->lastpos = (char **)cli_malloc((g->nplus+1) *
++				m->lastpos = (const char **)cli_malloc((g->nplus+1) *
+ 							sizeof(char *));
+ 			if (g->nplus > 0 && m->lastpos == NULL) {
+ 				free(m->pmatch);


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-10-27 11:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-31 12:47 [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/ Lars Wendler
  -- strict thread matches above, loose matches on Subject: below --
2024-10-27 11:32 Michael Orlitzky
2024-10-27 11:22 Andreas K. Hüttel
2024-09-23 11:48 Matt Jolly
2024-09-23 11:12 Matt Jolly
2024-06-24 11:05 Matt Jolly
2022-12-05 21:03 Thomas Raschbacher
2021-10-16 12:26 Thomas Raschbacher
2021-02-09 19:48 Michael Orlitzky
2020-09-23  3:34 Michael Orlitzky
2020-09-23  3:34 Michael Orlitzky
2020-09-20 19:35 Michael Orlitzky
2020-06-09  1:53 Michael Orlitzky
2019-11-25 16:27 Lars Wendler
2019-11-25  4:08 Michael Orlitzky
2019-07-31 12:07 Lars Wendler
2018-03-02 18:42 Thomas Raschbacher
2018-02-23 19:00 Thomas Deutschmann
2017-12-24 23:12 Mike Gilbert
2017-04-23 20:26 Jeroen Roovers
2016-12-25 18:13 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox