diff options
author | jmelo <jmelo@FreeBSD.org> | 2006-05-06 02:49:11 +0800 |
---|---|---|
committer | jmelo <jmelo@FreeBSD.org> | 2006-05-06 02:49:11 +0800 |
commit | e8ed7edf604936bf7fee5f696836a8b19a10b014 (patch) | |
tree | 57b4d1c5acc89ae410561a8e462f399e6c85e54c /mail/mailman | |
parent | 9094eefcefa7b3b1c2adbf0a569908f329eadd28 (diff) | |
download | freebsd-ports-gnome-e8ed7edf604936bf7fee5f696836a8b19a10b014.tar.gz freebsd-ports-gnome-e8ed7edf604936bf7fee5f696836a8b19a10b014.tar.zst freebsd-ports-gnome-e8ed7edf604936bf7fee5f696836a8b19a10b014.zip |
- Add OPTIONS to choose MTA integration.
- Remove "make options", it's not necessary.
- Fix/update FreeBSD-post-install-notes doc.
- Fix both pkg-install and pkg-deinstall to add/delete mailman user in /var/cron/allow
- Use pkg-message as SUB_FILES.
Approved by: mnag (mentor)
Diffstat (limited to 'mail/mailman')
-rw-r--r-- | mail/mailman/Makefile | 141 | ||||
-rw-r--r-- | mail/mailman/files/FreeBSD-post-install-notes | 61 | ||||
-rw-r--r-- | mail/mailman/files/mailman.in | 36 | ||||
-rw-r--r-- | mail/mailman/files/pkg-message.in (renamed from mail/mailman/pkg-message) | 0 | ||||
-rw-r--r-- | mail/mailman/files/pkg-opts | 58 | ||||
-rw-r--r-- | mail/mailman/pkg-deinstall | 2 | ||||
-rw-r--r-- | mail/mailman/pkg-install | 2 | ||||
-rw-r--r-- | mail/mailman/pkg-plist | 1 | ||||
-rw-r--r-- | mail/mailman/pkg-req | 17 |
9 files changed, 138 insertions, 180 deletions
diff --git a/mail/mailman/Makefile b/mail/mailman/Makefile index 3f0c8730d7d6..b715d5919c71 100644 --- a/mail/mailman/Makefile +++ b/mail/mailman/Makefile @@ -14,27 +14,15 @@ MASTER_SITE_SUBDIR= mailman EXTRACT_SUFX= .tgz DIST_SUBDIR= mailman -.if defined(WITH_HTDIG) -# see http://www.openinfo.co.uk/mailman/index.html -# Order of application of these patches is critical. -PATCH_SITES+= http://www.openinfo.co.uk/mm/patches/444879/:patch1 \ - http://www.openinfo.co.uk/mm/patches/444884/:patch2 -PATCHFILES+= indexing-2.1.6-0.1.patch.gz:patch1 \ - htdig-2.1.6-0.1.patch.gz:patch2 -PATCH_DIST_STRIP= -p1 -PKGNAMESUFFIX+= -with-htdig -.endif - MAINTAINER?= jmelo@FreeBSD.org COMMENT?= A mailing list manager (MLM) with a user-friendly web front-end -RUN_DEPENDS= lynx:${PORTSDIR}/www/lynx -.if defined(WITH_CHINESE) -RUN_DEPENDS+= ${PYTHONPREFIX_SITELIBDIR}/cjkcodecs.pth:${PORTSDIR}/converters/py-cjkcodecs -.endif -.if defined(WITH_HTDIG) -RUN_DEPENDS+= htdig:${PORTSDIR}/textproc/htdig -.endif +OPTIONS= SENDMAIL "for use with sendmail" off \ + EXIM3 "for use with exim3" off \ + EXIM4 "for use with exim4" off \ + POSTFIX "for use with postfix" off \ + CHINESE "support for Chinese mailing lists" off \ + HTDIG "htdig integration patches" off HAS_CONFIGURE= yes USE_PYTHON= yes @@ -42,39 +30,26 @@ CONFIGURE_ARGS= --prefix=${MAILMANDIR} --with-python=${PYTHON_CMD} \ --with-username=${MM_USERNAME} \ --with-groupname=${MM_GROUPNAME} \ --with-mail-gid=${MAIL_GID} --with-cgi-gid=${CGI_GID} - -.if defined(WITH_HTDIG) -PLIST_SUB+= SUB_HTDIG="" -.else -PLIST_SUB+= SUB_HTDIG="@comment " -.endif - -.include <bsd.port.pre.mk> +SUB_FILES= pkg-message +SUB_LIST+= MAILMANDIR=${MAILMANDIR} +USE_RC_SUBR= mailman # The Mailman port supports a number of variables that may be tweaked at # build time. Getting the values of some of them right is crucial! -# Perform a "make options" to see more information on these variables. # MM_USERNAME?= mailman MM_USERID?= 91 MM_GROUPNAME?= ${MM_USERNAME} MM_GROUPID?= ${MM_USERID} MM_DIR?= mailman -.if ${OSVERSION} >= 450000 -MAIL_GID?= mailnull -.else -MAIL_GID?= daemon -.endif CGI_GID?= www IMGDIR?= www/icons # # End of user-configurable variables. MAILMANDIR= ${PREFIX}/${MM_DIR} -PKGMESSAGE= ${WRKDIR}/pkg-message PKGINSTALL= ${WRKDIR}/pkg-install PKGDEINSTALL= ${WRKDIR}/pkg-deinstall -PKGOPTS= ${FILESDIR}/pkg-opts PLIST_SUB+= MMDIR=${MM_DIR} IMGDIR=${IMGDIR} DOCFILES= ACKNOWLEDGMENTS BUGS FAQ INSTALL NEWS README README-I18N.en \ README.CONTRIB README.NETSCAPE \ @@ -85,77 +60,99 @@ DOCFILES= ACKNOWLEDGMENTS BUGS FAQ INSTALL NEWS README README-I18N.en \ IMGFILES= PythonPowered.png mailman.jpg mm-icon.png -options: - @ ${ECHO_MSG} "===> Build options for ${PKGNAME}:" - @ ${CAT} ${PKGOPTS} - -post-extract: -.if !defined(BATCH) - @ ${TEST} -r ${PKGOPTS} && \ - (${ECHO_MSG} '-------------------------------------------------------------------------'; \ - ${ECHO_MSG} ' = IMPORTANT NOTICE = '; \ - ${ECHO_MSG} 'Getting the values of certain build time variables right is CRUCIAL if '; \ - ${ECHO_MSG} 'you want your Mailman installation to function! Pay specific attention '; \ - ${ECHO_MSG} 'to the value of MAIL_GID if you use an alternative MTA (not Sendmail). '; \ - ${ECHO_MSG} ' '; \ - ${ECHO_MSG} 'Perform a "make options" to see a list of available installation options.'; \ - ${ECHO_MSG} '-------------------------------------------------------------------------') +.include <bsd.port.pre.mk> + +.if defined(WITH_SENDMAIL) +.if defined(WITH_EXIM3) || defined(WITH_EXIM4) || defined(WITH_POSTFIX) +BROKEN= choose only one MTA integration +.endif +MAIL_GID+= mailnull +.endif + +.if defined(WITH_EXIM3) +.if defined(WITH_SENDMAIL) || defined(WITH_EXIM4) || defined(WITH_POSTFIX) +BROKEN= choose only one MTA integration +.endif +MAIL_GID+= nobody +.endif + +.if defined(WITH_EXIM4) +.if defined(WITH_SENDMAIL) || defined(WITH_EXIM3) || defined(WITH_POSTFIX) +BROKEN= choose only one MTA integration +.endif +MAIL_GID+= mail +.endif + +.if defined(WITH_POSTFIX) +.if defined(WITH_SENDMAIL) || defined(WITH_EXIM3) || defined(WITH_EXIM4) +BROKEN= choose only one MTA integration +.endif +MAIL_GID+= mailman +.endif + +.if defined(WITH_CHINESE) +RUN_DEPENDS+= ${PYTHONPREFIX_SITELIBDIR}/cjkcodecs.pth:${PORTSDIR}/converters/py-cjkcodecs +.endif + +.if defined(WITH_HTDIG) +PATCH_SITES+= http://www.openinfo.co.uk/mm/patches/444879/:patch1 \ + http://www.openinfo.co.uk/mm/patches/444884/:patch2 +PATCHFILES+= indexing-2.1.6-0.1.patch.gz:patch1 \ + htdig-2.1.6-0.1.patch.gz:patch2 +PATCH_DIST_STRIP= -p1 +PKGNAMESUFFIX+= -with-htdig +RUN_DEPENDS+= htdig:${PORTSDIR}/textproc/htdig +PLIST_SUB+= SUB_HTDIG="" +.else +PLIST_SUB+= SUB_HTDIG="@comment " .endif post-patch: - @ ${REINPLACE_CMD} -e 's#%%LOCALBASE%%#${LOCALBASE}#g' \ + @${REINPLACE_CMD} -e 's#%%LOCALBASE%%#${LOCALBASE}#g' \ ${WRKSRC}/Mailman/Defaults.py.in pre-configure:: # Mailman's configure script needs the "mailman" user/group to exist, so # $PKGINSTALL has to be patched before the do-configure target executes. - @ ${SED} \ + @${SED} \ -e 's#%%USER%%#${MM_USERNAME}#g' -e 's#%%UID%%#${MM_USERID}#g' \ -e 's#%%GROUP%%#${MM_GROUPNAME}#g' -e 's#%%GID%%#${MM_GROUPID}#g' \ -e 's#%%MAILMANDIR%%#${MAILMANDIR}#g' ${MASTERDIR}/pkg-install > \ ${PKGINSTALL} - @ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL post-configure: - @ ${SED} \ + @${SED} \ -e 's#%%USER%%#${MM_USERNAME}#g' -e 's#%%GROUP%%#${MM_GROUPNAME}#g' \ -e 's#%%PREFIX%%#${PREFIX}#g' -e 's#%%MAILMANDIR%%#${MAILMANDIR}#g' \ ${MASTERDIR}/pkg-deinstall > ${PKGDEINSTALL} - @ ${SED} -e 's#%%MAILMANDIR%%#${MAILMANDIR}#g' \ - -e 's#%%DOCSDIR%%#${DOCSDIR}#g' -e 's#%%LOCALBASE%%#${LOCALBASE}#g' \ - ${MASTERDIR}/pkg-message > ${PKGMESSAGE} # port system auditors complain if dir is created prior to install # but configure demands it be there. we delete it now if empty, # so it will be re-created. For existing installs, this is ignored @- ${RMDIR} ${MAILMANDIR} 2> /dev/null pre-install: - @ ${SH} ${PKGREQ} INSTALL - @ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL post-install: .for dir in cron scripts - @ ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${MAILMANDIR}/${dir} + @${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${MAILMANDIR}/${dir} .endfor - @ ${CHGRP} -R ${MM_GROUPNAME} ${MAILMANDIR} - @ ${MKDIR} ${PREFIX}/${IMGDIR} + @${CHGRP} -R ${MM_GROUPNAME} ${MAILMANDIR} + @${MKDIR} ${PREFIX}/${IMGDIR} .for imgfile in ${IMGFILES} - @ ${CP} ${MAILMANDIR}/icons/${imgfile} ${PREFIX}/${IMGDIR} + @${CP} ${MAILMANDIR}/icons/${imgfile} ${PREFIX}/${IMGDIR} .endfor - @ uudecode -p ${FILESDIR}/powerlogo.gif.uue > \ + @uudecode -p ${FILESDIR}/powerlogo.gif.uue > \ ${PREFIX}/${IMGDIR}/powerlogo.gif .if !defined(NOPORTDOCS) - @ ${MKDIR} ${DOCSDIR} - @ ${INSTALL_DATA} ${FILESDIR}/FreeBSD-post-install-notes ${DOCSDIR} + @${MKDIR} ${DOCSDIR} + @${INSTALL_DATA} ${FILESDIR}/FreeBSD-post-install-notes ${DOCSDIR} .for docfile in ${DOCFILES} - @ ${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR} + @${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR} .endfor .endif - @ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL - @ ${INSTALL_SCRIPT} ${WRKSRC}/misc/mailman \ - ${PREFIX}/etc/rc.d/mailman.sh -.if !defined(BATCH) - @ ${CAT} ${PKGMESSAGE} -.endif + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/mail/mailman/files/FreeBSD-post-install-notes b/mail/mailman/files/FreeBSD-post-install-notes index 8e8d0662f9f2..5dbd80e132ea 100644 --- a/mail/mailman/files/FreeBSD-post-install-notes +++ b/mail/mailman/files/FreeBSD-post-install-notes @@ -6,7 +6,6 @@ CONTENTS: * VERY IMPORTANT NOTE -* IMPORTANT NOTE: Using Mailman with alternate MTAs 1) General post-installation instructions 2) Integrating Mailman with your web server 3) Integrating Mailman with various mail servers @@ -14,6 +13,7 @@ CONTENTS: 3.2) Exim 3.3) Postfix 3.4) Qmail +4) Apache configuration VERY IMPORTANT NOTE @@ -25,23 +25,6 @@ To see a list of build time options, go to the Mailman port's directory (/usr/ports/mail/mailman by default) and perform a "make options". -IMPORTANT NOTE: Using Mailman with alternate MTAs - -By default, the Mailman port is configured to work with Sendmail. If you -wish to use Mailman with an alternate MTA, you MUST set the value of MAIL_GID -correctly when building the port. Perform a "make options" in the port -directory (as explained above) to see a list of possible values for MAIL_GID. - -If you have installed Mailman from a pre-compiled package (e.g. from -a FreeBSD distribution CD), chances are that the package had been built with -the default value for MAIL_GID and will only work with Sendmail. You will -probably have to build the Mailman port yourself to get it to work with your -MTA. - -Further down in this document you will find sections dealing with most -popular MTAs. - - 1) General post-installation instructions You should find two files named "INSTALL" and "README" in the same @@ -84,11 +67,12 @@ popular MTAs. 3.1) Sendmail - No modification of MAIL_GID should be required when building the Mailman - port. The port is designed to work with Sendmail by default. + You have to choose SENDMAIL option on config build and port will set + MAIL_GID=mailnull to you. - Review the instructions found in mailman-install.txt in the same directory - as this file. + When your build is finished, please review the instructions found in + mailman-install.txt in the same directory port. The port is designed to + work with Sendmail by default. No further instructions exist at this time on how to integrate the Mailman port with Sendmail. Please submit any such information to the @@ -107,15 +91,12 @@ popular MTAs. exim_group = mail For Exim 3.x, the value of MAIL_GID has to be set to 'nobody' (or 65534) - when building the Mailman port. + when building the Mailman port, so you have to choose EXIM3 on build options + to set it to you. For Exim 4.x, the value of MAIL_GID has to be set to 'mail' (or 6) when - building the Mailman port. - - For example, to build and install the Mailman port for Exim4, perform - the following in /usr/ports/mail/mailman: - - # make MAIL_GID=6 install + building the Mailman port, so you have to choose EXIM4 on build options to + set it to you. Next, follow the instructions in mailman-install.txt found in the same directory as this file. You can add the macros, transport and router @@ -137,7 +118,7 @@ popular MTAs. Now, start Mailman's qrunner daemon: - # /usr/local/etc/rc.d/mailman.sh start + # /usr/local/etc/rc.d/mailman start Troubleshooting: If you ever see an error message such as the following in your Exim's mainlog, it's a sure sign that Exim and Mailman disagree @@ -154,7 +135,8 @@ popular MTAs. 3.3) Postfix The value of MAIL_GID has to be set to 'nobody' (or 65534) when building - the Mailman port. + the Mailman port, so you have to choose POSTFIX on build options to + set it to you. NOTE: the group needs to be 'mailman' if you are using the Mailman integration for generating the postfix virtual and aliases files. @@ -174,6 +156,21 @@ popular MTAs. Mailman port with Qmail. Please submit any such information to the maintainer of the Mailman port. +4) Apache configuration + + You should add the follow lines in you httpd.conf to mailman interface + works correctly: + + <Directory "/usr/local/mailman"> + Options FollowSymLinks ExecCGI + AllowOverride None + Order allow,deny + Allow from all + </Directory> + + After that, restart your apache: + + # apachectl restart. --- Johann Visagie <wjv@FreeBSD.org> +-- Jean Milanez Melo <jmelo@FreeBSD.org> (Mailman port maintainer) diff --git a/mail/mailman/files/mailman.in b/mail/mailman/files/mailman.in new file mode 100644 index 000000000000..483ed2bdfdfb --- /dev/null +++ b/mail/mailman/files/mailman.in @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: mailman +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable mailman: +# mailman_enable (bool): Set it to "YES" to enable mailman. +# Default is "NO". + +. %%RC_SUBR%% + +name="mailman" +rcvar=${name}_enable + +pidfile="%%PREFIX%%/mailman/data/master-qrunner.pid" + +load_rc_config $name + +: ${mailman_enable="NO"} + +start_cmd=${name}_start +stop_cmd=${name}_stop +extra_commands="reload" + +mailman_start() { + %%PREFIX%%/mailman/bin/mailmanctl -s -q start +} + +mailman_stop() { + %%PREFIX%%/mailman/bin/mailmanctl -q stop +} + +run_rc_command "$1" diff --git a/mail/mailman/pkg-message b/mail/mailman/files/pkg-message.in index 329f073f7688..329f073f7688 100644 --- a/mail/mailman/pkg-message +++ b/mail/mailman/files/pkg-message.in diff --git a/mail/mailman/files/pkg-opts b/mail/mailman/files/pkg-opts deleted file mode 100644 index 17aaa301e0ef..000000000000 --- a/mail/mailman/files/pkg-opts +++ /dev/null @@ -1,58 +0,0 @@ - -* MM_USERNAME [mailman] - The username of the Mailman user - -* MM_USERID [91] - The user ID of the Mailman user - - It is recommended that you do not change this option. - -* MM_GROUPNAME [mailman] - The group to which the Mailman user will belong - -* MM_GROUPID [MM_USERID] - The group ID for the Mailman user - - It is recommended that you do not change this option. - -* MM_DIR [mailman] - Mailman will be installed in ${PREFIX}/${MM_DIR} - -* MAIL_GID [mailnull] - The group name or id under which your MTA performs mail delivery - - Getting the value of MAIL_GID right is crucial to getting Mailman to work - with your MTA. By default this port works with Sendmail. If you're - using an alternative MTA installed from ports, you should set MAIL_GID at - build time according to the following table. You may use either the - group name or the numerical GID. (Please contact this port's maintainer - if you wish to fill in the blanks or report mistakes!) - - ---------------------------------------------------- - MTA | MAIL_GID | Submitted by - Exim3 | nobody (65534) | <wjv@FreeBSD.org> - Exim4 | mail (6) | <wjv@FreeBSD.org> - Postfix | mailman | <vivek@khera.org> - Qmail | ??? | - ---------------------------------------------------- - - NOTE: for Postfix, the group may need to be 'nobody' if you are not - using the Mailman integration for generating the postfix virtual and - aliases files. - -* CGI_GID [www] - The group name or id under which your web server executes CGI scripts - - By default, this port works with the current port of Apache2. If your - WWW server executes CGI scripts under a different GID, you'll have to - set this at build time. - -* IMGDIR [www/icons] - Icon images will be installed in ${PREFIX}/${IMGDIR} - -* WITH_CHINESE [undefined] - Define to include support for Chinese mailing lists - -* WITH_HTDIG [undefined] - Define to include the htdig integration patches. - diff --git a/mail/mailman/pkg-deinstall b/mail/mailman/pkg-deinstall index 1ab07c748f92..93c125e19a01 100644 --- a/mail/mailman/pkg-deinstall +++ b/mail/mailman/pkg-deinstall @@ -13,6 +13,8 @@ DEINSTALL) /usr/bin/diff - %%MAILMANDIR%%/cron/crontab.in >/dev/null 2>&1 ; then echo "---> Zeroing crontab for \"%%USER%%\"" /usr/bin/crontab -u "%%USER%%" /dev/null + grep -v %%USER%% /var/cron/allow > /var/cron/allow.new + mv /var/cron/allow.new /var/cron/allow else echo "---> Crontab for \"%%USER%%\" not removed: please deinstall" echo "---> manually if you no-longer wish to use Mailman. eg:" diff --git a/mail/mailman/pkg-install b/mail/mailman/pkg-install index fc2dd3e53bc7..72dcae989707 100644 --- a/mail/mailman/pkg-install +++ b/mail/mailman/pkg-install @@ -51,6 +51,8 @@ POST-INSTALL) echo "---> Checking crontab(5) file for user \"%%USER%%\"" + echo "%%USER%%" >> /var/cron/allow + if /usr/bin/crontab -u "%%USER%%" -l >/tmp/mmctab$$ 2>&1 ; then if test -s /tmp/mmctab$$; then echo "---> \"%%USER%%\" already has a crontab. Not overwriting it" diff --git a/mail/mailman/pkg-plist b/mail/mailman/pkg-plist index ed233d9e106e..8b225723a17c 100644 --- a/mail/mailman/pkg-plist +++ b/mail/mailman/pkg-plist @@ -1994,7 +1994,6 @@ %%PORTDOCS%%%%DOCSDIR%%/mailman-install.txt %%PORTDOCS%%%%DOCSDIR%%/mailman-member.txt %%PORTDOCS%%@dirrm %%DOCSDIR%% -etc/rc.d/mailman.sh @dirrm %%MMDIR%%/tests/msgs @dirrm %%MMDIR%%/tests/bounces @dirrm %%MMDIR%%/tests diff --git a/mail/mailman/pkg-req b/mail/mailman/pkg-req deleted file mode 100644 index cffca7cab3ff..000000000000 --- a/mail/mailman/pkg-req +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -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.3"'` - if [ "x${PYTHON_GT}" = "x1" -o "x${PYTHON_GT}" = "xTrue" ]; then - exit 0 - else - echo "-----------------------------------------------------------" - echo "Mailman requires Python version 2.1.3 or greater -" - echo " please update your Python installation before proceeding." - echo "-----------------------------------------------------------" - exit 1 - fi -fi |