(CCing pgsql herd so they can say their opinion about init.d script)
I just finished setting up SpamAssassin with PostgreSQL support locally; currently the postgres useflag does not really help much, beside installing the proper Perl modules needed for PostgreSQL access. (Probably the same holds true for mysql, but I haven't looked that up.)
First of all, the ebuild should probably warn that the useflag alone won't enable any pgsql feature (okay this is trivial to know if you know Gentoo, but anyway).
Plus, with it enabled (and configured) and berkdb disabled, Bayesian filtering works just as well, so the warning about missing DB_File is then moot.
The init.d script does not currently require pgsql so spamd could be started without postgresql; as it can use a remote postgresql server it might not be a good idea to "need postgresql", but maybe "use postgresql" can help to get it started in the correct order.
And most important, the doc useflag is currently opting-in for user documentation (which is not the usual use for it, as user documentation should be always available), which includes the SQL schemas needed to properly set up the PostgreSQL database.
If wanted, I can provide a couple of possible ways to improve the situation.
(In reply to comment #0)
> The init.d script does not currently require pgsql so spamd could be started
> without postgresql; as it can use a remote postgresql server it might not be a
> good idea to "need postgresql", but maybe "use postgresql" can help to get it
> started in the correct order.
Created attachment 115727 [details, diff]
This is a proposed ebuild patch; it changes the name of the init.d file from 3.0.0-spamd.init to 3.1.8-spamd.init, as I'll be attaching a patch to the init.d file, then manages the init script so that if the postgres or mysql useflags are enabled, the proper code is enabled on the init script. It also removes the conditional on doc useflag for the installation of text documentation; the doc useflag still exists for html documentation, that as far as I can see require an extra step during compile.
The SQL documentation is installed only if one of the three SQL backends is installed; more fine-grained installation could be achieved so that only the schemas for the enabled databases are installed, but I'm unsure how much does that help.
The note to look at the documentation is no more conditional to doc useflag either, and it doesn't point to the .gz file (as it's likely to be bz2 nowadays, but should also be configurable, so taking it generic should be fine). An added note tell users to set up their SQL database if they want Bayes support, before checking for DB_File.
Probably the remaining einfo calls should be changed to elog, by the way.
Created attachment 115728 [details, diff]
Init script patch
how does this look;
*** Bug 216105 has been marked as a duplicate of this bug. ***
Updated init.d script added to spamassassin-3.3.1-r1 please test.