Blame SOURCES/mailman-2.1.13-FHS.patch

ccdd61
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in
ccdd61
index fb3f4f3..7dde965 100644
ccdd61
--- a/Mailman/Defaults.py.in
ccdd61
+++ b/Mailman/Defaults.py.in
ccdd61
@@ -1431,20 +1431,22 @@ AuthListPoster = 6    # List poster (Approved: <pw> header in posts only)
ccdd61
 
ccdd61
 # Useful directories
ccdd61
 LIST_DATA_DIR   = os.path.join(VAR_PREFIX, 'lists')
ccdd61
-LOG_DIR         = os.path.join(VAR_PREFIX, 'logs')
ccdd61
-LOCK_DIR        = os.path.join(VAR_PREFIX, 'locks')
ccdd61
+LOG_DIR         = '@LOG_DIR@'
ccdd61
+LOCK_DIR        = '@LOCK_DIR@'
ccdd61
+CONFIG_DIR      = '@CONFIG_DIR@'
ccdd61
 DATA_DIR        = os.path.join(VAR_PREFIX, 'data')
ccdd61
+PID_DIR         = '@PID_DIR@'
ccdd61
 SPAM_DIR        = os.path.join(VAR_PREFIX, 'spam')
ccdd61
 WRAPPER_DIR     = os.path.join(EXEC_PREFIX, 'mail')
ccdd61
 BIN_DIR         = os.path.join(PREFIX, 'bin')
ccdd61
 SCRIPTS_DIR     = os.path.join(PREFIX, 'scripts')
ccdd61
-TEMPLATE_DIR    = os.path.join(PREFIX, 'templates')
ccdd61
+TEMPLATE_DIR    = '@TEMPLATE_DIR@'
ccdd61
 MESSAGES_DIR    = os.path.join(PREFIX, 'messages')
ccdd61
 PUBLIC_ARCHIVE_FILE_DIR  = os.path.join(VAR_PREFIX, 'archives', 'public')
ccdd61
 PRIVATE_ARCHIVE_FILE_DIR = os.path.join(VAR_PREFIX, 'archives', 'private')
ccdd61
 
ccdd61
 # Directories used by the qrunner subsystem
ccdd61
-QUEUE_DIR       = os.path.join(VAR_PREFIX, 'qfiles')
ccdd61
+QUEUE_DIR       = '@QUEUE_DIR@'
ccdd61
 INQUEUE_DIR     = os.path.join(QUEUE_DIR, 'in')
ccdd61
 OUTQUEUE_DIR    = os.path.join(QUEUE_DIR, 'out')
ccdd61
 CMDQUEUE_DIR    = os.path.join(QUEUE_DIR, 'commands')
ccdd61
@@ -1458,9 +1460,9 @@ RETRYQUEUE_DIR  = os.path.join(QUEUE_DIR, 'retry')
ccdd61
 MAILDIR_DIR     = os.path.join(QUEUE_DIR, 'maildir')
ccdd61
 
ccdd61
 # Other useful files
ccdd61
-PIDFILE = os.path.join(DATA_DIR, 'master-qrunner.pid')
ccdd61
-SITE_PW_FILE = os.path.join(DATA_DIR, 'adm.pw')
ccdd61
-LISTCREATOR_PW_FILE = os.path.join(DATA_DIR, 'creator.pw')
ccdd61
+PIDFILE = os.path.join(PID_DIR, 'master-qrunner.pid')
ccdd61
+SITE_PW_FILE = os.path.join(CONFIG_DIR, 'adm.pw')
ccdd61
+LISTCREATOR_PW_FILE = os.path.join(CONFIG_DIR, 'creator.pw')
ccdd61
 
ccdd61
 # Import a bunch of version numbers
ccdd61
 from Version import *
ccdd61
diff --git a/Mailman/MTA/Postfix.py b/Mailman/MTA/Postfix.py
ccdd61
index 801ddc0..8506b9b 100644
ccdd61
--- a/Mailman/MTA/Postfix.py
ccdd61
+++ b/Mailman/MTA/Postfix.py
ccdd61
@@ -32,8 +32,8 @@ from Mailman.MTA.Utils import makealiases
ccdd61
 from Mailman.Logging.Syslog import syslog
