Blame SOURCES/mailman-2.1.13-FHS.patch

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