summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2016-09-05 13:47:53 -0400
committerMichael Orlitzky <mjo@gentoo.org>2016-09-05 14:08:31 -0400
commita3fce5aa83016c4bd16d56a82b4ef00433225423 (patch)
treecdb187c18ade04a3b82d0b04c01c9142ae128fcf /mail-filter/spamassassin
parentwww-apps/jekyll: Version bump to 3.2.1 (diff)
downloadgentoo-a3fce5aa83016c4bd16d56a82b4ef00433225423.tar.gz
gentoo-a3fce5aa83016c4bd16d56a82b4ef00433225423.tar.bz2
gentoo-a3fce5aa83016c4bd16d56a82b4ef00433225423.zip
mail-filter/spamassassin: new revision with correct build dependencies.
The existing dependencies for spamassassin were all thrown into DEPEND and then propagated to RDEPEND -- even the ones that were obviously only needed at runtime. Marcin Mirosław helped track down the correct value of DEPEND, and the rest of the optional dependencies were moved to RDEPEND. The required and optional dependencies are now stored in REQDEPEND/OPTDEPEND variables to eliminate duplication. This is primarily useful with USE=test, which makes DEPEND a superset of RDEPEND, since the other inclusion alreads holds normally. Once the test suite had the correct dependencies, the RESTRICT=test was removed, and problematic spamc/spamd tests were disabled. The test suite should pass now. Gentoo-Bug: 592682 Package-Manager: portage-2.2.28
Diffstat (limited to 'mail-filter/spamassassin')
-rw-r--r--mail-filter/spamassassin/spamassassin-3.4.1-r8.ebuild (renamed from mail-filter/spamassassin/spamassassin-3.4.1-r7.ebuild)87
1 files changed, 56 insertions, 31 deletions
diff --git a/mail-filter/spamassassin/spamassassin-3.4.1-r7.ebuild b/mail-filter/spamassassin/spamassassin-3.4.1-r8.ebuild
index 00838ba58fc..78eb6b5d3e7 100644
--- a/mail-filter/spamassassin/spamassassin-3.4.1-r7.ebuild
+++ b/mail-filter/spamassassin/spamassassin-3.4.1-r8.ebuild
@@ -4,7 +4,7 @@
EAPI=6
-inherit toolchain-funcs systemd
+inherit perl-functions systemd toolchain-funcs
MY_P="Mail-SpamAssassin-${PV//_/-}"
S="${WORKDIR}/${MY_P}"
@@ -20,31 +20,43 @@ IUSE="+bayes berkdb cron ipv6 ldap libressl mysql postgres qmail sqlite ssl test
# You can do without a database unless you need the Bayes features.
REQUIRED_USE="bayes? ( || ( berkdb mysql postgres sqlite ) )"
+# The Makefile.PL script checks for dependencies, but only fails if a
+# required (i.e. not optional) dependency is missing. We therefore
+# require most of the optional modules only at runtime.
+REQDEPEND="dev-lang/perl
+ dev-perl/HTML-Parser
+ dev-perl/Net-DNS
+ dev-perl/NetAddr-IP
+ virtual/perl-Archive-Tar
+ virtual/perl-Digest-SHA
+ virtual/perl-IO-Zlib
+ virtual/perl-Time-HiRes
+ ssl? (
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )
+ )"
+
# SpamAssassin doesn't use libwww-perl except as a fallback for when
# curl/wget are missing, so we depend on one of those instead. Some
# mirrors use https, so we need those utilities to support SSL.
#
# re2c is needed to compile the rules (sa-compile).
#
-DEPEND="app-crypt/gnupg
- dev-lang/perl
+# We still need the old Digest-SHA1 because razor2 has not been ported
+# to Digest-SHA.
+OPTDEPEND="app-crypt/gnupg
dev-perl/Digest-SHA1
dev-perl/Encode-Detect
dev-perl/Geo-IP
- dev-perl/HTML-Parser
dev-perl/HTTP-Date
dev-perl/Mail-DKIM
dev-perl/Mail-SPF
- dev-perl/Net-DNS
dev-perl/Net-Patricia
- dev-perl/NetAddr-IP
+ dev-perl/Net-CIDR-Lite
dev-util/re2c
|| ( net-misc/wget[ssl] net-misc/curl[ssl] )
- virtual/perl-Archive-Tar
- virtual/perl-IO-Zlib
virtual/perl-MIME-Base64
virtual/perl-Pod-Parser
- virtual/perl-Time-HiRes
berkdb? ( virtual/perl-DB_File )
ipv6? ( dev-perl/IO-Socket-INET6 )
ldap? ( dev-perl/perl-ldap )
@@ -60,18 +72,14 @@ DEPEND="app-crypt/gnupg
dev-perl/DBI
dev-perl/DBD-SQLite
)
- ssl? (
- dev-perl/IO-Socket-SSL
- !libressl? ( dev-libs/openssl:0 )
- libressl? ( dev-libs/libressl )
- )"
-
-RDEPEND="${DEPEND}
- dev-perl/Net-CIDR-Lite"
+ ssl? ( dev-perl/IO-Socket-SSL )"
-# Some spamd tests fail, and it looks like the whole suite eventually
-# hangs.
-RESTRICT=test
+DEPEND="${REQDEPEND}
+ test? (
+ ${OPTDEPEND}
+ virtual/perl-Test-Harness
+ )"
+RDEPEND="${REQDEPEND} ${OPTDEPEND}"
PATCHES=(
"${FILESDIR}/spamassassin-3.4.1-bug_7199.patch"
@@ -80,13 +88,22 @@ PATCHES=(
"${FILESDIR}/spamassassin-3.4.1-bug_7265.patch"
)
-src_configure() {
- # spamc can be built with ssl support.
- local use_ssl="no"
- if use ssl; then
- use_ssl="yes"
- fi
+src_prepare() {
+ default
+
+ # The sa_compile test does some weird stuff like hopping around in
+ # the directory tree and calling "make" to create a dist tarball
+ # from ${S}. It fails, and is more trouble than it's worth...
+ perl_rm_files t/sa_compile.t || die 'failed to remove sa_compile test'
+
+ # The spamc tests (which need the networked spamd daemon) fail for
+ # irrelevant reasons. It's too hard to disable them (unlike the
+ # spamd tests themselves -- see src_test), so use a crude
+ # workaround.
+ perl_rm_files t/spamc_*.t || die 'failed to remove spamc tests'
+}
+src_configure() {
# Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
# (just to be sure, nobody knows how it could happen in the first place).
#
@@ -98,9 +115,9 @@ src_configure() {
SYSCONFDIR="${EPREFIX}/etc" \
DATADIR="${EPREFIX}/usr/share/spamassassin" \
PERL_BIN="${EPREFIX}/usr/bin/perl" \
- ENABLE_SSL="${use_ssl}" \
+ ENABLE_SSL="$(usex ssl)" \
DESTDIR="${D}" \
- || die "Unable to build!"
+ || die 'failed to create a Makefile using Makefile.PL'
# Now configure spamc.
emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile
@@ -133,12 +150,12 @@ src_install () {
# Disable plugin by default
sed -i -e 's/^loadplugin/\#loadplugin/g' \
- "${ED}"/etc/mail/spamassassin/init.pre \
+ "${ED}/etc/mail/spamassassin/init.pre" \
|| die "failed to disable plugins by default"
# Add the init and config scripts.
- newinitd "${FILESDIR}"/3.4.1-spamd.init spamd
- newconfd "${FILESDIR}"/3.4.1-spamd.conf spamd
+ newinitd "${FILESDIR}/3.4.1-spamd.init" spamd
+ newconfd "${FILESDIR}/3.4.1-spamd.conf" spamd
systemd_newunit "${FILESDIR}/${PN}.service-r1" "${PN}.service"
systemd_install_serviced "${FILESDIR}/${PN}.service.conf"
@@ -197,6 +214,14 @@ src_install () {
fi
}
+src_test() {
+ # Trick the test suite into skipping the spamd tests. Setting
+ # SPAMD_HOST to a non-localhost value causes SKIP_SPAMD_TESTS to be
+ # set in SATest.pm.
+ export SPAMD_HOST=disabled
+ default
+}
+
pkg_postinst() {
elog
elog 'No rules are installed by default. You will need to run sa-update'