Import original revisions from the OpenPKG project.

Wed, 17 Dec 2008 15:02:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 17 Dec 2008 15:02:08 +0100
changeset 7
5443cb9b550a
parent 6
eab6243607cb
child 8
012d4ffc4892

Import original revisions from the OpenPKG project.

mailman/mailman-apache.conf file | annotate | diff | comparison | revisions
mailman/mailman-sendmail.m4 file | annotate | diff | comparison | revisions
mailman/mailman.patch file | annotate | diff | comparison | revisions
mailman/mailman.spec file | annotate | diff | comparison | revisions
mailman/manpages.tar.gz file | annotate | diff | comparison | revisions
mailman/rc.mailman file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mailman/mailman-apache.conf	Wed Dec 17 15:02:08 2008 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +##
     1.5 +##  mailman-apache.conf -- Apache Configuration for Mailman
     1.6 +##
     1.7 +
     1.8 +<VirtualHost host.example.com>
     1.9 +    #   server information
    1.10 +    ServerName        host.example.com
    1.11 +    ServerAdmin       hostmaster@host.example.com
    1.12 +    ServerSignature   on
    1.13 +
    1.14 +    #   document area
    1.15 +    DocumentRoot @l_prefix@/libexec/mailman/htdocs/
    1.16 +    <Directory "@l_prefix@/libexec/mailman/htdocs">
    1.17 +        Options       FollowSymLinks
    1.18 +        AllowOverride None
    1.19 +        Order         allow,deny
    1.20 +        Allow         from all
    1.21 +    </Directory>
    1.22 +
    1.23 +    #   pipermail area
    1.24 +    Alias /mailman/pipermail/ @l_prefix@/var/mailman/archives/public/
    1.25 +    <Directory "@l_prefix@/var/mailman/archives/public">
    1.26 +        Options       FollowSymLinks
    1.27 +        AllowOverride None
    1.28 +        Order         allow,deny
    1.29 +        Allow         from all
    1.30 +    </Directory>
    1.31 +
    1.32 +    #   icon area
    1.33 +    Alias /mailman/icons/ @l_prefix@/libexec/mailman/icons/
    1.34 +    <Directory "@l_prefix@/libexec/mailman/icons">
    1.35 +        Options       FollowSymLinks
    1.36 +        AllowOverride None
    1.37 +        Order         allow,deny
    1.38 +        Allow         from all
    1.39 +    </Directory>
    1.40 +
    1.41 +    #   executable area
    1.42 +    ScriptAlias /mailman/ @l_prefix@/libexec/mailman/cgi-bin/
    1.43 +    <Directory "@l_prefix@/libexec/mailman/cgi-bin">
    1.44 +        Options       FollowSymLinks ExecCGI
    1.45 +        AllowOverride None
    1.46 +        Order         allow,deny
    1.47 +        Allow         from all
    1.48 +    </Directory>
    1.49 +
    1.50 +    #   logging
    1.51 +    CustomLog         @l_prefix@/var/mailman/logs/http-access.log common
    1.52 +    ErrorLog          @l_prefix@/var/mailman/logs/http-error.log
    1.53 +    LogLevel          warn
    1.54 +</VirtualHost>
    1.55 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/mailman/mailman-sendmail.m4	Wed Dec 17 15:02:08 2008 +0100
     2.3 @@ -0,0 +1,16 @@
     2.4 +dnl
     2.5 +dnl mailman.m4: Mailman specific local mailer
     2.6 +dnl
     2.7 +
     2.8 +MAILER_DEFINITIONS
     2.9 +
    2.10 +##  Special flags! See:
    2.11 +##  http://www.sendmail.org/~ca/email/doc8.10/op-sh-5.html#sh-5.4 Note
    2.12 +##  especially the absence of the "m" and "n" flags. THIS IS IMPORTANT:
    2.13 +##  mailman handler assumes this behavior to avoid having to know too
    2.14 +##  much about address parsing and other RFC-2822 mail details.
    2.15 +
    2.16 +Mmailman,	P=@l_prefix@/libexec/mailman/mail/mailman-sendmail, F=rDFMhlqSu, U=@l_nusr@:@l_ngrp@,
    2.17 +		S=EnvFromL, R=EnvToL/HdrToL,
    2.18 +		A=mailman-sendmail $h $u
    2.19 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/mailman/mailman.patch	Wed Dec 17 15:02:08 2008 +0100
     3.3 @@ -0,0 +1,247 @@
     3.4 +Index: Mailman/Archiver/pipermail.py
     3.5 +--- Mailman/Archiver/pipermail.py.orig	2008-06-30 18:29:46 +0200
     3.6 ++++ Mailman/Archiver/pipermail.py	2008-07-01 20:48:10 +0200
     3.7 +@@ -122,9 +122,9 @@
     3.8 +         parentID = article.parentID
     3.9 +         if parentID is not None and self.articleIndex.has_key(parentID):
    3.10 +             parent = self.getArticle(archive, parentID)
    3.11 +-            myThreadKey = parent.threadKey + article.date + '-'
    3.12 ++            myThreadKey = parent.threadKey + article.date + '/' + article.msgid + '-'
    3.13 +         else:
    3.14 +-            myThreadKey = article.date + '-'
    3.15 ++            myThreadKey = article.date + '/' + article.msgid + '-'
    3.16 +         article.threadKey = myThreadKey
    3.17 +         key = myThreadKey, article.msgid
    3.18 +         self.setThreadKey(archive, key, article.msgid)
    3.19 +@@ -418,7 +418,7 @@
    3.20 +                 else:
    3.21 +                     parent = self.database.getArticle(self.archive,
    3.22 +                                                     article.parentID)
    3.23 +-                    article.threadKey = parent.threadKey+article.date+'-'
    3.24 ++                    article.threadKey = parent.threadKey + article.date + '/' + article.msgid + '-'
    3.25 +                 self.database.setThreadKey(self.archive,
    3.26 +                     (article.threadKey, article.msgid),
    3.27 +                     msgid)
    3.28 +@@ -632,9 +632,9 @@
    3.29 +             article.parentID = parentID = self.get_parent_info(arch, article)
    3.30 +             if parentID:
    3.31 +                 parent = self.database.getArticle(arch, parentID)
    3.32 +-                article.threadKey = parent.threadKey + article.date + '-'
    3.33 ++                article.threadKey = parent.threadKey + article.date + '/' + article.msgid + '-'
    3.34 +             else:
    3.35 +-                article.threadKey = article.date + '-'
    3.36 ++                article.threadKey = article.date + '/' + article.msgid + '-'
    3.37 +             key = article.threadKey, article.msgid
    3.38 + 
    3.39 +             self.database.setThreadKey(arch, key, article.msgid)
    3.40 +Index: Mailman/Commands/cmd_subscribe.py
    3.41 +--- Mailman/Commands/cmd_subscribe.py.orig	2008-06-30 18:29:46 +0200
    3.42 ++++ Mailman/Commands/cmd_subscribe.py	2008-07-01 20:48:10 +0200
    3.43 +@@ -84,6 +84,7 @@
    3.44 +     if password is None:
    3.45 +         password = Utils.MakeRandomPassword()
    3.46 +     if address is None:
    3.47 ++        h = None
    3.48 +         realname, address = parseaddr(res.msg['from'])
    3.49 +         if not address:
    3.50 +             # Fall back to the sender address
    3.51 +Index: Mailman/HTMLFormatter.py
    3.52 +--- Mailman/HTMLFormatter.py.orig	2008-06-30 18:29:46 +0200
    3.53 ++++ Mailman/HTMLFormatter.py	2008-07-01 20:48:10 +0200
    3.54 +@@ -44,7 +44,7 @@
    3.55 +         realname = self.real_name
    3.56 +         hostname = self.host_name
    3.57 +         listinfo_link  = Link(self.GetScriptURL('listinfo'), realname).Format()
    3.58 +-        owner_link = Link('mailto:' + self.GetOwnerEmail(), ownertext).Format()
    3.59 ++        owner_link = Link('mailto:' + self.GetOwnerEmail(), realname + '-owner').Format()
    3.60 +         innertext = _('%(listinfo_link)s list run by %(owner_link)s')
    3.61 +         return Container(
    3.62 +             '<hr>',
    3.63 +Index: Mailman/Handlers/Decorate.py
    3.64 +--- Mailman/Handlers/Decorate.py.orig	2008-06-30 18:29:46 +0200
    3.65 ++++ Mailman/Handlers/Decorate.py	2008-07-01 20:48:10 +0200
    3.66 +@@ -197,6 +197,7 @@
    3.67 +     del msg['content-transfer-encoding']
    3.68 +     del msg['content-disposition']
    3.69 +     msg['Content-Type'] = 'multipart/mixed'
    3.70 ++    msg['Mime-version'] = '1.0'
    3.71 + 
    3.72 + 
    3.73 + 
    3.74 +Index: Mailman/Handlers/Scrubber.py
    3.75 +--- Mailman/Handlers/Scrubber.py.orig	2008-06-30 18:29:46 +0200
    3.76 ++++ Mailman/Handlers/Scrubber.py	2008-07-01 20:48:10 +0200
    3.77 +@@ -385,6 +385,8 @@
    3.78 +                     t = unicode(t, 'ascii', 'replace')
    3.79 +                 try:
    3.80 +                     # Should use HTML-Escape, or try generalizing to UTF-8
    3.81 ++                    if len(charset) == 0:
    3.82 ++                        charset = 'us-ascii'
    3.83 +                     t = t.encode(charset, 'replace')
    3.84 +                 except (UnicodeError, LookupError, ValueError,
    3.85 +                         AssertionError):
    3.86 +Index: Mailman/Queue/OutgoingRunner.py
    3.87 +--- Mailman/Queue/OutgoingRunner.py.orig	2008-06-30 18:29:46 +0200
    3.88 ++++ Mailman/Queue/OutgoingRunner.py	2008-07-01 20:48:10 +0200
    3.89 +@@ -89,6 +89,7 @@
    3.90 +                 syslog('error', 'Cannot connect to SMTP server %s on port %s',
    3.91 +                        mm_cfg.SMTPHOST, port)
    3.92 +                 self.__logged = True
    3.93 ++            self._snooze(0)
    3.94 +             return True
    3.95 +         except Errors.SomeRecipientsFailed, e:
    3.96 +             # Handle local rejects of probe messages differently.
    3.97 +Index: Mailman/htmlformat.py
    3.98 +--- Mailman/htmlformat.py.orig	2008-06-30 18:29:46 +0200
    3.99 ++++ Mailman/htmlformat.py	2008-07-01 20:48:10 +0200
   3.100 +@@ -300,7 +300,8 @@
   3.101 +         charset = 'us-ascii'
   3.102 +         if self.language:
   3.103 +             charset = Utils.GetCharSet(self.language)
   3.104 +-        output = ['Content-Type: text/html; charset=%s\n' % charset]
   3.105 ++        output = ['Content-Type: text/html; charset=%s' % charset]
   3.106 ++        output.append('Cache-control: no-cache\n')
   3.107 +         if not self.suppress_head:
   3.108 +             kws.setdefault('bgcolor', self.bgcolor)
   3.109 +             tab = ' ' * indent
   3.110 +Index: bin/check_perms
   3.111 +--- bin/check_perms.orig	2008-06-30 18:29:46 +0200
   3.112 ++++ bin/check_perms	2008-07-01 20:48:10 +0200
   3.113 +@@ -82,7 +82,7 @@
   3.114 +     return os.stat(path)[ST_MODE]
   3.115 + 
   3.116 + def statgidmode(path):
   3.117 +-    stat = os.stat(path)
   3.118 ++    stat = os.lstat(path)
   3.119 +     return stat[ST_MODE], stat[ST_GID]
   3.120 + 
   3.121 + seen = {}
   3.122 +Index: bin/config_list
   3.123 +--- bin/config_list.orig	2008-06-30 18:29:46 +0200
   3.124 ++++ bin/config_list	2008-07-01 20:48:10 +0200
   3.125 +@@ -307,6 +307,11 @@
   3.126 +                                     in mm_cfg.OPTINFO.items()
   3.127 +                                     if validval & bitval]
   3.128 +                     gui._setValue(mlist, k, validval, fakedoc)
   3.129 ++                    # Ugly hack, but seems to be needed since
   3.130 ++                    # new_member_options isn't really a number in gui.
   3.131 ++                    # -- tfheen, 2003-12-06
   3.132 ++                    if k == "new_member_options":
   3.133 ++                        mlist.new_member_options = validval
   3.134 +             # BAW: when to do gui._postValidate()???
   3.135 +     finally:
   3.136 +         if savelist and not checkonly:
   3.137 +Index: bin/mailmanctl
   3.138 +--- bin/mailmanctl.orig	2008-06-30 18:29:46 +0200
   3.139 ++++ bin/mailmanctl	2008-07-01 20:48:10 +0200
   3.140 +@@ -417,6 +417,13 @@
   3.141 +         # won't be opening any terminal devices, don't do the ultra-paranoid
   3.142 +         # suggestion of doing a second fork after the setsid() call.
   3.143 +         os.setsid()
   3.144 ++
   3.145 ++        # Be sure to close any open std{in,out,err}
   3.146 ++        devnull = os.open('/dev/null', 0)
   3.147 ++        os.dup2(devnull, 0)
   3.148 ++        os.dup2(devnull, 1)
   3.149 ++        os.dup2(devnull, 2)
   3.150 ++
   3.151 +         # Instead of cd'ing to root, cd to the Mailman installation home
   3.152 +         os.chdir(mm_cfg.PREFIX)
   3.153 +         # Set our file mode creation umask
   3.154 +Index: bin/newlist
   3.155 +--- bin/newlist.orig	2008-06-30 18:29:46 +0200
   3.156 ++++ bin/newlist	2008-07-01 20:48:10 +0200
   3.157 +@@ -87,6 +87,9 @@
   3.158 + defined in your Defaults.py file or overridden by settings in mm_cfg.py).
   3.159 + 
   3.160 + Note that listnames are forced to lowercase.
   3.161 ++
   3.162 ++The list admin address need to be a fully-qualified address, like
   3.163 ++owner@example.com, not just owner.
   3.164 + """
   3.165 + 
   3.166 + import sys
   3.167 +@@ -94,6 +97,7 @@
   3.168 + import getpass
   3.169 + import getopt
   3.170 + import sha
   3.171 ++import grp
   3.172 + 
   3.173 + import paths
   3.174 + from Mailman import mm_cfg
   3.175 +@@ -122,6 +126,9 @@
   3.176 + 
   3.177 + 
   3.178 + def main():
   3.179 ++    gid = grp.getgrnam(mm_cfg.MAILMAN_GROUP)[2]
   3.180 ++    if os.getgid() != mm_cfg.MAILMAN_GROUP:
   3.181 ++        os.setgid(gid)
   3.182 +     try:
   3.183 +         opts, args = getopt.getopt(sys.argv[1:], 'hql:u:e:',
   3.184 +                                    ['help', 'quiet', 'language=',
   3.185 +@@ -203,7 +210,7 @@
   3.186 +         except Errors.BadListNameError, s:
   3.187 +             usage(1, _('Illegal list name: %(s)s'))
   3.188 +         except Errors.EmailAddressError, s:
   3.189 +-            usage(1, _('Bad owner email address: %(s)s'))
   3.190 ++            usage(1, _('Bad owner email address: %(s)s.  Owner addresses need to be fully-qualified names, like "owner@example.com", not just "owner".'))
   3.191 +         except Errors.MMListAlreadyExistsError:
   3.192 +             usage(1, _('List already exists: %(listname)s'))
   3.193 + 
   3.194 +Index: bin/update
   3.195 +--- bin/update.orig	2008-06-30 18:29:46 +0200
   3.196 ++++ bin/update	2008-07-01 20:48:10 +0200
   3.197 +@@ -552,9 +552,11 @@
   3.198 +     file20 = os.path.join(mm_cfg.DATA_DIR, 'pending_subscriptions.db')
   3.199 +     file214 = os.path.join(mm_cfg.DATA_DIR, 'pending.pck')
   3.200 +     db = None
   3.201 ++    ver = None
   3.202 +     # Try to load the Mailman 2.0 file
   3.203 +     try:
   3.204 +         fp = open(file20)
   3.205 ++        ver = "20"
   3.206 +     except IOError, e:
   3.207 +         if e.errno <> errno.ENOENT: raise
   3.208 +     else:
   3.209 +@@ -566,6 +568,7 @@
   3.210 +         # Try to load the Mailman 2.1.x where x < 5, file
   3.211 +         try:
   3.212 +             fp = open(file214)
   3.213 ++            ver = "214"
   3.214 +         except IOError, e:
   3.215 +             if e.errno <> errno.ENOENT: raise
   3.216 +         else:
   3.217 +@@ -599,8 +602,12 @@
   3.218 +             # data[0] is the address being unsubscribed
   3.219 +             addrops_by_address.setdefault(data[0], []).append((key, val))
   3.220 +         elif op == Pending.SUBSCRIPTION:
   3.221 +-            # data[0] is a UserDesc object
   3.222 +-            addr = data[0].address
   3.223 ++            if ver == "20":
   3.224 ++                # data is tuple (emailaddr, password, digest)
   3.225 ++                addr = data[0]
   3.226 ++            else:
   3.227 ++                # data[0] is a UserDesc object
   3.228 ++                addr = data[0].address
   3.229 +             subs_by_address.setdefault(addr, []).append((key, val))
   3.230 +         elif op == Pending.RE_ENABLE:
   3.231 +             # data[0] is the mailing list's internal name
   3.232 +Index: scripts/driver
   3.233 +--- scripts/driver.orig	2008-06-30 18:29:46 +0200
   3.234 ++++ scripts/driver	2008-07-01 20:48:10 +0200
   3.235 +@@ -95,6 +95,15 @@
   3.236 +         module = getattr(pkg, scriptname)
   3.237 +         main = getattr(module, 'main')
   3.238 +         try:
   3.239 ++            import os
   3.240 ++            request_method = os.environ.get('REQUEST_METHOD')
   3.241 ++            if not request_method in ['GET', 'POST', 'HEAD']:
   3.242 ++                print "Status: 405 Method not allowed"
   3.243 ++                print "Content-type: text/plain"
   3.244 ++                print
   3.245 ++                print "The method is not allowed"
   3.246 ++                sys.exit()
   3.247 ++                
   3.248 +             try:
   3.249 +                 sys.stderr = logger
   3.250 +                 sys.stdout = tempstdout
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/mailman/mailman.spec	Wed Dec 17 15:02:08 2008 +0100
     4.3 @@ -0,0 +1,225 @@
     4.4 +##
     4.5 +##  mailman.spec -- OpenPKG RPM Package Specification
     4.6 +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     4.7 +##
     4.8 +##  Permission to use, copy, modify, and distribute this software for
     4.9 +##  any purpose with or without fee is hereby granted, provided that
    4.10 +##  the above copyright notice and this permission notice appear in all
    4.11 +##  copies.
    4.12 +##
    4.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    4.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    4.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    4.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    4.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    4.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    4.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    4.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    4.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    4.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    4.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    4.24 +##  SUCH DAMAGE.
    4.25 +##
    4.26 +
    4.27 +#   FIXME: rse: is this packaging complete?
    4.28 +
    4.29 +#   package information
    4.30 +Name:         mailman
    4.31 +Summary:      Mailing List Management System
    4.32 +URL:          http://www.list.org/
    4.33 +Vendor:       John Viega et al.
    4.34 +Packager:     OpenPKG Foundation e.V.
    4.35 +Distribution: OpenPKG Community
    4.36 +Class:        EVAL
    4.37 +Group:        Mail
    4.38 +License:      GPL
    4.39 +Version:      2.1.11
    4.40 +Release:      20080701
    4.41 +
    4.42 +#   list of sources
    4.43 +Source0:      http://switch.dl.sourceforge.net/mailman/mailman-%{version}.tgz
    4.44 +Source1:      manpages.tar.gz
    4.45 +Source2:      mailman-sendmail.m4
    4.46 +Source3:      mailman-apache.conf
    4.47 +Source4:      rc.mailman
    4.48 +Patch0:       mailman.patch
    4.49 +
    4.50 +#   build information
    4.51 +Prefix:       %{l_prefix}
    4.52 +BuildRoot:    %{l_buildroot}
    4.53 +BuildPreReq:  OpenPKG, openpkg >= 20060823, python
    4.54 +PreReq:       OpenPKG, openpkg >= 20060823, python, MTA
    4.55 +AutoReq:      no
    4.56 +AutoReqProv:  no
    4.57 +
    4.58 +%description
    4.59 +    Mailman is software to help manage email discussion lists, much
    4.60 +    like Majordomo and Smartmail. Unlike most similar products, Mailman
    4.61 +    gives each mailing list a webpage, and allows users to subscribe,
    4.62 +    unsubscribe, etc. over the Web. Even the list manager can administer
    4.63 +    his or her list entirely from the Web. Mailman also integrates most
    4.64 +    things people want to do with mailing lists, including archiving,
    4.65 +    mail/news gateways, and so on.
    4.66 +
    4.67 +%track
    4.68 +    prog mailman = {
    4.69 +        version   = %{version}
    4.70 +        url       = http://prdownloads.sourceforge.net/mailman/
    4.71 +        regex     = mailman-(\d+\.\d+\.\d+)\.tgz
    4.72 +    }
    4.73 +
    4.74 +%prep
    4.75 +    %setup -q
    4.76 +    %setup -q -D -T -a 1
    4.77 +    %patch -p0
    4.78 +
    4.79 +%build
    4.80 +    #   configure package
    4.81 +    CC="%{l_cc}" \
    4.82 +    CFLAGS="%{l_cflags -O}" \
    4.83 +    CPPFLAGS="%{l_cppflags}" \
    4.84 +    LDFLAGS="%{l_ldflags}" \
    4.85 +    ./configure \
    4.86 +        --prefix=%{l_prefix}/libexec/mailman \
    4.87 +        --exec-prefix=%{l_prefix}/libexec/mailman \
    4.88 +        --sysconfdir=%{l_prefix}/etc/mailman \
    4.89 +        --with-var-prefix=%{l_prefix}/var/mailman \
    4.90 +        --with-username=%{l_nusr} \
    4.91 +        --with-groupname=%{l_mgrp} \
    4.92 +        --with-cgi-gid=%{l_ngrp} \
    4.93 +        --with-mail-gid=%{l_mgrp} \
    4.94 +        --with-cgi-ext="" \
    4.95 +        --with-urlhost="localhost" \
    4.96 +        --with-mailhost="localhost" \
    4.97 +        --without-permcheck \
    4.98 +        --enable-static
    4.99 +
   4.100 +    #   build package
   4.101 +    %{l_make} %{l_mflags}
   4.102 +
   4.103 +%install
   4.104 +    #   install package
   4.105 +    rm -rf $RPM_BUILD_ROOT
   4.106 +    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT DIRSETGID=true
   4.107 +
   4.108 +    #   create additional directories
   4.109 +    %{l_shtool} mkdir -f -p -m 755 \
   4.110 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
   4.111 +        $RPM_BUILD_ROOT%{l_prefix}/etc/mailman \
   4.112 +        $RPM_BUILD_ROOT%{l_prefix}/man/man8
   4.113 +
   4.114 +    #   strip down installation tree
   4.115 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/tests
   4.116 +
   4.117 +    #   install Sendmail mailer handler
   4.118 +    %{l_shtool} install -c -m 755 \
   4.119 +        -e 's;#!/usr/local/bin/perl;#!%{l_prefix}/bin/perl;' \
   4.120 +        -e 's;/home/mailman/mail/mailman;%{l_prefix}/libexec/mailman/mail/mailman;' \
   4.121 +        -e 's;/home/mailman/lists;%{l_prefix}/var/mailman/lists;' \
   4.122 +        -e 's;/usr/lib/sendmail;%{l_prefix}/sbin/sendmail;' \
   4.123 +        contrib/mm-handler \
   4.124 +        $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/mail/mailman-sendmail
   4.125 +
   4.126 +    #   install Apache and Sendmail configurations
   4.127 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   4.128 +        %{SOURCE mailman-sendmail.m4} %{SOURCE mailman-apache.conf} \
   4.129 +        $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/
   4.130 +
   4.131 +    #   install manual pages
   4.132 +    %{l_shtool} install -c -m 644 \
   4.133 +        man8/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
   4.134 +
   4.135 +    #   post-adjust default configuration
   4.136 +    mv $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py \
   4.137 +       $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
   4.138 +    ln -s %{l_prefix}/etc/mailman/mailman.cfg \
   4.139 +       $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py
   4.140 +    ( echo ""
   4.141 +      echo "DEFAULT_EMAIL_HOST           = 'host.example.com'"
   4.142 +      echo "DEFAULT_URL_HOST             = 'host.example.com'"
   4.143 +      echo "IMAGE_LOGOS                  = '/mailman/icons/'"
   4.144 +      echo "PUBLIC_ARCHIVE_URL           = '/mailman/pipermail/%%(listname)s'"
   4.145 +      echo "MAILMAN_USER                 = '%{l_nusr}'"
   4.146 +      echo "MAILMAN_GROUP                = '%{l_mgrp}'"
   4.147 +      echo "DEFAULT_SERVER_LANGUAGE      = 'en'"
   4.148 +      echo "VERP_PASSWORD_REMINDERS      = 1"
   4.149 +      echo "VERP_PERSONALIZED_DELIVERIES = 1"
   4.150 +      echo "VERP_CONFIRMATIONS           = 1"
   4.151 +      echo "VERP_DELIVERY_INTERVAL       = 1"
   4.152 +      echo ""
   4.153 +      echo "#   For available options and their descriptions see:"
   4.154 +      echo "#   %{l_prefix}/libexec/mailman/Mailman/Defaults.py"
   4.155 +      echo ""
   4.156 +    ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
   4.157 +
   4.158 +    #   install run-command script
   4.159 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   4.160 +        %{SOURCE rc.mailman} ${RPM_BUILD_ROOT}%{l_prefix}/etc/rc.d/
   4.161 +
   4.162 +    #   determine installation files
   4.163 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   4.164 +        %{l_files_std} \
   4.165 +        '%dir %attr(2700,%{l_nusr},%{l_mgrp}) %{l_prefix}/libexec/mailman/mail/mailman-sendmail' \
   4.166 +        '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman' \
   4.167 +        '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/logs' \
   4.168 +        '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/spam' \
   4.169 +        '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/qfiles' \
   4.170 +        '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/locks' \
   4.171 +        '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/lists' \
   4.172 +        '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives' \
   4.173 +        '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives/*' \
   4.174 +        '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/data' \
   4.175 +        '%config %attr(0640,%{l_nusr},%{l_mgrp}) %{l_prefix}/etc/mailman/mailman.cfg' \
   4.176 +        '%config %{l_prefix}/etc/mailman/*'
   4.177 +
   4.178 +%files -f files
   4.179 +
   4.180 +%clean
   4.181 +    rm -rf $RPM_BUILD_ROOT
   4.182 +
   4.183 +%post
   4.184 +    #   add hook to MTA configuration
   4.185 +    if [ $1 -eq  1 ]; then
   4.186 +        aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
   4.187 +        update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
   4.188 +        if [ ".$aliases_file" != . ]; then
   4.189 +            ( echo "mailman:       postmaster"
   4.190 +              echo "mailman-owner: postmaster"
   4.191 +            ) |\
   4.192 +            $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
   4.193 +                -a -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
   4.194 +        fi
   4.195 +        if [ ".$update_command" != . ]; then
   4.196 +            eval $update_command
   4.197 +        fi
   4.198 +    fi
   4.199 +
   4.200 +    #   after upgrade, restart service
   4.201 +    [ $1 -eq 2 ] || exit 0
   4.202 +    $RPM_INSTALL_PREFIX/libexec/mailman/bin/update
   4.203 +    eval `%{l_rc} mailman status 2>/dev/null`
   4.204 +    [ ".$mailman_active" = .yes ] && %{l_rc} mailman restart
   4.205 +    exit 0
   4.206 +
   4.207 +%preun
   4.208 +    #   before erase, stop service (and remove files)
   4.209 +    [ $1 -eq 0 ] || exit 0
   4.210 +    rm -f $RPM_INSTALL_PREFIX/libexec/mailman/bin/paths.pyc     >/dev/null 2>&1 || true
   4.211 +    rm -f $RPM_INSTALL_PREFIX/libexec/mailman/cron/paths.pyc    >/dev/null 2>&1 || true
   4.212 +    rm -f $RPM_INSTALL_PREFIX/libexec/mailman/scripts/paths.pyc >/dev/null 2>&1 || true
   4.213 +    %{l_rc} mailman stop 2>/dev/null
   4.214 +    exit 0
   4.215 +
   4.216 +%postun
   4.217 +    #   remove hook from MTA configuration
   4.218 +    [ $1 -eq 0 ] || exit 0
   4.219 +    aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
   4.220 +    update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
   4.221 +    if [ ".$aliases_file" != . ]; then
   4.222 +        $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
   4.223 +            -r -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
   4.224 +    fi
   4.225 +    if [ ".$update_command" != . ]; then
   4.226 +        eval $update_command
   4.227 +    fi
   4.228 +
     5.1 Binary file mailman/manpages.tar.gz has changed
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/mailman/rc.mailman	Wed Dec 17 15:02:08 2008 +0100
     6.3 @@ -0,0 +1,53 @@
     6.4 +#!@l_prefix@/bin/openpkg rc
     6.5 +##
     6.6 +##  rc.mailman -- Run-Commands
     6.7 +##
     6.8 +
     6.9 +%config
    6.10 +    mailman_enable="$openpkg_rc_def"
    6.11 +
    6.12 +%common
    6.13 +    mailman_ctl="@l_prefix@/libexec/mailman/bin/mailmanctl"
    6.14 +
    6.15 +%status -u @l_susr@ -o
    6.16 +    mailman_usable="unknown"
    6.17 +    mailman_active="no"
    6.18 +    rcService mailman enable yes && \
    6.19 +        @l_prefix@/bin/python ${mailman_ctl} -q FIXME && \
    6.20 +        mailman_active="yes"
    6.21 +    echo "mailman_enable=\"$mailman_enable\""
    6.22 +    echo "mailman_usable=\"$mailman_usable\""
    6.23 +    echo "mailman_active=\"$mailman_active\""
    6.24 +
    6.25 +%start -u @l_susr@
    6.26 +    rcService mailman enable yes || exit 0
    6.27 +    rcService mailman active yes && exit 0
    6.28 +    @l_prefix@/bin/python ${mailman_ctl} -s -q start
    6.29 +
    6.30 +%stop -u @l_susr@
    6.31 +    rcService mailman enable yes || exit 0
    6.32 +    rcService mailman active no  && exit 0
    6.33 +    @l_prefix@/bin/python ${mailman_ctl} -q stop
    6.34 +    sleep 2
    6.35 +
    6.36 +%restart -u @l_susr@
    6.37 +    rcService mailman enable yes || exit 0
    6.38 +    rcService mailman active no  && exit 0
    6.39 +    @l_prefix@/bin/python ${mailman_ctl} -q restart
    6.40 +    sleep 2
    6.41 +
    6.42 +%quarterly -u @l_susr@
    6.43 +    rcService mailman enable yes || exit 0
    6.44 +    @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/gate_news
    6.45 +
    6.46 +%daily -u @l_susr@
    6.47 +    rcService mailman enable yes || exit 0
    6.48 +    @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/checkdbs
    6.49 +    @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/disabled
    6.50 +    @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/senddigests
    6.51 +    @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/nightly_gzip
    6.52 +
    6.53 +%monthly -u @l_susr@
    6.54 +    rcService mailman enable yes || exit 0
    6.55 +    @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/mailpasswds
    6.56 +

mercurial