ccdd61
 
ccdd61
 LOCKFILE = os.path.join(mm_cfg.LOCK_DIR, 'creator')
ccdd61
-ALIASFILE = os.path.join(mm_cfg.DATA_DIR, 'aliases')
ccdd61
-VIRTFILE = os.path.join(mm_cfg.DATA_DIR, 'virtual-mailman')
ccdd61
+ALIASFILE = os.path.join(mm_cfg.CONFIG_DIR, 'aliases')
ccdd61
+VIRTFILE = os.path.join(mm_cfg.CONFIG_DIR, 'virtual-mailman')
ccdd61
 # Desired mode for aliases(.db) and virtual-mailman(.db) for both creation
ccdd61
 # and check_perms.
ccdd61
 targetmode = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
ccdd61
diff --git a/Makefile.in b/Makefile.in
ccdd61
index eb40844..289aeee 100644
ccdd61
--- a/Makefile.in
ccdd61
+++ b/Makefile.in
ccdd61
@@ -28,6 +28,12 @@ bindir=		@bindir@
ccdd61
 prefix=		@prefix@
ccdd61
 exec_prefix=	@exec_prefix@
ccdd61
 var_prefix=	@VAR_PREFIX@
ccdd61
+configdir=	@CONFIG_DIR@
ccdd61
+lockdir=	@LOCK_DIR@
ccdd61
+logdir=		@LOG_DIR@
ccdd61
+piddir=		@PID_DIR@
ccdd61
+queuedir=	@QUEUE_DIR@
ccdd61
+templatedir=	@TEMPLATE_DIR@
ccdd61
 DESTDIR=
ccdd61
 
ccdd61
 CC=		@CC@
ccdd61
@@ -41,8 +47,11 @@ DEFS=		@DEFS@
ccdd61
 OPT=		@OPT@
ccdd61
 CFLAGS=		@CFLAGS@ $(OPT) $(DEFS)
ccdd61
 
ccdd61
+FHS_DIRS= \
ccdd61
+	${configdir} ${lockdir} ${logdir} ${piddir} ${queuedir} ${templatedir}
ccdd61
+
ccdd61
 VAR_DIRS= \
ccdd61
-	logs archives lists locks data spam qfiles \
ccdd61
+	archives lists data spam \
ccdd61
 	archives/private archives/public
ccdd61
 
ccdd61
 ARCH_INDEP_DIRS= \
ccdd61
@@ -105,6 +114,15 @@ doinstall: $(SUBDIRS)
ccdd61
 	    else true; \
ccdd61
 	    fi; \
ccdd61
 	done
ccdd61
+	@for d in $(FHS_DIRS); \
ccdd61
+	do \
ccdd61
+	    dir=$(DESTDIR)/$$d; \
ccdd61
+	    if test ! -d $$dir; then \
ccdd61
+		echo "Creating directory $$dir"; \
ccdd61
+		$(INSTALL) -d -m $(DIRMODE) $$dir; \
ccdd61
+	    else true; \
ccdd61
+	    fi; \
ccdd61
+	done
ccdd61
 	chmod o-r $(DESTDIR)$(var_prefix)/archives/private
ccdd61
 	@for d in $(ARCH_INDEP_DIRS); \
ccdd61
 	do \
ccdd61
diff --git a/bin/check_perms b/bin/check_perms
ccdd61
index 137ebfb..1f45f84 100755
ccdd61
--- a/bin/check_perms
ccdd61
+++ b/bin/check_perms
ccdd61
@@ -183,7 +183,8 @@ def checkall():
ccdd61
         print C_('checking mode for %(prefix)s')
ccdd61
     dirs = {}
