[Pkg-sympa-commits] [SCM] sympa Debian packaging branch, master, updated. debian/6.1.1_dfsg-2-23-g23bd360

Emmanuel Bouthenot kolter at openics.org
Sun May 29 22:17:45 UTC 2011


The following commit has been merged in the master branch:
commit 2a6e09ac86445624000f20f64503b6e00146d10b
Author: Emmanuel Bouthenot <kolter at openics.org>
Date:   Sun May 29 09:48:14 2011 +0000

    Move aliases file from /etc/mail/sympa.aliases to /etc/mail/sympa/aliases (fix permissions issues). #282813

diff --git a/debian/postinst b/debian/postinst
index 87f29a2..f0e7006 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -152,12 +152,35 @@ EOF
 	newaliases
 fi
 
+# Moving alias files to a destination where SYMPA can write
+# and create the db alias file with the right permissions
+# from /etc/mail/sympa.aliases to /etc/mail/sympa/aliases
+if [ ! -d /etc/mail/sympa ]; then
+	mkdir -p /etc/mail/sympa
+fi
+if [ -d /etc/mail/sympa ]; then
+	chown sympa:sympa /etc/mail/sympa
+	for ext in '' '.db' ; do
+		if [ ! -f /etc/mail/sympa/aliases${ext} ] && [ -f /etc/mail/sympa.aliases${ext} ] && [ ! -h /etc/mail/sympa/aliases${ext} ]; then
+			mv /etc/mail/sympa.aliases${ext} /etc/mail/sympa/aliases${ext}
+			ln -s /etc/mail/sympa/aliases${ext} /etc/mail/sympa.aliases${ext}
+			chown -h sympa:sympa /etc/mail/sympa.aliases${ext}
+		fi
+	done
+fi
+
 ## Create file for mailing list aliases
-if ! [ -f /etc/mail/sympa.aliases ]; then
-	echo "## List aliases used for the sympa mailing-list manager" > /etc/mail/sympa.aliases
-	chown sympa:sympa /etc/mail/sympa.aliases
+if [ ! -f /etc/mail/sympa/aliases ]; then
+	echo "## List aliases used for the sympa mailing-list manager" > /etc/mail/sympa/aliases
 fi
 
+## Ensure permissions are correct
+for ext in '' '.db' ; do
+	if [ -f /etc/mail/sympa/aliases${ext} ]; then
+		chown sympa:sympa /etc/mail/sympa/aliases${ext}
+	fi
+done
+
 ## Setup a syslog facility
 if which syslog-facility >/dev/null 2>&1 \
   && [ -e /etc/syslog.conf ] \
diff --git a/debian/rules b/debian/rules
index 317c05e..6d89c93 100755
--- a/debian/rules
+++ b/debian/rules
@@ -57,8 +57,8 @@ DEB_CONFIGURE_EXTRA_FLAGS = \
 	--with-openssl=/usr/bin/openssl \
 	--with-gencat=$(GENCAT) \
 	--with-user=root --with-group=root \
-	--with-sendmail_aliases=/etc/mail/sympa.aliases \
-	--with-virtual_aliases=/etc/mail/sympa.virtual
+	--with-sendmail_aliases=/etc/mail/sympa/aliases \
+	--with-virtual_aliases=/etc/mail/sympa/virtual
 
 # We cannot configure --with-expldir: upstream use uppercase X in subdir
 DEB_MAKE_INSTALL_TARGET = install \

-- 
sympa Debian packaging



More information about the Pkg-sympa-commits mailing list