commit:     2387780fc6c76791618ee404889268606bb1530a
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sat May  2 12:12:03 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat May  2 12:12:20 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2387780f

app-antivirus/clamav: new revision to fix USE="-clamsubmit".

Disabling clamsubmit didn't work; now it does. A conditional dependency on
libjson-c with USE=metadata-analysis-api has also been moved into RDEPEND
from DEPEND, because libclamav gets linked to it in that case.

Closes: https://bugs.gentoo.org/720390
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 ...-0.102.2-r2.ebuild => clamav-0.102.2-r3.ebuild} | 25 ++++++++++++++++------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/app-antivirus/clamav/clamav-0.102.2-r2.ebuild 
b/app-antivirus/clamav/clamav-0.102.2-r3.ebuild
similarity index 88%
rename from app-antivirus/clamav/clamav-0.102.2-r2.ebuild
rename to app-antivirus/clamav/clamav-0.102.2-r3.ebuild
index 35a1db0325c..e4700595b03 100644
--- a/app-antivirus/clamav/clamav-0.102.2-r2.ebuild
+++ b/app-antivirus/clamav/clamav-0.102.2-r3.ebuild
@@ -35,13 +35,13 @@ CDEPEND="acct-group/clamav
        !libclamav-only? ( net-misc/curl )
        !libressl? ( dev-libs/openssl:0= )
        libressl? ( dev-libs/libressl:0= )
+       metadata-analysis-api? ( dev-libs/json-c:= )
        milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
        xml? ( dev-libs/libxml2 )"
 
 BDEPEND="virtual/pkgconfig"
 
 DEPEND="${CDEPEND}
-       metadata-analysis-api? ( dev-libs/json-c:* )
        test? ( dev-libs/check )"
 RDEPEND="${CDEPEND}
        selinux? ( sec-policy/selinux-clamav )"
@@ -55,6 +55,19 @@ PATCHES=(
 src_prepare() {
        default
        eautoconf
+
+       if ! use clamsubmit; then
+               # ENABLE_CLAMSUBMIT is defined in the configure script based on
+               # only the values of $have_curl and $have_json (so we have no
+               # easy way to disable it). Here we hack the configure script to
+               # manually set the value of ENABLE_CLAMSUBMIT to something falsy
+               # when USE=clamsubmit is not set. Yes, this looks backwards. The
+               # value '#' is not a boolean indicator, it's a comment 
character.
+               sed -e "s/ENABLE_CLAMSUBMIT_TRUE=$/ENABLE_CLAMSUBMIT_TRUE='#'/" 
\
+                       -e 
"s/ENABLE_CLAMSUBMIT_FALSE='#'/ENABLE_CLAMSUBMIT_FALSE=/" \
+                       -i configure \
+                       || die 'failed to disable clamsubmit in ./configure 
script'
+       fi
 }
 
 src_configure() {
@@ -67,13 +80,11 @@ src_configure() {
        # but that does not work
        # do not add this, since --disable-xml seems to override
        # --without-xml
-       JSONUSE="--without-libjson"
+       JSONCONF="--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"
+               # Either of these requires libjson-c.
+               JSONCONF="--with-libjson=${EPREFIX}/usr"
        fi
 
        local myeconfargs=(
@@ -84,7 +95,7 @@ src_configure() {
                $(use_enable test check)
                $(use_with xml)
                $(use_with iconv)
-               ${JSONUSE}
+               ${JSONCONF}
                $(use_enable libclamav-only)
                $(use_with !libclamav-only libcurl)
                --with-system-libmspack

Reply via email to