From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id AA2D3138350 for ; Fri, 20 Mar 2020 23:51:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C8288E09ED; Fri, 20 Mar 2020 23:50:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 985A7E09ED for ; Fri, 20 Mar 2020 23:50:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0A9EA34F0E0 for ; Fri, 20 Mar 2020 23:50:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5568D13A for ; Fri, 20 Mar 2020 23:50:55 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1584748138.822c01a576d1b9c063b45be5b1eba77130f4b073.whissi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/, app-antivirus/clamav/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-antivirus/clamav/clamav-0.102.2-r1.ebuild app-antivirus/clamav/clamav-0.102.2.ebuild app-antivirus/clamav/files/clamav-0.102.2-fix-curl-detection.patch X-VCS-Directories: app-antivirus/clamav/files/ app-antivirus/clamav/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 822c01a576d1b9c063b45be5b1eba77130f4b073 X-VCS-Branch: master Date: Fri, 20 Mar 2020 23:50:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5a290194-85fa-4984-ab35-47138b45900f X-Archives-Hash: fc2fc055c2fbd2f94efcdfe36ed59711 commit: 822c01a576d1b9c063b45be5b1eba77130f4b073 Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Mar 20 23:14:09 2020 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Mar 20 23:48:58 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=822c01a5 app-antivirus/clamav: rev bump - Migrate to EAPI 7. - Fix USE=libclamav-only. - Set proper REQUIRED_USE to indicate that USE=libclamav-only will really only install libs. - Install HTML docs only when USE=doc is set. Closes: https://bugs.gentoo.org/709616 Package-Manager: Portage-2.3.94, Repoman-2.3.21 Signed-off-by: Thomas Deutschmann gentoo.org> ...mav-0.102.2.ebuild => clamav-0.102.2-r1.ebuild} | 178 +++++++++++---------- .../files/clamav-0.102.2-fix-curl-detection.patch | 26 +++ 2 files changed, 123 insertions(+), 81 deletions(-) diff --git a/app-antivirus/clamav/clamav-0.102.2.ebuild b/app-antivirus/clamav/clamav-0.102.2-r1.ebuild similarity index 50% rename from app-antivirus/clamav/clamav-0.102.2.ebuild rename to app-antivirus/clamav/clamav-0.102.2-r1.ebuild index 1aa121ef78f..1c7040145e4 100644 --- a/app-antivirus/clamav/clamav-0.102.2.ebuild +++ b/app-antivirus/clamav/clamav-0.102.2-r1.ebuild @@ -1,9 +1,9 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=7 -inherit autotools eutils flag-o-matic ltprune systemd +inherit autotools flag-o-matic systemd DESCRIPTION="Clam Anti-Virus Scanner" HOMEPAGE="https://www.clamav.net/" @@ -13,6 +13,9 @@ 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 @@ -20,37 +23,33 @@ RESTRICT="!test? ( test )" # 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 ) - metadata-analysis-api? ( dev-libs/json-c:= ) - milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) ) - >=sys-libs/zlib-1.2.2:= + !libclamav-only? ( net-misc/curl ) !libressl? ( dev-libs/openssl:0= ) libressl? ( dev-libs/libressl:0= ) - dev-libs/libltdl - || ( dev-libs/libpcre2 >dev-libs/libpcre-6 ) - dev-libs/libmspack - xml? ( dev-libs/libxml2 ) - elibc_musl? ( sys-libs/fts-standalone ) - !libclamav-only? ( net-misc/curl ) - clamsubmit? ( net-misc/curl dev-libs/json-c:= )" -REQUIRED_USE=" - libclamav-only? ( !clamsubmit ) - clamsubmit? ( !libclamav-only ) -" + milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) ) + xml? ( dev-libs/libxml2 )" + +BDEPEND="virtual/pkgconfig" DEPEND="${CDEPEND} - virtual/pkgconfig + metadata-analysis-api? ( dev-libs/json-c:* ) test? ( dev-libs/check )" RDEPEND="${CDEPEND} selinux? ( sec-policy/selinux-clamav )" -HTML_DOCS=( docs/html/. ) - 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() { @@ -106,79 +105,94 @@ src_install() { default rm -rf "${ED}"/var/lib/clamav || die - 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 + 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/clamav-milter.pid:" \ - -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \ + -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+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \ + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \ + -e "s:^\#\(LogTime\).*:\1 yes:" \ -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 + -e "s:^\#\(DatabaseDirectory\).*:\1 /var/lib/clamav:" \ + "${ED}"/etc/clamd.conf.sample || die - if use doc; then - einstalldocs - doman docs/man/*.[1-8] + 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 - for i in clamd freshclam clamav-milter - do - if [[ -f "${D}"/etc/"${i}".conf.sample ]]; then - mv "${D}"/etc/"${i}".conf{.sample,} || die - fi - done + if use doc ; then + local HTML_DOCS=( docs/html/. ) + einstalldocs - prune_libtool_files --all + if ! use libclamav-only ; then + doman docs/man/*.[1-8] + fi + fi - # 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 + 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 } @@ -187,11 +201,13 @@ pkg_postinst() { 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=( "${ROOT}"var/lib/clamav/main.c[lv]d ) + + 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.102.2-fix-curl-detection.patch b/app-antivirus/clamav/files/clamav-0.102.2-fix-curl-detection.patch new file mode 100644 index 00000000000..f89a704ea3e --- /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])