diff options
author | wjv <wjv@FreeBSD.org> | 2003-01-23 12:49:00 +0000 |
---|---|---|
committer | wjv <wjv@FreeBSD.org> | 2003-01-23 12:49:00 +0000 |
commit | e21503486950aa93f1d71768936fd839830fcb86 (patch) | |
tree | 6383eeeeaba53632938ec18ab19990bff40f569c /mail | |
parent | ca6bbe183034add616798e7d83d770af64ac6c1a (diff) | |
download | FreeBSD-ports-e21503486950aa93f1d71768936fd839830fcb86.zip FreeBSD-ports-e21503486950aa93f1d71768936fd839830fcb86.tar.gz |
- Update author's email address in $DESCR.
- Update $PKGREQ to depend explicitly on Python >= 2.1.3, and not just >= 2.1
- Document required value of $MAIL_GID for Exim4.
- Substantial rewrite of $PKGINSTALL:
- Simplified layout.
- More extensive error checking.
- More expressive and user-friendly output.
- Substantial rewrite of $PKGDEINSTALL:
- Simplified layout.
- More expressive and user-friendly output.
- Delete %%MAILMANDIR%%/data/last_mailman_version in DEINSTALL, and restore
it in POST-DEINSTALL if the entire Mailman installation has not been
removed. This file is required by Mailman's update script (run as part
of the installation procedure) to update active mailing lists.
- Delete the errorlog if it is the only existing logfile. This will
finally allow the mailman port/package to be completely and cleanly
deinstalled when there are no active lists or updated configuration.
- Bump $PORTREVISION, with apologies to those tracking the port.
It should now finally be possible to update a Mailman installation with
active mailing lists simply by deinstalling the port/package, and
reinstalling a later version (or by using portupgrade(1)). There are still
no guarantees, though, and a backup is thorouhly recommended.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/mailman/Makefile | 2 | ||||
-rw-r--r-- | mail/mailman/files/pkg-opts | 3 | ||||
-rw-r--r-- | mail/mailman/pkg-deinstall | 73 | ||||
-rw-r--r-- | mail/mailman/pkg-descr | 2 | ||||
-rw-r--r-- | mail/mailman/pkg-install | 100 | ||||
-rw-r--r-- | mail/mailman/pkg-message | 4 | ||||
-rw-r--r-- | mail/mailman/pkg-req | 4 |
7 files changed, 85 insertions, 103 deletions
diff --git a/mail/mailman/Makefile b/mail/mailman/Makefile index ae9f72b..73de7c4 100644 --- a/mail/mailman/Makefile +++ b/mail/mailman/Makefile @@ -7,7 +7,7 @@ PORTNAME= mailman PORTVERSION= 2.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail MASTER_SITES= http://www.list.org/ \ ${MASTER_SITE_GNU} \ diff --git a/mail/mailman/files/pkg-opts b/mail/mailman/files/pkg-opts index 270e5fd..e5cf89c 100644 --- a/mail/mailman/files/pkg-opts +++ b/mail/mailman/files/pkg-opts @@ -30,7 +30,8 @@ ---------------------------------------------------- MTA | MAIL_GID | Submitted by - Exim | nobody (65534) | <wjv@FreeBSD.org> + Exim3 | nobody (65534) | <wjv@FreeBSD.org> + Exim4 | mail (6) | <wjv@FreeBSD.org> Postfix | nobody (65534) | <shamrock@cypherpunks.to> Qmail | ??? | ---------------------------------------------------- diff --git a/mail/mailman/pkg-deinstall b/mail/mailman/pkg-deinstall index 156f0ed..180ac64 100644 --- a/mail/mailman/pkg-deinstall +++ b/mail/mailman/pkg-deinstall @@ -2,50 +2,53 @@ # # $FreeBSD$ -delete_account() { - local u g home - - u=$1 - g=$2 - echo -n "Removing group \"${g}\"... " - pw groupdel -n ${g} - echo "done." - echo -n "Removing user \"${u}\"... " - eval home=~${u} - echo 'y' | pw userdel -n ${u} - echo "done." -} - -zero_crontab() { - local u - - u=$1 - - echo -n 'Zeroing crontab(5) file belonging to user "%%USER%%"... ' - crontab -u ${u} /dev/null || exit - echo 'done.' - echo '(The crontab(5) will be deleted completely when user "%%USER%%" is removed.)' -} - -export PATH=/bin:/usr/bin:/usr/sbin +PATH=/bin:/usr/bin:/usr/sbin case $2 in + DEINSTALL) - zero_crontab %%USER%% - if ps -axwU %%USER%% | grep -q python; then - echo "Stopping Mailman's qrunner daemon." - %%PREFIX%%/etc/rc.d/mailman.sh stop >/dev/null 2>&1 - sleep 2 + echo "---> Starting deinstall script:" + + echo "---> Zeroing crontab(5) file belonging to user \"%%USER%%\"" + /usr/bin/crontab -u %%USER%% /dev/null + echo " (The crontab(5) will be deleted completely when user %%USER%% is removed.)" + + echo "---> Stopping Mailman's qrunner daemon" + %%PREFIX%%/etc/rc.d/mailman.sh stop >/dev/null 2>&1 + /bin/sleep 2 + + echo "---> Preserving the \"last_mailman_version\" file" + /bin/cp -f %%MAILMANDIR%%/data/last_mailman_version /var/tmp/ + + # If the errorlog is the only existing logfile, delete it. (If Mailman's + # qrunner had not been running, then the process of trying to stop the + # qrunner (above) will cause the errorlog to be written to. Hence, even if + # the Mailman port/package is installed and immediately deinstalled, the + # errorlog will exist.) + if [ "`echo %%MAILMANDIR%%/logs/*`" = "%%MAILMANDIR%%/logs/error" ]; then + echo "---> Deleting errorlog (It is the only existing logfile.)" + /bin/rm -f %%MAILMANDIR%%/logs/error fi ;; POST-DEINSTALL) + echo "---> Starting post-deinstall script:" + if [ -d %%MAILMANDIR%% ]; then - echo '%%MAILMANDIR%% is not empty - this installation may have active lists!' - echo '- The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.' - echo '- You may delete them with "pw groupdel %%GROUP%%; pw userdel %%USER%%".' + echo '---> %%MAILMANDIR%% is not empty - this installation may have active lists!' + echo '---> - The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.' + echo '---> - You may delete them with "pw groupdel %%GROUP%%; pw userdel %%USER%%".' + + echo "---> Restoring \"last_mailman_version\" file" + [ -d %%MAILMANDIR%%/data ] || /bin/mkdir %%MAILMANDIR%%/data + /bin/mv -f /var/tmp/last_mailman_version %%MAILMANDIR%%/data/ + else - delete_account %%USER%% %%GROUP%% + echo "---> Removing group \"%%GROUP%%\"" + /usr/sbin/pw groupdel -n %%GROUP%% + echo "---> Removing user \"%%USER%%\"" + echo 'y' | /usr/sbin/pw userdel -n %%USER%% fi ;; + esac diff --git a/mail/mailman/pkg-descr b/mail/mailman/pkg-descr index fe98f1d..5c821f3 100644 --- a/mail/mailman/pkg-descr +++ b/mail/mailman/pkg-descr @@ -17,7 +17,7 @@ extensible. It is compatible with most web servers and browsers, and most mail transfer agents (mail servers). Mailman's documentation may be found on its website. -Author: Barry Warsaw <barry@zope.com> and the Mailman Cabal +Author: Barry Warsaw <barry@python.org> and the Mailman Cabal WWW: http://www.list.org/ -- Johann Visagie <wjv@FreeBSD.org> diff --git a/mail/mailman/pkg-install b/mail/mailman/pkg-install index f6db5b9..214bf3d 100644 --- a/mail/mailman/pkg-install +++ b/mail/mailman/pkg-install @@ -2,80 +2,58 @@ # # $FreeBSD$ -make_account() { - local u uid g gid gcos home shell +PATH=/bin:/usr/bin:/usr/sbin - u=$1 - uid=$2 - g=$3 - gid=$4 - gcos=$5 - home=$6 - shell=$7 +case $2 in - if pw group show "${g}" >/dev/null 2>&1; then - echo "You already have a group \"${g}\", so I will use it." - else - echo -n "Adding group \"${g}\" (${gid})... " - if which -s pw; then - pw groupadd ${g} -g ${gid} || exit - echo "done." - else - exit 1 - fi +PRE-INSTALL) + echo "---> Starting install script:" + + if [ -z "%%MAILMANDIR%%" -o \ + -z "%%USER%%" -o -z "%%GROUP%%" -o \ + -z "%%UID%%" -o -z "%%GID%%" ]; then + echo "ERROR: A required pragma was empty" + exit 1 fi - if pw user show "${u}" >/dev/null 2>&1; then - echo "You already have a user \"${u}\", so I will use it." + # Create group if required + if pw group show "%%GROUP%%" >/dev/null 2>&1; then + echo "---> Using existing group \"%%GROUP%%\"" else - echo -n "Adding user \"${u}\" (${uid})... " - if which -s pw; then - pw useradd ${u} -u ${uid} -g ${g} -h - -d ${home} \ - -s ${shell} -c "${gcos}" || exit - echo "done." - else - exit 1 - fi + echo "---> Adding group \"%%GROUP%%\" (%%GID%%)" + /usr/sbin/pw groupadd %%GROUP%% -g %%GID%% || exit 1 fi - if [ x"$home" != x ]; then - if [ ! -d "${home}" ]; then - echo -n "Creating ${u}'s home directory (${home})... " - (umask 002 && mkdir -p ${home}) || exit - chown -R ${u}:${g} ${home} || exit - chmod g+s ${home} || exit - echo "done." - fi + # Create user if required + if pw user show "%%USER%%" >/dev/null 2>&1; then + echo "---> Using existing user \"%%USER%%\"" + else + echo "---> Adding user \"%%USER%%\" (%%UID%%)" + pw useradd "%%USER%%" -u "%%UID%%" -g "%%GROUP%%" -h - \ + -d "%%MAILMANDIR%%" -s "/sbin/nologin" -c "Mailman Owner" || exit 1 fi -} - -create_crontab() { - local u file - u=$1 - file=$2 + # Create home directory if required + if [ -d "%%MAILMANDIR%%" ]; then + echo "---> Using existing Mailman directory (%%MAILMANDIR%%)" + echo " (There may be existing active mailing lists - this installation will" + echo " attempt to preserve them.)" + else + echo "---> Creating Mailman directory (%%MAILMANDIR%%)" + (umask 002 && /bin/mkdir -p "%%MAILMANDIR%%") || exit 1 + /usr/sbin/chown -R "%%USER%%:%%GROUP%%" "%%MAILMANDIR%%" || exit 1 + /bin/chmod g+s "%%MAILMANDIR%%" || exit 1 + fi + ;; - echo -n "Creating crontab(5) file for Mailman user... " - crontab -u ${u} ${file} || exit - echo "done." +POST-INSTALL) + echo "---> Starting post-install script:" -} + echo "---> Creating crontab(5) file for user \"%%USER%%\"" + /usr/bin/crontab -u "%%USER%%" "%%MAILMANDIR%%/cron/crontab.in" || exit 1 -fix_perms() { - echo -n "Checking (and fixing) permissions... " + echo "---> Checking (and fixing) file and directory permissions" %%MAILMANDIR%%/bin/check_perms -f >/dev/null 2>&1 - echo "done." -} - -case $2 in - -PRE-INSTALL) - make_account %%USER%% %%UID%% %%GROUP%% %%GID%% \ - "Mailman User" "%%MAILMANDIR%%" "/sbin/nologin" ;; -POST-INSTALL) - create_crontab %%USER%% "%%MAILMANDIR%%/cron/crontab.in" - fix_perms - ;; esac diff --git a/mail/mailman/pkg-message b/mail/mailman/pkg-message index 17083b0..d7c52c5 100644 --- a/mail/mailman/pkg-message +++ b/mail/mailman/pkg-message @@ -17,8 +17,8 @@ activate Mailman's web interface: Remember to reload your mail aliases if required, and to restart your httpd! -See %%DOCSDIR%%/INSTALL for further post-installation -instructions. +See INSTALL and UPGRADING in %%DOCSDIR%% for further +post-installation instructions. Note: The entire Mailman installation resides under %%MAILMANDIR%%. The command-line scripts necessary to administer Mailman have been installed diff --git a/mail/mailman/pkg-req b/mail/mailman/pkg-req index 58b5530..07db2ea 100644 --- a/mail/mailman/pkg-req +++ b/mail/mailman/pkg-req @@ -4,12 +4,12 @@ PATH=$PATH:/usr/local/bin if [ "x$1" = "xINSTALL" -o "x$2" = "xINSTALL" ]; then PYTHON_GT=`python -c 'import string, sys; \ - print string.split(sys.version)[0] >= "2.1"'` + print string.split(sys.version)[0] >= "2.1.3"'` if [ "x${PYTHON_GT}" = "x1" ]; then exit 0 else echo "-----------------------------------------------------------" - echo "Mailman requires Python version 2.1 or greater -" + echo "Mailman requires Python version 2.1.3 or greater -" echo " please update your Python installation before proceeding." echo "-----------------------------------------------------------" exit 1 |