public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Thomas Deutschmann" <whissi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/, app-antivirus/clamav/files/
Date: Fri, 20 Mar 2020 23:50:55 +0000 (UTC)	[thread overview]
Message-ID: <1584748138.822c01a576d1b9c063b45be5b1eba77130f4b073.whissi@gentoo> (raw)

commit:     822c01a576d1b9c063b45be5b1eba77130f4b073
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 20 23:14:09 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> 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 <whissi <AT> 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])


             reply	other threads:[~2020-03-20 23:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 23:50 Thomas Deutschmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-05 14:45 [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/, app-antivirus/clamav/files/ Michael Orlitzky
2023-02-15 22:51 Michael Orlitzky
2023-01-05  7:47 Sam James
2021-06-29  4:40 Sam James
2020-12-18  1:10 Michael Orlitzky
2020-06-21 13:38 Michael Orlitzky
2019-10-14  7:11 Lars Wendler
2018-04-20 12:03 Thomas Raschbacher
2018-04-12 12:13 Thomas Raschbacher
2018-03-29 22:42 Thomas Deutschmann
2018-01-26 15:23 Thomas Deutschmann
2017-12-07 15:29 Craig Andrews
2017-11-23 22:30 Robin H. Johnson
2017-01-27 19:44 Austin English

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1584748138.822c01a576d1b9c063b45be5b1eba77130f4b073.whissi@gentoo \
    --to=whissi@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox