SA Bugzilla – Bug 25
installing spamassassin outside of the main perl library
Last modified: 2002-04-01 02:06:34 UTC
I've installed spamassassin in my home directory essentially just like described in the archived mailing list message here: http://www.geocrawler.com/archives/3/11679/2001/12/0/7425099/ This, unfortunately, does not work without some modification. Although everything installs where I want it, spamassassin can't find its own configuration files since the various rules and prefs paths set in SpamAssassin.pm are completely hardcoded: they ignore the setting of PREFIX. Simply adding these: - $PREFIX/share/spamassassin to @default_rules_path - $PREFIX/etc/mail/spamassassin to @site_rules_path - $PREFIX/share/spamassassin/user_prefs.template to @default_prefs_path ... looks like it will allow spamassassin to find its files in the places that a 'make install' puts them if the user customizes PREFIX as I have done.
Hmm. Is $PREFIX defined properly at runtime? Can I just add these directories in SpamAssassin.pm inside the qw() definitions?
No. $PREFIX is not an environment variable - it's a Makefile variable. It's value needs to be substituted into SpamAssassin.pm during the 'make'. Check out your Makefile.PL file - it defines this: my $DEF_RULES_DIR = '$(PREFIX)/share/spamassassin'; ... which indeed puts the default rules files under $PREFIX. But SpamAssassin doesn't actually _look_ for them there. I actually also changed the next line to look like this: my $LOCAL_RULES_DIR = '$(PREFIX)/etc/mail/spamassassin'; ... since I can't have any of this stuff installed outside my home directory. Really, I think all of the paths in SpamAssassin.pm ought to be configured at build time, under control of the Makefile, rather then just having a list of places where the config files _might_ be hardcoded into the module. Or, at the very least, you should add directions to the build instructions in the README that lib/Mail/SpamAssassin.pm will need to have these path variables edited if you wish to have your config files installed somewhere outside of the default paths.
*** Bug 41 has been marked as a duplicate of this bug. ***
Downgraded priority since README has been updated to mention the '-c' flag for local installations.
*** This bug has been marked as a duplicate of 80 ***