ccdd61
     for d in (mm_cfg.PREFIX, mm_cfg.EXEC_PREFIX, mm_cfg.VAR_PREFIX,
ccdd61
-              mm_cfg.LOG_DIR):
ccdd61
+              mm_cfg.CONFIG_DIR, mm_cfg.DATA_DIR, mm_cfg.LOCK_DIR,
ccdd61
+              mm_cfg.LOG_DIR, mm_cfg.QUEUE_DIR, mm_cfg.PID_DIR):
ccdd61
         dirs[d] = True
ccdd61
     for d in dirs.keys():
ccdd61
         try:
ccdd61
diff --git a/configure.in b/configure.in
ccdd61
index f2eb1c0..c01129c 100644
ccdd61
--- a/configure.in
ccdd61
+++ b/configure.in
ccdd61
@@ -305,6 +305,72 @@ else
ccdd61
     prefixcheck=$VAR_PREFIX
ccdd61
 fi
ccdd61
 
ccdd61
+# Get the configuration file directory
ccdd61
+AC_SUBST(CONFIG_DIR)
ccdd61
+AC_MSG_CHECKING(for --with-config-dir)
ccdd61
+AC_ARG_WITH(config-dir, dnl
ccdd61
+[  --with-config-dir    specify directory for configuration data other than [VAR_]PREFIX/data])
ccdd61
+case "$with_config_dir" in
ccdd61
+    yes|no|"") CONFIG_DIR="$VAR_PREFIX/data";;
ccdd61
+    *)         CONFIG_DIR=$with_config_dir;;
ccdd61
+esac
ccdd61
+AC_MSG_RESULT($CONFIG_DIR)
ccdd61
+
ccdd61
+# Get the lock directory
ccdd61
+AC_SUBST(LOCK_DIR)
ccdd61
+AC_MSG_CHECKING(for --with-lock-dir)
ccdd61
+AC_ARG_WITH(lock-dir, dnl
ccdd61
+[  --with-lock-dir    specify directory for lock files other than [VAR_]PREFIX/locks])
ccdd61
+case "$with_lock_dir" in
ccdd61
+    yes|no|"") LOCK_DIR="$VAR_PREFIX/locks";;
ccdd61
+    *)         LOCK_DIR=$with_lock_dir;;
ccdd61
+esac
ccdd61
+AC_MSG_RESULT($LOCK_DIR)
ccdd61
+
ccdd61
+# Get the log directory
ccdd61
+AC_SUBST(LOG_DIR)
ccdd61
+AC_MSG_CHECKING(for --with-log-dir)
ccdd61
+AC_ARG_WITH(log-dir, dnl
ccdd61
+[  --with-log-dir    specify directory for log files other than [VAR_]PREFIX/logs])
ccdd61
+case "$with_log_dir" in
ccdd61
+    yes|no|"") LOG_DIR="$VAR_PREFIX/logs";;
ccdd61
+    *)         LOG_DIR=$with_log_dir;;
ccdd61
+esac
ccdd61
+AC_MSG_RESULT($LOG_DIR)
ccdd61
+
ccdd61
+# Get the pid directory
ccdd61
+AC_SUBST(PID_DIR)
ccdd61
+AC_MSG_CHECKING(for --with-pid-dir)
ccdd61
+AC_ARG_WITH(pid-dir, dnl
ccdd61
+[  --with-pid-dir    specify directory for the pid file other than [VAR_]PREFIX/data])
ccdd61
+case "$with_pid_dir" in
ccdd61
+    yes|no|"") PID_DIR="$VAR_PREFIX/data";;
ccdd61
+    *)         PID_DIR=$with_pid_dir;;
ccdd61
+esac
ccdd61
+AC_MSG_RESULT($PID_DIR)
ccdd61
+
ccdd61
+# Get the queue directory
ccdd61
+AC_SUBST(QUEUE_DIR)
ccdd61
+AC_MSG_CHECKING(for --with-queue-dir)
ccdd61
+AC_ARG_WITH(queue-dir, dnl
ccdd61
+[  --with-queue-dir    specify directory for queue files other than [VAR_]PREFIX/qfiles])
ccdd61
+case "$with_queue_dir" in
ccdd61
+    yes|no|"") QUEUE_DIR="$VAR_PREFIX/qfiles";;
ccdd61
+    *)         QUEUE_DIR=$with_queue_dir;;
ccdd61
+esac
ccdd61
+AC_MSG_RESULT($QUEUE_DIR)
ccdd61
+
ccdd61
+# Get the template directory
ccdd61
+AC_SUBST(TEMPLATE_DIR)
ccdd61
+AC_MSG_CHECKING(for --with-template-dir)
ccdd61
+AC_ARG_WITH(template-dir, dnl
ccdd61
+[  --with-template-dir    specify directory for template files other than [VAR_]PREFIX/templates])
ccdd61
+case "$with_template_dir" in
ccdd61
+    yes|no|"") TEMPLATE_DIR="$VAR_PREFIX/templates";;
ccdd61
+    *)         TEMPLATE_DIR=$with_template_dir;;
ccdd61
+esac
ccdd61
+AC_MSG_RESULT($TEMPLATE_DIR)
ccdd61
+
ccdd61
 # new macro for finding group names
