summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Raschbacher <lordvan@gentoo.org>2025-01-23 22:37:06 +0100
committerThomas Raschbacher <lordvan@gentoo.org>2025-01-23 22:37:06 +0100
commitb27c04b71320f5ec165dd2e0352c3071df44553c (patch)
tree34ae6f643edc8db29dbc3144928913eca6096717 /app-antivirus
parentapp-arch/alien: add 8.95.8 (diff)
downloadgentoo-b27c04b71320f5ec165dd2e0352c3071df44553c.tar.gz
gentoo-b27c04b71320f5ec165dd2e0352c3071df44553c.tar.bz2
gentoo-b27c04b71320f5ec165dd2e0352c3071df44553c.zip
app-antivirus/clamav: add 1.4.2
Signed-off-by: Thomas Raschbacher <lordvan@gentoo.org>
Diffstat (limited to 'app-antivirus')
-rw-r--r--app-antivirus/clamav/Manifest3
-rw-r--r--app-antivirus/clamav/clamav-1.4.2.ebuild414
2 files changed, 417 insertions, 0 deletions
diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
index 8bdddbe44c56..6c1cb1003309 100644
--- a/app-antivirus/clamav/Manifest
+++ b/app-antivirus/clamav/Manifest
@@ -17,9 +17,11 @@ DIST bumpalo-3.12.0.crate 81604 BLAKE2B 2370094f0c23a3e9b75c8e523e54637189543d9d
DIST bumpalo-3.16.0.crate 85677 BLAKE2B 08da17b757931d2910e0299df53eb62731aa8c4ebd8915859b81d1982b331e7455dfac977c754e500a35ee07ba8eff00a61d2f62be99744e2ddbba06c1268f49 SHA512 a51b75c36f6794db444cab20eeb24f42a319080ecb486a56d254d6f873f3d188b5ccba11db30c068bd0c52c4322d4a3f5f5195c81c94b0bc04387030418835b1
DIST bytemuck-1.13.0.crate 41703 BLAKE2B f24b786d2209921f2de16209d3b397fa1d62f637efd8f0a92c6d7d3734fa447ae3f1c5499e85a16e30e39bd132c00c59517ae0886d1fab8da4aaf2150a3fc0d2 SHA512 e2e8164c9b14d8ec44879f3efb91f3ac3918e092d22d73152166b926c8b85e854c7b925b53feb173b572e9260100d9c584dbb80a377944b2415d485dd1d20876
DIST bytemuck-1.15.0.crate 47672 BLAKE2B 49f2d92cfd5abfbe3fd94e7e4c9a3d4ac22c67b58e73947f461cf8e5022738b7d38c790de2a1717b731d658f1646066bee2f936a1575e2995e6de39d20f918b2 SHA512 5b6886f252945449c4546c181bbb6c95597e498aba6b1faf81c5a4af69bcb9e3e024d7d6e849d347682e8ca72ecaa9a70d13fb06c174e17846f0c85bb4810433
+DIST bytemuck-1.21.0.crate 51553 BLAKE2B dbd88d153c79cd87d6a51d33e49dde7b825711339367a168cf2471fc98a41e72d4d759873d542c3c6e196a6baed4f099103dbdfd369a329bb4578864b9ffb448 SHA512 64abfc5c0430b8bbb4b75fa7ee43037ceb180699655c0862b2699f3823fc445d931d3284ccc88dfdc98ed1a24a660cf6ea1040f91c6b2ba1cb21ab83c89d9b18
DIST byteorder-1.4.3.crate 22512 BLAKE2B d39c546ba7346df315297fc53da4bfc77ecb1f38567ddb788549ee31cae2719a8bc0b7d1f1705abb3cff033aa57af004987d90748f5a31765273b3223a011c0d SHA512 8c8000eb8ecf40351c9ce36a3a8acd7a02f81786d1b11aab85adfeffa0f2267ed74df29b2ca5d1d38128484d1d3cad2b673aa0d0441dcd0620dfd3934bb888fa
DIST byteorder-1.5.0.crate 23288 BLAKE2B 7f85a7948406844070a2c8202e0bd52f73b3dfc7c666a97046128044eb9352195afb80e2bf894c0742ad109e4473339de1365d09591de70dfec6c8c02a8e1453 SHA512 96caf981177f6ded9f27f025922cb94eb0cd9de5303bd91680099912d922092e77b7361efa70011e84f1595e443193e4f1b354443b9980c123f6ae573b236f7f
DIST bytes-1.6.0.crate 60605 BLAKE2B 3e4cd094443969c6062b51917ad9df314b61ec9ddcb0336cf2621d8966c568d5b1fdbf16b11b5e2fab01b43ea76f6609f753eb5c2380a5e4aa8fb6e807a2ff5d SHA512 6507bc4274204d0a19b6a95c3284c52245c71cbf5f2dfb5cd372193d989e49869ec557c0c4e449e96ed4e3028c90606dfb0dcdc1d72bb234a36bc5f344c0a7a8
+DIST bytes-1.9.0.crate 67320 BLAKE2B d5a89fc1dced217bd78c6c50d0494308b69b0841506c4663b6df3755b91a9eedbd242ce1322a71b8a96847db7920b2b15744fb060aa2d69f5c8d9bcbf2745b9a SHA512 e6c0681c535db6035c1fb1c0481725bb8ab341b6324acde07ac4b60cc4f490ec6ff01478bc00fae00ade2bc5420f9d14cc44438e5d156bcce91cc0f06118296b
DIST bzip2-rs-0.1.2.crate 253906 BLAKE2B 75a60bd49deaa8df0a91e291c619a392f55aa56ed8fe8e6f0a1dbd79c14266baf058e4e904cfb64762511f4a9c16c60af3c919a1943a2783907e8eac86f7f0d9 SHA512 00683e16f06a3c5589fbb6cb215ecccba4a8619916de80024a917f98f10bab4c663036fa3f922783ca19bb04a1653ec2ab593c1f36f587e931bd80cb11a79765
DIST cbindgen-0.20.0.crate 183277 BLAKE2B 51529b21879e3a3212fbb951b3bdd5c8c396dce53e9dbe568bfe1e752caf3060bc784909cb4b37a6e6e80d357d5a8e2bab8d10d4470563358407bceb814bb7fc SHA512 83c2b0da580f0a2fc9a74922f3c44d0e73ce0d1de8b5a3f5819c7fcf1c481df1ff0346e84c5b4c199a9364542c85fb81ece4e1deca3a6f12231a4478f76a7c02
DIST cbindgen-0.25.0.crate 200141 BLAKE2B 9af26f1696e483db0869b36eb4a4bfca5e59bdcaf21166973933b9d8c6cfbfe5a61a3d883c24d2bca823a9d7c1e6f68d9638e414d36292247385304ddf72ad12 SHA512 2a4bfcb41384a82dc1fea6f124187ee9f79a6795fcd68c74706d500d0c266cab962d1807627ceff58ded123939ff868ca329f9aa85fd5969556294a3e4ed5eed
@@ -32,6 +34,7 @@ DIST clamav-0.103.11.tar.gz 16550978 BLAKE2B 9fba6d5b41ef07b017be26b7ebd832ca031
DIST clamav-0.103.12.tar.gz 16507685 BLAKE2B bc31787625f85867bf21c4555aa2fd2998514986fb571fa4e6cb9fa3fedf61b493c517291b662054edc0bbe8d45649d9c244d943df01950e204baa9e537e3e32 SHA512 0e870a5fd035fbf090359ef7634b1b36e346ff3066b896ff17c2c6ace04f4c17e16181a21fead8b8b2f397de9ea47b928515b717a41996bac4c8efed4d16ec4e
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 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
diff --git a/app-antivirus/clamav/clamav-1.4.2.ebuild b/app-antivirus/clamav/clamav-1.4.2.ebuild
new file mode 100644
index 000000000000..f589c429ba62
--- /dev/null
+++ b/app-antivirus/clamav/clamav-1.4.2.ebuild
@@ -0,0 +1,414 @@
+# Copyright 1999-2025 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} )
+
+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;29c08532252b917543ff268284f926f30876bb79;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? ( <llvm-core/llvm-$((${LLVM_MAX_SLOT} + 1)):= )
+ 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 jit && llvm_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=$(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 llvm-core/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
+ # 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 [[ -n "${REPLACING_VERSIONS}" ]] && ver_test "${REPLACING_VERSIONS}" -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
+
+}