app-antivirus/clamav: add 1.4.3

Signed-off-by: Thomas Raschbacher <lordvan@gentoo.org>
This commit is contained in:
Thomas Raschbacher
2025-06-19 17:04:30 +02:00
parent 4a8c478a66
commit 57d800de92
2 changed files with 399 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ DIST clamav-0.103.12.tar.gz 16507685 BLAKE2B bc31787625f85867bf21c4555aa2fd29985
DIST clamav-1.0.7.tar.gz 10348714 BLAKE2B cd57fd9eb7ca5a4ea980cdedcf5977c1d11b28afccaa5807ada7315659dfdbd2d122af4a7cf5c0849df25b41a85b2186c5bbfe0621582955b82b2cc8dced759f SHA512 31b04c795d5a25b6b66f8dc6bb53193e969119f8682c1b5d5194629b7a075e60d2ac9e88e2ababde149e906b0c2e45a3869a0071cef4c1a6f9d5a165a7fa5c67
DIST clamav-1.4.1.tar.gz 13427299 BLAKE2B 395c8a54a35e701e29a833b3b284ad55ab580a6990aae79044fd31e6878d714d31c66c5a8e1ee238b13c942cfb7cadd7046e739c2a19b5751f73eb329f5c479e SHA512 066d6117e717ee272fc9628eb1346f3777276a7e0937e1216f14a6e9edd86aea291a34fc02a60466481f0f06107d799a83bf2a9e0adec549e4c69c61d3ca6259
DIST clamav-1.4.2.tar.gz 13427816 BLAKE2B 22c1cb99da3187fa127b01d1dec7a0857b3aee1ffcb931f8b060e803ffef09c43f989a49f03e5d2ec0bc75c110da1db1b8da0a8b251af0edda6eea71f0065b10 SHA512 48576dc4c440b00f125c7958e8f7bb785a07c24fdf83994df72e3bcd85e9b013562133c556a0929af4106a973a0a15821bcbb83f85268ae601a68926f6c9e35e
DIST clamav-1.4.3.tar.gz 13431353 BLAKE2B bb775323df020949dfd793e5f145686eaa417a6f10894b1c4ff535ca547d4e943bdf519e63519c31957a19ead18dc560db799f36a7bf07a7b5e44a107acd1877 SHA512 af5f3e60b0098a9bea1cc4283e7fa230f3a3d1d2f760f92eb7a67497a7b21a7526d73ceb4e9f3130f698552f63b47923da03c8e188cd2f5a4c8aa35e93a7625a
DIST clang-sys-1.4.0.crate 38679 BLAKE2B d15bdae2142ed26b4f6bd037bd2062e8c4b7b87fc5b749b872a95ff1952d000066c255aa0984e5f9c4a5c88066db4a20cfd048db4ba5a59b331d5ffa5e9a281d SHA512 062189bb0a341e2e85de4987f4b564c1fc69e4005c9c42cfedb61dee5f48db9126a8114d1d97be1b9c21b8c885243751232fbe8cf532e1d2be593308fe45216a
DIST clang-sys-1.7.0.crate 42088 BLAKE2B d1ed314a910c1b676eb780fc1c96f5ac391217ec135480d0a91b11d6f447ad06484b48966ae99115e35d921a506caf6aa7ffbc4ed86aa64367dca321678cfd7d SHA512 e544984d5bd76824ea2093f43f98b59a99e1ca8a5de40e49164b870ed4a91a530f3492faf0678190b91e74aa5d122bdbb32c649998d0ce24912dfb0b83ed6b81
DIST color_quant-1.1.0.crate 6649 BLAKE2B 9a2488dd00b7a33e15e05531ea49ef1961131f0be0922ba41e2d74d2b1a047daed483ac3a9dd87c847a81cce70a347395c557cad8228ab9a8dc5be7cc0f1bcaa SHA512 690c928bda4b7b57425f38ea68ac89cde2473b7a91b7e62c04a8f2c5a0fa3505e26b065d48b7ad0a8bb491f92f600f896fefdad3ce0e86e43cbf4f9a89e94201
@@ -136,6 +137,7 @@ DIST num_cpus-1.15.0.crate 15680 BLAKE2B a4d98b29ad534de9bc262f58f615ec06bde5d5a
DIST once_cell-1.17.0.crate 32736 BLAKE2B 767fc8f362ce5ed7a9eafceb2f0764a2a1c7f4070e22d1e6e2498b3c841c5f761e77fb66a34b899a75d48f1563f6b9b73b90aa9431055d4e0269c47a1b043c1f SHA512 291d87380c0ea17fb3ffc9fdff8620d2ff55601c06ef65b2f0c54254fecd5b488645c6e94c6026b82071893f4d420491ff712399a782e14efa1e323e5c299c46
DIST once_cell-1.19.0.crate 33046 BLAKE2B c14b374eaf4ac0f60acc2e02f7bba270a0e8e0a6978d749cd3cb0ab3eb26907e4fbea70dd5132982f90290381ed18ff8a87fd530f1415fabffac864f157ea380 SHA512 4154876afd34a699ee650d1a8a1c5ee5a25f0ebd9388b8bef2564e33629fae68f113d7507488c68abbe7ea1acf9bbc41813cbbf3ef3e464e3f3b9cc7a51d870c
DIST onenote.rs-29c08532252b917543ff268284f926f30876bb79.gh.tar.gz 725455 BLAKE2B d89839fe5254895376b7a0d793feb246f2244a277fb97d9753ae661e6cd393765a009e3c957a139c9f3f26cfb989e2ec3b14df4099b81e0969334a885e54e61c SHA512 cbae71d1b28ef7465729d19c70e59ccc8690a21131827d3d627128fbe3a178abcf7c3ddf1fd7e7ede0e024c329c26c77474388e343f8758537faa0d570d4fd15
DIST onenote.rs-8b450447e58143004b68dd21c11b710fdb79be92.gh.tar.gz 725441 BLAKE2B e4ad2b41d47db5318f792624d9cc793c9fa1b77cab6811d13d9cfeb7f4239639f4191d5d3207d27549426b9414e04f4aa0e18ed00e221cea49a9e4a5b3423470 SHA512 4a29e1f9a77e7174481b0d9e3cd860dcbe593a2fc28f60823197e52a1067cc1674758c97b13605fb7d58cb35d518941bc117b49458a58a1e887f15981df4e8a0
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

View File

@@ -0,0 +1,397 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..13} )
CRATES="
adler32@1.2.0
adler@1.0.2
aho-corasick@1.1.3
android-tzdata@0.1.1
android_system_properties@0.1.5
autocfg@1.3.0
base64@0.21.7
bindgen@0.65.1
bit_field@0.10.2
bitflags@1.3.2
bitflags@2.5.0
block-buffer@0.10.4
bumpalo@3.16.0
bytemuck@1.21.0
byteorder@1.5.0
bytes@1.9.0
bzip2-rs@0.1.2
cbindgen@0.25.0
cc@1.0.97
cexpr@0.6.0
cfg-if@1.0.0
chrono@0.4.38
clang-sys@1.7.0
color_quant@1.1.0
core-foundation-sys@0.8.6
cpufeatures@0.2.12
crc32fast@1.4.0
crossbeam-deque@0.8.5
crossbeam-epoch@0.9.18
crossbeam-utils@0.8.19
crunchy@0.2.2
crypto-common@0.1.6
delharc@0.6.1
digest@0.10.7
either@1.11.0
encoding_rs@0.8.34
enum-primitive-derive@0.2.2
errno@0.3.8
exr@1.72.0
fastrand@2.1.0
fdeflate@0.3.4
flate2@1.0.30
flume@0.11.0
generic-array@0.14.7
gif@0.13.1
glob@0.3.1
half@2.4.1
hashbrown@0.12.3
heck@0.4.1
hex-literal@0.4.1
hex@0.4.3
home@0.5.9
iana-time-zone-haiku@0.1.2
iana-time-zone@0.1.60
image@0.24.9
indexmap@1.9.3
inflate@0.4.5
itertools@0.10.5
itoa@1.0.11
jpeg-decoder@0.3.1
js-sys@0.3.69
lazy_static@1.4.0
lazycell@1.3.0
lebe@0.5.2
libc@0.2.155
libloading@0.8.3
linux-raw-sys@0.4.13
lock_api@0.4.12
log@0.4.21
memchr@2.7.2
minimal-lexical@0.2.1
miniz_oxide@0.7.2
nom@7.1.3
num-complex@0.4.5
num-integer@0.1.46
num-traits@0.2.19
once_cell@1.19.0
paste@1.0.14
peeking_take_while@0.1.2
png@0.17.13
prettyplease@0.2.19
primal-check@0.3.3
proc-macro2@1.0.81
qoi@0.4.1
quote@1.0.36
rayon-core@1.12.1
rayon@1.10.0
regex-automata@0.4.6
regex-syntax@0.8.3
regex@1.10.4
rustc-hash@1.1.0
rustdct@0.7.1
rustfft@6.2.0
rustix@0.38.34
ryu@1.0.17
scopeguard@1.2.0
serde@1.0.200
serde_derive@1.0.200
serde_json@1.0.116
sha1@0.10.6
sha2@0.10.8
shlex@1.3.0
simd-adler32@0.3.7
smallvec@1.13.2
spin@0.9.8
strength_reduce@0.2.4
syn@1.0.109
syn@2.0.60
tempfile@3.10.1
thiserror-impl@1.0.59
thiserror@1.0.59
tiff@0.9.1
tinyvec@1.6.0
toml@0.5.11
transpose@0.2.3
typenum@1.17.0
unicode-ident@1.0.12
unicode-segmentation@1.11.0
uuid@1.8.0
version_check@0.9.4
wasm-bindgen-backend@0.2.92
wasm-bindgen-macro-support@0.2.92
wasm-bindgen-macro@0.2.92
wasm-bindgen-shared@0.2.92
wasm-bindgen@0.2.92
weezl@0.1.8
which@4.4.2
widestring@1.1.0
windows-core@0.52.0
windows-sys@0.52.0
windows-targets@0.52.5
windows_aarch64_gnullvm@0.52.5
windows_aarch64_msvc@0.52.5
windows_i686_gnu@0.52.5
windows_i686_gnullvm@0.52.5
windows_i686_msvc@0.52.5
windows_x86_64_gnu@0.52.5
windows_x86_64_gnullvm@0.52.5
windows_x86_64_msvc@0.52.5
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 eapi9-ver flag-o-matic 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 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 )
milter? ( mail-filter/libmilter:= )
rar? ( app-arch/unrar )
system-mspack? ( dev-libs/libmspack )
test? ( dev-python/pytest )
"
BDEPEND="
virtual/pkgconfig
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.4.1-pointer-types.patch"
)
python_check_deps() {
python_has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
}
pkg_setup() {
rust_pkg_setup
use test && python-any-r1_pkg_setup
}
src_prepare() {
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="interpreter" # https://github.com/Cisco-Talos/clamav/issues/581 (does not support modern llvm)
-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
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
# OpenRC services ensure their own permissions, so we can avoid
# a dependency on sys-apps/systemd-utils[tmpfiles] here, though
# we can change our minds and use it if we want to.
dotmpfiles "${FILESDIR}/tmpfiles.d/clamav-r1.conf"
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:^\#\(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-r1.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."
else
if ver_replacing -le 1.3.1; then
ewarn "From 1.3.1-r1 the Gentoo-provided systemd services have been"
ewarn "Retired in favour of using the units shipped by upstream."
ewarn "Ensure that any required services are configured and started."
ewarn "clamd@.service has been retired as part of this transition."
fi
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
}