I've been trying to think how to correctly relocate $(LOCAL_RULES_DIR) relative to $(PREFIX) when building SA. The problem of course being that in the "normal" case, /etc is not relative to $Config{prefix}, which is the default value of $(PREFIX). This is particularly important when a non-root user is installing.
Choices appear to be: (1) Change $(LOCAL_RULES_DIR) to always be $(PREFIX)/etc/spamassassin, giving up on using /etc/mail unless the installer edits Makefile.PL. I note that /usr/local/etc/spamassassin is already being searched before /etc/mail/spamassassin by the ordering of the @site_rules_path array, but there seems to be some feeling among sa-talk posters that /etc/mail is the "right" place to put this. (2) Prepend $(PREFIX) only if $Config{prefix} ne '/usr' at the time the Makefile is generated. This works for differing Perl installations, but not for "make PREFIX=...". (3) Test e.g. EUID at the time Makefile is generated to decide whether to prepend $(PREFIX) to the path. This helps out the non-root installer, but has two drawbacks: root still can't usefully specify "make PREFIX=...", and "perl Makefile.PL" has to be run with the same EUID as "make install". (4) Add some kind of conditional to the emitted Makefile that tests whether the make-time value of $(PREFIX) is the same as the generate-time value. This has portability problems -- either one has to use extended make syntax, or resort to conditional shell code in the rules (which makes specifying dependencies problematic). I'd actually prefer (1), but as there's already been some confusion over the relocation of /etc/spamassassin.cf and /etc/mail/spamassassin.cf it may not be a good idea to change it yet again. So the appended patch combines (2) and (3), using (-w '/') as the (non-) root installer test. Whatever the final decision, the POD in SpamAssassin.pm should be updated to reflect the changes to the search order. Index: Makefile.PL =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/Makefile.PL,v retrieving revision 1.24 diff -u -r1.24 Makefile.PL --- Makefile.PL 19 Feb 2002 20:17:41 -0000 1.24 +++ Makefile.PL 14 Apr 2002 18:19:34 -0000 @@ -3,6 +3,8 @@ my $DEF_RULES_DIR = '$(PREFIX)/share/spamassassin'; my $LOCAL_RULES_DIR = '/etc/mail/spamassassin'; + $LOCAL_RULES_DIR = '$(PREFIX)/etc/spamassassin' + unless ($Config{prefix} eq '/usr' && -w '/'); my $MYCFLAGS = ''; # this is a good place to put -g etc. _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk