You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/12/17 03:12:24 UTC

svn commit: r357273 - /spamassassin/trunk/Makefile.PL

Author: jm
Date: Fri Dec 16 18:12:19 2005
New Revision: 357273

URL: http://svn.apache.org/viewcvs?rev=357273&view=rev
Log:
install rules files that start with 72, the active rules prefix

Modified:
    spamassassin/trunk/Makefile.PL

Modified: spamassassin/trunk/Makefile.PL
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/Makefile.PL?rev=357273&r1=357272&r2=357273&view=diff
==============================================================================
--- spamassassin/trunk/Makefile.PL (original)
+++ spamassassin/trunk/Makefile.PL Fri Dec 16 18:12:19 2005
@@ -54,6 +54,11 @@
   'DEFRULESDIR',      # A synonym for 'DATADIR'.
   'LOCALRULESDIR',    # " "       "   'CONFDIR'.
 
+  'LOCALSTATEDIR',    # normally determined based on $*PREFIX.
+  'PERLLOCALSTATEDIR', 
+  'SITELOCALSTATEDIR', 
+  'VENDORLOCALSTATEDIR',
+
   'PERL_BIN',         # Sets the Perl interpreter used by the scripts.
   'PERL_VERSION',     # Some parts in SpamAssassin were dependant on the version
   'PERL_WARN',        # Can be used to disable warnings in the scripts
@@ -142,7 +147,7 @@
 
 # Gather the rules files in the range 00-69; we do this in perl because it's more portable
 my @datafiles = map { s,^rules/,,; $_ } (<rules/*.cf>);
-my $datafiles = join(' ', (grep { /^[0-6][0-9]_/ } @datafiles), qw(user_prefs.template triplets.txt languages));
+my $datafiles = join(' ', (grep { /^(?:[0-6][0-9]|72)_/ } @datafiles), qw(user_prefs.template triplets.txt languages));
 
 
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
@@ -598,6 +603,48 @@
   );
 }
 
+# This routine determines the correct LOCALSTATEDIR to use for the given
+# repository.
+#
+# The first parameter must be one value from @REPOSITORIES.
+#
+# *LOCALSTATEDIR can be overwritten with:
+#   *LOCALSTATEDIR
+#   LOCALSTATEDIR
+# If none of those is specified, it will chose an FHS-compliant dir
+# based on the corresponding *PREFIX:
+#   *PREFIX     *LOCALSTATEDIR
+#   /usr        /etc
+#   /usr/local  /etc
+#   /opt/*      /etc/opt
+#   /foo/*      /foo/*/etc
+sub _set_macro_LOCALSTATEDIR {
+  my($repository) = (@_);
+
+  my($macro);
+  $macro = $repository . "LOCALSTATEDIR";
+
+  # Is this macro already set?
+  return if get_macro($macro);
+
+  # Is this macro supposed to be overwritten?
+  if (get_macro('LOCALSTATEDIR')) {
+    set_macro($macro, macro_ref('LOCALSTATEDIR'));
+    return;
+  }
+
+  my($rprefix);
+  $rprefix = get_expanded_macro("${repository}PREFIX");
+
+  # Set the default, depending on the corresponding full PREFIX
+  set_macro($macro,
+    ($rprefix =~ m{^$})                ? ''         :
+    ($rprefix =~ m{^/usr(/local)?/?$}) ? '/var/lib' :
+    ($rprefix =~ m{^/opt(/|$)})        ? '/var/opt' :
+    macro_ref("${repository}PREFIX") . '/var'
+  );
+}
+
 # This routine determines the correct INSTALLDATADIR (aka DEFRULESDIR)
 # to use for the given repository.
 #
@@ -892,10 +939,12 @@
   # Add some additional target dirs
   {
     set_macro('SYSCONFDIR', "") unless get_macro('SYSCONFDIR');
+    set_macro('LOCALSTATEDIR', "") unless get_macro('LOCALSTATEDIR');
 
     # Determine the correct settings for each repository...
     foreach my $r (@REPOSITORIES) {
       _set_macro_SYSCONFDIR($r);
+      _set_macro_LOCALSTATEDIR($r);
       _set_macro_DATADIR($r);
       _set_macro_CONFDIR($r);
     }
@@ -908,6 +957,13 @@
       push(@code, macro_def($r . 'SYSCONFDIR'));
     }
 
+    push(@code, qq{});
+    push(@code, qq{# Where to install local state files});
+    push(@code, macro_def('LOCALSTATEDIR'));
+    foreach my $r (@REPOSITORIES) {
+      push(@code, macro_def($r . 'LOCALSTATEDIR'));
+    }
+
     foreach my $m (qw(DATA CONF)) {
       foreach my $r (@REPOSITORIES) {
         my $macro = 'INSTALL' . repository($r) . $m;
@@ -957,7 +1013,7 @@
     $repository = uc($SELF->{INSTALLDIRS}) || 'SITE';
 
     # For these the install paths are needed only.
-    foreach my $macro (qw(PREFIX SYSCONFDIR)) {
+    foreach my $macro (qw(PREFIX SYSCONFDIR LOCALSTATEDIR)) {
       push(@code, macro_def('I_' . $macro,
                     macro_ref($repository . $macro)));
     }
@@ -1018,6 +1074,7 @@
 		  -DPREFIX="$(I_PREFIX)" \
 		  -DDEF_RULES_DIR="$(I_DATADIR)" \
 		  -DLOCAL_RULES_DIR="$(I_CONFDIR)" \
+		  -DLOCAL_STATE_DIR="$(I_LOCALSTATEDIR)" \
 		  -DINSTALLSITELIB="$(I_LIBDIR)" \
 		  -DCONTACT_ADDRESS="$(CONTACT_ADDRESS)"