From ab3da91fb6c91a9df52fff8f991570f456fd3c7a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 18 Dec 2020 11:06:49 +0000 Subject: gentoo resync : 18.12.2020 --- app-antivirus/clamav/Manifest | 3 +- app-antivirus/clamav/clamav-0.103.0-r1.ebuild | 235 -------------------- app-antivirus/clamav/clamav-0.103.0-r2.ebuild | 236 +++++++++++++++++++++ .../clamav-0.103.0-freshclam-db-test-fix.patch | 27 +++ 4 files changed, 265 insertions(+), 236 deletions(-) delete mode 100644 app-antivirus/clamav/clamav-0.103.0-r1.ebuild create mode 100644 app-antivirus/clamav/clamav-0.103.0-r2.ebuild create mode 100644 app-antivirus/clamav/files/clamav-0.103.0-freshclam-db-test-fix.patch (limited to 'app-antivirus/clamav') diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest index 0f58e6113790..e3621173fffa 100644 --- a/app-antivirus/clamav/Manifest +++ b/app-antivirus/clamav/Manifest @@ -2,6 +2,7 @@ AUX clamav-0.101.2-tinfo.patch 854 BLAKE2B 46479552a2dffcf56c7b142062896e8ae34e3 AUX clamav-0.102.1-libxml2_pkgconfig.patch 4012 BLAKE2B 4c3e4fc3522d317c57bae942bbd1c9b91d11ddb782cfaa0593458180207ffb873f783cea892d8eefd2402f30b7a0c4dcbbd5b61e01a54f98432c1164b29e7d83 SHA512 ee6379c85f7d85e30bfa4efda728cf9207a5017905abed8a6241561825ca54ec58a6cec2c1a8452574a9356491c192e89f76d19c2e404602637dcc9576b3fdea AUX clamav-0.102.2-fix-curl-detection.patch 844 BLAKE2B a813b1f6003b9cff03fca8d72dbd44d6a4f700e3d60aee83f782a87893a3c6753698ca8715237155185660301dd81dc55bf6a6e3b9095f57b099607182c90bf5 SHA512 27e6aa5ad418eaa32b56ea7bbdab0b5b4cd649e55d34eb094b5f02d7e68d8913f39664ffd6bc4a07faf88f60bdbd15b0c381fbbd6d9c1c62cc36e72e34cabd19 AUX clamav-0.102.3-system-tomsfastmath.patch 3769 BLAKE2B 36c6580709a9f3319643e547c37753a65240aaa2ed612465982ea35c392d5031ba105e8ac67a42453fa4960977579a04f61ad9bb30a8e693908c25daa3085154 SHA512 8749a0e0b97570371a4a661b82c210ab1c9e6cba46b7fdf63474daa745bc280ffc84c3e4030a3c659814ba845f38946cbda0f437130057c8a73b3dc762b09ae3 +AUX clamav-0.103.0-freshclam-db-test-fix.patch 869 BLAKE2B b6e9f09217b122a695c929caa89d017a5d4eb72101506db5a8709a62f3a91a651ffe938388e3c3060ace255bdfaab44d053f6bb584b8edf4069dc58b7374808a SHA512 2f7b949a14b4fa95c238f3c261426a911ba469da8faac1cc3717508cf5a7dd71ffd792c08a22c8ed6f6158d2dcb686ca44a15a0833188da5dcc4254117bcec65 AUX clamav-0.103.0-system-tomsfastmath.patch 3725 BLAKE2B 85640ded83600adfdcc03e8f42e3153c71a8b6c5884ca4cbd79a69121943fd171bc528aed26ded895189293008924cef6762a22001b4ee098fe5f680c7619bf0 SHA512 b67df39bc7d60f6ea9bb06d12413f0e4774185d4f020a68bdfdf8fe1ca669f70a62699b0f1100702af5ec47e460a35625dcaa09cfc6ea6d2f3957de227e87306 AUX clamav-0.103.0-upstream-openrc.patch 16572 BLAKE2B 51e6207482cdbe5b82e3cdd73e38a11f5c215edb3905a40a97b2446d582ac59bc7467c43a3c2e2af6ee34fd8402964b6e2017c20960235e47c97810f501f9af6 SHA512 f5a984b71e246713df58b8e83503b2c063d8b44b7e4a5ee6245744aac1284ca2b135d6a9a002c411d06ff43515355283505a76fa45f67e6d236c5870b30f4f8c AUX clamav-milter.README.gentoo 2284 BLAKE2B 7afc18f3dad57c2d7595257b356943efb3d1af28d55ac8f09f0506430fd0dedf0820906ced666a7237e3af44a9bc1b43fff017c03faad844f96b132ca4c5dde6 SHA512 38eadf2d919a0c48345600ea5a39c90e766b62e8b1ffc7bb01969a8fd93c4545f2030058a470ac7efb75a1d6c74f9930438f58aeff5035e19e38241ed381f7b3 @@ -22,5 +23,5 @@ AUX tmpfiles.d/clamav.conf 33 BLAKE2B 447c5ad4ad79bc70fc386833fa763451d30bf30f1a DIST clamav-0.102.4.tar.gz 13234444 BLAKE2B 7109da3e2281472032777b8a9d14ca6ff345aead33e5aaf0b9d1ff4721459926062f789dd1f7e8637155e4b9f3bce9f78127bf450f32baf3f1006b8083d3431a SHA512 29893deb8d2d913dff72331875d3dc3a10356bfb254ddfe1c1933b3ea4f8b76c96a1b840f95e72be36cbc0e00b9ec35e395225ef264761f53e709bb1026a4f09 DIST clamav-0.103.0.tar.gz 13357078 BLAKE2B 6c4b05043f560a56f967642094ba4a9f9bd52268994ac43a99446650a78dafe0ec851b9ebcfe95f3e216fd7942e4756f2e20bda67ca9187e55523fbba9ca56d8 SHA512 e0712ed3c068dc8dab1d31b7cbc19cd69c62875fdcf314abb28e6f42660daf162a3aae69e0a008919e7b809675b68d35f79d3cb98379442bcbc6f5c8ee4313bf EBUILD clamav-0.102.4.ebuild 6960 BLAKE2B 292ee4bf55f790a6002f10d4ea040272af557665e5251338d34a43760ffcb667c4fae1f581193425d3555c64b7dc71198621fe09309a9c2831b657162c71a5ed SHA512 8932730bfa50b9b467e3f59256b51054a51a12b52d9c54fb0b4c0b80ce06e8e897d4dd90b2b0044b3b8913a44d5c7aaaee3a177c821e7efe99af1fb4d52e3032 -EBUILD clamav-0.103.0-r1.ebuild 7363 BLAKE2B 270f546a204e8d863f45526630869e1ced9073de929903b4ad9c81b2b9684c3880b1395c6a467a92b5dabbdc6d236aee04b20d876f0ed0b79a3a0611f658d08f SHA512 0d38b9dd2808cad34941272458d5a439580f5838d1ca30b5753c1216cde16e4e25b833cc63819e75d74c0b7e877b53ab5f92ee46297c0b8f96801fc33ec9a658 +EBUILD clamav-0.103.0-r2.ebuild 7420 BLAKE2B 75e538c284ba5d5a9eff7c9c967b3f43b73680b0efdb40eaa9eb54bd02d0ba6c016232d48062e082cd0e217bc103d6334250b3c21d391e39676f377534be438e SHA512 b61a1acf5b5e3c8f14b5f02786dfe9fd900451276657c719543a2ec9823d0276b74d1cee71a925b2c6f935b05eea0ac5cf8770eff69e59e730718fa8f786157e MISC metadata.xml 933 BLAKE2B 867499e23131bf714cdddd911ef727dc6e487be8c6f0be1985611bc2ce8bfbee639e114f8ade6a6b9418095d03a45095030168912ab21484da81385c53255b05 SHA512 c0a3132dbfafbdb8852d621de187cfbd5daa30ab682593b88c77278e0c8a58fb57ed1427b9f8aa798926ccc94db4a19eeec77915f06de9b0cd182237aa77a892 diff --git a/app-antivirus/clamav/clamav-0.103.0-r1.ebuild b/app-antivirus/clamav/clamav-0.103.0-r1.ebuild deleted file mode 100644 index 52721c9856a2..000000000000 --- a/app-antivirus/clamav/clamav-0.103.0-r1.ebuild +++ /dev/null @@ -1,235 +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 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="bzip2 doc clamonacc clamdtop clamsubmit iconv ipv6 libclamav-only libressl milter metadata-analysis-api selinux systemd 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 )" - -# We need at least autoconf-2.69-r5 because that's the first (patched) -# version of it in Gentoo that supports ./configure --runstatedir. -BDEPEND=">=sys-devel/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.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 - 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" "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" 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 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.0-r2.ebuild b/app-antivirus/clamav/clamav-0.103.0-r2.ebuild new file mode 100644 index 000000000000..1ebe1bd96d9f --- /dev/null +++ b/app-antivirus/clamav/clamav-0.103.0-r2.ebuild @@ -0,0 +1,236 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +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" +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 systemd 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 )" + +# We need at least autoconf-2.69-r5 because that's the first (patched) +# version of it in Gentoo that supports ./configure --runstatedir. +BDEPEND=">=sys-devel/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.0-upstream-openrc.patch" + "${FILESDIR}/${PN}-0.103.0-freshclam-db-test-fix.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 + 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" "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" 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 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-freshclam-db-test-fix.patch b/app-antivirus/clamav/files/clamav-0.103.0-freshclam-db-test-fix.patch new file mode 100644 index 000000000000..25ae94b9fb85 --- /dev/null +++ b/app-antivirus/clamav/files/clamav-0.103.0-freshclam-db-test-fix.patch @@ -0,0 +1,27 @@ +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; -- cgit v1.2.3