ccdd61
 # returns a comma separated list of quoted group names
ccdd61
 # the list is returned in the same order as specified with any duplicates removed
ccdd61
diff --git a/misc/Makefile.in b/misc/Makefile.in
ccdd61
index af99c04..df50a06 100644
ccdd61
--- a/misc/Makefile.in
ccdd61
+++ b/misc/Makefile.in
ccdd61
@@ -27,6 +27,12 @@ bindir= 	@bindir@
ccdd61
 prefix=   	@prefix@
ccdd61
 exec_prefix=	@exec_prefix@
ccdd61
 var_prefix=	@VAR_PREFIX@
ccdd61
+configdir=	@CONFIG_DIR@
ccdd61
+lockdir=	@LOCK_DIR@
ccdd61
+logdir=		@LOG_DIR@
ccdd61
+piddir=		@PID_DIR@
ccdd61
+queuedir=	@QUEUE_DIR@
ccdd61
+MAILMAN_GROUP=  @MAILMAN_GROUP@
ccdd61
 DESTDIR=
ccdd61
 
ccdd61
 CC=		@CC@
ccdd61
@@ -87,7 +93,7 @@ install-other:
ccdd61
 	    $(INSTALL) -m $(FILEMODE) paths.py $$dir; \
ccdd61
 	done
ccdd61
 	$(INSTALL) -m $(EXEMODE) mailman $(DESTDIR)$(SCRIPTSDIR)
ccdd61
-	$(INSTALL) -m $(FILEMODE) sitelist.cfg $(DESTDIR)$(DATADIR)
ccdd61
+	$(INSTALL) -m $(FILEMODE) sitelist.cfg $(DESTDIR)$(configdir)
ccdd61
 
ccdd61
 install-packages:
ccdd61
 	if [ -z "$(EMAILPKG)" -a -d $(DESTDIR)$(PYTHONLIBDIR)/email ] ; \
ccdd61
diff --git a/templates/Makefile.in b/templates/Makefile.in
ccdd61
index b23d7c1..16930a2 100644
ccdd61
--- a/templates/Makefile.in
ccdd61
+++ b/templates/Makefile.in
ccdd61
@@ -25,6 +25,7 @@ srcdir= 	@srcdir@
ccdd61
 bindir= 	@bindir@
ccdd61
 prefix=   	@prefix@
ccdd61
 exec_prefix=	@exec_prefix@
ccdd61
+template_dir=   @TEMPLATE_DIR@
ccdd61
 DESTDIR=
ccdd61
 
ccdd61
 CC=		@CC@
ccdd61
@@ -37,7 +38,7 @@ DEFS=   	@DEFS@
ccdd61
 
ccdd61
 OPT=		@OPT@
ccdd61
 CFLAGS=		$(OPT) $(DEFS)
ccdd61
-TEMPLATEDIR= 	$(prefix)/templates
ccdd61
+TEMPLATEDIR= 	$(template_dir)
ccdd61
 
ccdd61
 SHELL=		/bin/sh
ccdd61