Skip to content

Commit

Permalink
app-antivirus/clamav: new revision to fix USE="-clamsubmit".
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
orlitzky committed May 2, 2020
1 parent 3827bc3 commit 2387780
Showing 1 changed file with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 )"
Expand All @@ -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() {
Expand All @@ -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=(
Expand All @@ -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
Expand Down

0 comments on commit 2387780

Please sign in to comment.