diff options
author | Johann Visagie <wjv@FreeBSD.org> | 2003-01-23 12:49:00 +0000 |
---|---|---|
committer | Johann Visagie <wjv@FreeBSD.org> | 2003-01-23 12:49:00 +0000 |
commit | 9fb9d105a9c0255450b8a3a4ecf4b6d455380260 (patch) | |
tree | 437c0e6fc72787701719011aa7baecaf4222cbf3 | |
parent | 451c213b4b84f1dcd51cbe828152b80a486535f3 (diff) | |
download | ports-9fb9d105a9c0255450b8a3a4ecf4b6d455380260.tar.gz ports-9fb9d105a9c0255450b8a3a4ecf4b6d455380260.zip |
Notes
-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 ae9f72bb0ee8..73de7c435c8e 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 270e5fd197f7..e5cf89c8f4a1 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 156f0ed01359..180ac640fa0d 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 fe98f1da06b6..5c821f397ddb 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 f6db5b956fa5..214bf3df6499 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 17083b0ac74d..d7c52c50665b 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 58b5530f3347..07db2eab1c24 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 |