Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 528814 - mail-filter/spamassassin should depend on || ( perl-core/DB_File dev-lang/perl[berkdb] )
Summary: mail-filter/spamassassin should depend on || ( perl-core/DB_File dev-lang/per...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-10 13:11 UTC by Mattias Merilai
Modified: 2014-11-30 21:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mattias Merilai 2014-11-10 13:11:30 UTC
sa-learn and possibly all bayes on spamassassin is broken because a needed 
perl module has not been pulled in by portage.




Reproducible: Always

Steps to Reproduce:
Do not have any of perl-core/DB_File or dev-lang/perl[berkdb] installed.

Actual Results:  
# sa-learn --spam /var/spool/mail/mattias.merilai/.Spam/
Learned tokens from 0 message(s) (1 message(s) examined)
ERROR: the Bayes learn function returned an error, please re-run with -D for more information at /usr/bin/sa-learn line 493.

Running with -D gives:
Nov 10 14:20:45.903 [11429] dbg: bayes: DB_File module not installed, cannot use bayes


Expected Results:  
With any one of the two dependecies installed:
# sa-learn --spam /var/spool/mail/mattias.merilai/.Spam/
Learned tokens from 17 message(s) (17 message(s) examined)


Tested on hardened w/ mail-filter/spamassassin-3.3.2-r5, dev-lang/perl-5.18.2-r2 and perl-core/DB_File-1.827.0-r1

RDEPEND'ing spamassassin on virtual/perl-DB_File-1.827.0-r2 seems to be a fix.
RDEPEND'ing spamassassin on virtual/perl-DB_File-1.829.0 seems to be a partial fix, since it does not consider perl[berkdb] as a provider.
RDEPEND'ing spamassassin on virtual/perl-DB_File-1.831.0 goes into a mess of keyworded packages, which i will not try to unravel on a production machine.
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2014-11-29 20:41:42 UTC
Fixed.
Comment 2 Guillaume Castagnino 2014-11-30 06:15:34 UTC
Please revert. This is false, berkDB is not mandatory, there is other way to use bayes.
You just have to enable ONE database backend and configure it (some does not need to be configured): postgres OR berkdb OR mysql OR sqlite. Personally I use postgres, and bayes is working, thanks (and berekdb is not installed on my system and I do not want it: I like to avoid packages with crappy licenses).

Read the doc on how to configure it : /usr/share/doc/spamassassin-3.4.0/README.bayes.bz2

The correct fix is certainly not to remove berkdb USE flag, it looks like this:

--- spamassassin-3.4.0.ebuild.orig      2014-11-30 07:09:52.330406552 +0100
+++ spamassassin-3.4.0.ebuild   2014-11-30 07:11:19.635099601 +0100
@@ -15,7 +15,9 @@
 LICENSE="Apache-2.0 GPL-2"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
-IUSE="berkdb qmail ssl doc ldap mysql postgres sqlite ipv6"
+IUSE="+berkdb qmail ssl doc ldap mysql postgres sqlite ipv6"
+
+REQUIRED_USE="|| ( berkdb mysql postgres sqlite )"

 DEPEND=">=dev-lang/perl-5.8.8-r8
        virtual/perl-MIME-Base64

Thanks !
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2014-11-30 21:24:52 UTC
(In reply to Guillaume Castagnino from comment #2)
> Please revert. This is false, berkDB is not mandatory, there is other way to
> use bayes.
> You just have to enable ONE database backend and configure it (some does not
> need to be configured): postgres OR berkdb OR mysql OR sqlite. Personally I
> use postgres, and bayes is working, thanks (and berekdb is not installed on
> my system and I do not want it: I like to avoid packages with crappy
> licenses).
> 
> Read the doc on how to configure it :
> /usr/share/doc/spamassassin-3.4.0/README.bayes.bz2
> 
> The correct fix is certainly not to remove berkdb USE flag, it looks like
> this:
> 
> --- spamassassin-3.4.0.ebuild.orig      2014-11-30 07:09:52.330406552 +0100
> +++ spamassassin-3.4.0.ebuild   2014-11-30 07:11:19.635099601 +0100
> @@ -15,7 +15,9 @@
>  LICENSE="Apache-2.0 GPL-2"
>  SLOT="0"
>  KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86
> ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
> -IUSE="berkdb qmail ssl doc ldap mysql postgres sqlite ipv6"
> +IUSE="+berkdb qmail ssl doc ldap mysql postgres sqlite ipv6"
> +
> +REQUIRED_USE="|| ( berkdb mysql postgres sqlite )"
> 
>  DEPEND=">=dev-lang/perl-5.8.8-r8
>         virtual/perl-MIME-Base64
> 
> Thanks !

Done as you suggested.