source: trunk/dports/mail/mailman/Portfile

Last change on this file was 152058, checked in by mps@…, 15 months ago

mailman: update to version 2.1.23.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 152058 2016-08-28 11:01:25Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                mailman
7version             2.1.23
8categories          mail
9platforms           darwin
10license             GPL-2
11maintainers         mps openmaintainer
12
13description         Mailman, the GNU Mailing List Manager
14long_description    Mailman is free software for managing electronic \
15                    mail discussion and e-newsletter lists. Mailman is \
16                    integrated with the web, making it easy for users \
17                    to manage their accounts and for list owners to \
18                    administer their lists. Mailman supports built-in \
19                    archiving, automatic bounce processing, content \
20                    filtering, digest delivery, spam filters, and more.
21homepage            http://www.list.org/
22
23depends_lib         port:python27 \
24                    port:py27-dnspython
25
26master_sites        gnu
27extract.suffix      .tgz
28checksums           rmd160  cdd3192d6085ab16586edd5c0f897fa2d1c4f6e8 \
29                    sha256  b022ca6f8534621c9dbe50c983948688bc4623214773b580c2c78e4a7ae43e69
30
31# Create a startupitem
32startupitem.create  yes
33startupitem.start   "${prefix}/share/mailman/bin/mailman.init start"
34startupitem.stop    "${prefix}/share/mailman/bin/mailman.init stop"
35
36# Mailman installation directories
37set execdir         ${prefix}/libexec/${name}
38set sharedir        ${prefix}/share/${name}
39set datadir         ${prefix}/var/${name}
40set docdir          ${prefix}/share/doc/${name}
41set confdir         ${prefix}/etc/httpd
42
43# Mailman user/group name
44set mmuser          mailman
45set mmgroup         mailman
46
47# CGI group name (should match apache Portfile)
48set cgigroup        www
49
50patchfiles          patch-Defaults.py.in \
51                    patch-mm_cfg.py.dist.in
52
53configure.pre_args  --exec-prefix=${execdir} \
54                    --prefix=${sharedir} \
55                    --with-var-prefix=${datadir}
56
57configure.args      --with-cgi-ext=.cgi \
58                    --with-cgi-gid=${cgigroup} \
59                    --with-groupname=${mmgroup} \
60                    --with-mail-gid=${mmgroup} \
61                    --with-python=${prefix}/bin/python2.7 \
62                    --with-username=${mmuser} \
63                    --without-permcheck
64
65pre-destroot {
66    addgroup ${mmgroup}
67    adduser ${mmuser} gid=[existsgroup ${mmgroup}]
68    xinstall -d -m 02775 -o root -g ${mmgroup} ${destroot}${execdir}
69    xinstall -d -m 02775 -o root -g ${mmgroup} ${destroot}${sharedir}
70    xinstall -d -m 02775 -o ${mmuser} -g ${mmgroup} ${destroot}${datadir}
71}
72post-destroot {
73    # Create dummy files to retain empty directory tree
74    xinstall -d -m 02775 ${destroot}${datadir}/lists/.turd
75    system "find ${destroot}${datadir} -type d -empty | xargs -n1 -I% touch %/.turd"
76
77    # Cleanup permissions & ownership
78    foreach dir [exec find ${destroot}${sharedir} -type d ! -perm 02775] {
79        ui_info "${dir}: setting permissions to 02775"
80        file attributes $dir -permissions 02775
81    }
82
83    # Install startup script
84    xinstall -d -m 0755 ${destroot}${prefix}/etc/rc.d
85    system "ln -s ../../../[strsed ${sharedir} "g|^${prefix}/||"]/scripts/mailman \
86            ${destroot}${prefix}/share/mailman/bin/mailman.init"
87
88    # Install Apache configuration file
89    xinstall -d -m 0755 ${destroot}${confdir}
90    xinstall -m 0644 ${filespath}/${name}.conf.in \
91            ${destroot}${confdir}/${name}.conf.dist
92    reinplace "s|@EXECDIR@|${execdir}|" ${destroot}${confdir}/${name}.conf.dist
93    reinplace "s|@DATADIR@|${datadir}|" ${destroot}${confdir}/${name}.conf.dist
94    reinplace "s|@SHAREDIR@|${sharedir}|" ${destroot}${confdir}/${name}.conf.dist
95    reinplace "s|@CONFDIR@|${confdir}|" \
96            ${destroot}${sharedir}/Mailman/mm_cfg.py.dist
97
98    # Install documentation files
99    xinstall -d -m 0755 ${destroot}${docdir}
100    foreach file [glob ${worksrcpath}/\[A-IN-Z\]*] {
101        xinstall -m 0644 ${file} ${destroot}${docdir}
102    }
103
104    # Check installation under destroot
105    # system "cd ${destroot}${sharedir} && \
106    #        DESTDIR=${destroot} PYTHONPATH=.:./Mailman ${destroot}${sharedir}/bin/check_perms"
107
108    # Don't register config files to the port so changes are preserved
109    # across upgrades.
110    file delete -force ${destroot}${sharedir}/Mailman/mm_cfg.py
111}
112
113post-activate {
114    # Check for an existing mm_cfg.py and copy the "dist" version
115    # into place if there isn't one.
116    if {![file exists ${sharedir}/Mailman/mm_cfg.py]} {
117        copy ${sharedir}/Mailman/mm_cfg.py.dist ${sharedir}/Mailman/mm_cfg.py
118    }
119    if {![file exists ${confdir}/${name}.conf]} {
120        copy ${confdir}/${name}.conf.dist ${confdir}/${name}.conf
121    }
122}
123
124# Notify the user what needs to be done after installation
125notes "
126Be sure to verify the email and URL host settings in the Mailman configuration\
127file (they may have been guessed incorrectly during the configuration step):
128
129    ${sharedir}/Mailman/mm_cfg.py
130
131Be sure to add the following line to your Apache httpd.conf configuration file\
132to enable Mailman web access:
133
134    Include ${confdir}/${name}.conf
135
136Be sure to set up the crontab entries for the '${mmuser}' user. Mailman runs a\
137number of cron jobs for its basic functionality.
138
139    cd ${sharedir}/cron
140    sudo crontab -u ${mmuser} crontab.in
141
142Also, be sure to read the following files for details on creating your\
143site-wide list, setting your site and list creator passwords, and creating\
144your first list:
145
146    ${docdir}/INSTALL
147    ${docdir}/README
148
149Finally, either restart your system to start up the Mailman queue runner, or\
150use the following to start it running immediately:
151
152    sudo port load ${name}
153"
Note: See TracBrowser for help on using the repository browser.