[79031] trunk/dports/mail/mailman/Portfile

jmr at macports.org jmr at macports.org
Mon May 30 16:13:40 PDT 2011


Revision: 79031
          http://trac.macports.org/changeset/79031
Author:   jmr at macports.org
Date:     2011-05-30 16:13:37 -0700 (Mon, 30 May 2011)
Log Message:
-----------
mailman: preserve config files across upgrades (#24786), use notes

Modified Paths:
--------------
    trunk/dports/mail/mailman/Portfile

Modified: trunk/dports/mail/mailman/Portfile
===================================================================
--- trunk/dports/mail/mailman/Portfile	2011-05-30 23:04:13 UTC (rev 79030)
+++ trunk/dports/mail/mailman/Portfile	2011-05-30 23:13:37 UTC (rev 79031)
@@ -88,13 +88,12 @@
 	# Install Apache configuration file
 	xinstall -d -m 0755 ${destroot}${confdir}
 	xinstall -m 0644 ${filespath}/${name}.conf.in \
-		${destroot}${confdir}/${name}.conf
-	reinplace "s|@EXECDIR@|${execdir}|" ${destroot}${confdir}/${name}.conf
-	reinplace "s|@DATADIR@|${datadir}|" ${destroot}${confdir}/${name}.conf
-	reinplace "s|@SHAREDIR@|${sharedir}|" ${destroot}${confdir}/${name}.conf
+		${destroot}${confdir}/${name}.conf.dist
+	reinplace "s|@EXECDIR@|${execdir}|" ${destroot}${confdir}/${name}.conf.dist
+	reinplace "s|@DATADIR@|${datadir}|" ${destroot}${confdir}/${name}.conf.dist
+	reinplace "s|@SHAREDIR@|${sharedir}|" ${destroot}${confdir}/${name}.conf.dist
 	reinplace "s|@CONFDIR@|${confdir}|" \
-		${destroot}${sharedir}/Mailman/mm_cfg.py.dist \
-		${destroot}${sharedir}/Mailman/mm_cfg.py
+		${destroot}${sharedir}/Mailman/mm_cfg.py.dist
 
 	# Install documentation files
 	xinstall -d -m 0755 ${destroot}${docdir}
@@ -105,41 +104,56 @@
 	# Check installation under destroot
 	system "cd ${destroot}${sharedir} && \
 		DESTDIR=${destroot} PYTHONPATH=.:./pythonlib ./bin/check_perms"
+
+	# Don't register config files to the port so changes are preserved
+	# across upgrades.
+	file delete -force ${destroot}${sharedir}/Mailman/mm_cfg.py
 }
 
-post-install {
-	# Notify the user what needs to be done after installation
-	ui_msg "------------------------------------------------------------"
-	ui_msg "Be sure to verify the email and URL host settings in the"
-	ui_msg "Mailman configuration file (they may have been guessed"
-	ui_msg "incorrectly during the configuration step):"
-	ui_msg " "
-	ui_msg "  ${sharedir}/Mailman/mm_cfg.py"
-	ui_msg " "
-	ui_msg "Be sure to add the following line to your Apache httpd.conf"
-	ui_msg "configuration file to enable Mailman web access:"
-	ui_msg " "
-	ui_msg "  Include ${confdir}/${name}.conf"
-	ui_msg " "
-	ui_msg "Be sure to setup the crontab entries for the '${mmuser}'"
-	ui_msg "user. Mailman runs a number of cron jobs for its basic"
-	ui_msg "functionality."
-	ui_msg " "
-	ui_msg "  cd ${sharedir}/cron"
-	ui_msg "  sudo crontab -u ${mmuser} crontab.in"
-	ui_msg " "
-	ui_msg "Also, be sure to read the following files for details"
-	ui_msg "on creating your site-wide list, setting your site and"
-	ui_msg "list creator passwords, and creating your first list:"
-	ui_msg " "
-	ui_msg "  ${docdir}/INSTALL"
-	ui_msg "  ${docdir}/README"
-	ui_msg " "
-	ui_msg "Finally, either restart your system to start up the"
-	ui_msg "Mailman queue runner, or use the following to start"
-	ui_msg "it running immediately:"
-	ui_msg " "
-	ui_msg "  sudo launchctl load -w /Library/LaunchDaemons/org.macports.mailman.plist"
-	ui_msg "------------------------------------------------------------"
+post-activate {
+	# Check for an existing mm_cfg.py and copy the "dist" version
+	# into place if there isn't one.
+	if {![file exists ${sharedir}/Mailman/mm_cfg.py]} {
+		copy ${sharedir}/Mailman/mm_cfg.py.dist \
+			${sharedir}/Mailman/mm_cfg.py
+	}
+	if {![file exists ${confdir}/${name}.conf]} {
+		copy ${confdir}/${name}.conf.dist \
+			${confdir}/${name}.conf
+	}
 }
 
+# Notify the user what needs to be done after installation
+notes \
+"------------------------------------------------------------
+Be sure to verify the email and URL host settings in the
+Mailman configuration file (they may have been guessed
+incorrectly during the configuration step):
+
+  ${sharedir}/Mailman/mm_cfg.py
+
+Be sure to add the following line to your Apache httpd.conf
+configuration file to enable Mailman web access:
+
+  Include ${confdir}/${name}.conf
+
+Be sure to setup the crontab entries for the '${mmuser}'
+user. Mailman runs a number of cron jobs for its basic
+functionality.
+
+  cd ${sharedir}/cron
+  sudo crontab -u ${mmuser} crontab.in
+
+Also, be sure to read the following files for details
+on creating your site-wide list, setting your site and
+list creator passwords, and creating your first list:
+
+  ${docdir}/INSTALL
+  ${docdir}/README
+
+Finally, either restart your system to start up the
+Mailman queue runner, or use the following to start
+it running immediately:
+
+  sudo port load ${name}
+------------------------------------------------------------"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110530/4db3f10d/attachment.html>


More information about the macports-changes mailing list