mailman/mailman.spec

Tue, 20 Sep 2011 17:37:48 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 20 Sep 2011 17:37:48 +0200
changeset 371
3d7d8c68b2fc
parent 188
78de2aaa27e2
child 392
886f36c75532
permissions
-rw-r--r--

Update to new version of vendor software and adjust patch logic.

     1 ##
     2 ##  mailman.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##
     5 ##  Permission to use, copy, modify, and distribute this software for
     6 ##  any purpose with or without fee is hereby granted, provided that
     7 ##  the above copyright notice and this permission notice appear in all
     8 ##  copies.
     9 ##
    10 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    11 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    12 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    13 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    14 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    15 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    16 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    17 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    18 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    19 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    20 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    21 ##  SUCH DAMAGE.
    22 ##
    24 #   package information
    25 Name:         mailman
    26 Summary:      Mailing List Management System
    27 URL:          http://www.list.org/
    28 Vendor:       John Viega et al.
    29 Packager:     OpenPKG Foundation e.V.
    30 Distribution: OpenPKG Community
    31 Class:        EVAL
    32 Group:        Mail
    33 License:      GPL
    34 Version:      2.1.14
    35 Release:      20110915
    37 #   list of sources
    38 Source0:      http://switch.dl.sourceforge.net/mailman/mailman-%{version}.tgz
    39 Source1:      manpages.tar.gz
    40 Source2:      mailman-sendmail.m4
    41 Source3:      mailman-apache.conf
    42 Source4:      rc.mailman
    43 Patch0:       mailman.patch
    45 #   build information
    46 Prefix:       %{l_prefix}
    47 BuildRoot:    %{l_buildroot}
    48 BuildPreReq:  OpenPKG, openpkg >= 20060823, python, make
    49 PreReq:       OpenPKG, openpkg >= 20060823, python, MTA
    50 AutoReq:      no
    51 AutoReqProv:  no
    53 %description
    54     Mailman is software to help manage email discussion lists, much
    55     like Majordomo and Smartmail. Unlike most similar products, Mailman
    56     gives each mailing list a webpage, and allows users to subscribe,
    57     unsubscribe, etc. over the Web. Even the list manager can administer
    58     his or her list entirely from the Web. Mailman also integrates most
    59     things people want to do with mailing lists, including archiving,
    60     mail/news gateways, and so on.
    62 %track
    63     prog mailman = {
    64         version   = %{version}
    65         url       = http://prdownloads.sourceforge.net/mailman/
    66         regex     = mailman-(\d+\.\d+\.\d+)\.tgz
    67     }
    69 %prep
    70     %setup -q
    71     %setup -q -D -T -a 1
    72     %patch -p0
    73     %{l_shtool} subst \
    74         -e 's;\(OWNERS_CAN_DELETE_THEIR_OWN_LISTS\) = No.*;\1 = Yes;' \
    75         Mailman/Defaults.py*
    77 %build
    78     #   configure package
    79     CC="%{l_cc}" \
    80     CFLAGS="%{l_cflags -O}" \
    81     CPPFLAGS="%{l_cppflags}" \
    82     LDFLAGS="%{l_ldflags}" \
    83     ./configure \
    84         --prefix=%{l_prefix}/libexec/mailman \
    85         --exec-prefix=%{l_prefix}/libexec/mailman \
    86         --sysconfdir=%{l_prefix}/etc/mailman \
    87         --with-var-prefix=%{l_prefix}/var/mailman \
    88         --with-username=%{l_nusr} \
    89         --with-groupname=%{l_ngrp} \
    90         --with-cgi-gid=%{l_ngrp} \
    91         --with-mail-gid=%{l_ngrp} \
    92         --with-cgi-ext="" \
    93         --with-urlhost="localhost" \
    94         --with-mailhost="localhost" \
    95         --without-permcheck \
    96         --enable-static
    98     #   build package
    99     %{l_make} %{l_mflags -O}
   101 %install
   102     #   install package
   103     rm -rf $RPM_BUILD_ROOT
   104     %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT DIRSETGID=true
   106     #   create additional directories
   107     %{l_shtool} mkdir -f -p -m 755 \
   108         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
   109         $RPM_BUILD_ROOT%{l_prefix}/etc/mailman \
   110         $RPM_BUILD_ROOT%{l_prefix}/man/man8
   112     #   strip down installation tree
   113     rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/tests
   115     #   install Sendmail mailer handler
   116     %{l_shtool} install -c -m 755 \
   117         -e 's;#!/usr/local/bin/perl;#!%{l_prefix}/bin/perl;' \
   118         -e 's;/home/mailman/mail/mailman;%{l_prefix}/libexec/mailman/mail/mailman;' \
   119         -e 's;/home/mailman/lists;%{l_prefix}/var/mailman/lists;' \
   120         -e 's;/usr/lib/sendmail;%{l_prefix}/sbin/sendmail;' \
   121         contrib/mm-handler \
   122         $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/mail/mailman-sendmail
   124     #   install Apache and Sendmail configurations
   125     %{l_shtool} install -c -m 644 %{l_value -s -a} \
   126         %{SOURCE mailman-sendmail.m4} %{SOURCE mailman-apache.conf} \
   127         $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/
   129     #   install manual pages
   130     %{l_shtool} install -c -m 644 \
   131         man8/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
   133     #   post-adjust default configuration
   134     mv $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py \
   135        $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
   136     ln -s %{l_prefix}/etc/mailman/mailman.cfg \
   137        $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py
   138     ( echo ""
   139       echo "DEFAULT_EMAIL_HOST           = 'host.example.com'"
   140       echo "DEFAULT_URL_HOST             = 'host.example.com'"
   141       echo "IMAGE_LOGOS                  = '/mailman/icons/'"
   142       echo "PUBLIC_ARCHIVE_URL           = '/mailman/pipermail/%%(listname)s'"
   143       echo "MAILMAN_USER                 = '%{l_nusr}'"
   144       echo "MAILMAN_GROUP                = '%{l_ngrp}'"
   145       echo "DEFAULT_SERVER_LANGUAGE      = 'en'"
   146       echo "VERP_PASSWORD_REMINDERS      = 1"
   147       echo "VERP_PERSONALIZED_DELIVERIES = 1"
   148       echo "VERP_CONFIRMATIONS           = 1"
   149       echo "VERP_DELIVERY_INTERVAL       = 1"
   150       echo ""
   151       echo "#   For available options and their descriptions see:"
   152       echo "#   %{l_prefix}/libexec/mailman/Mailman/Defaults.py"
   153       echo ""
   154     ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
   156     #   install run-command script
   157     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   158         %{SOURCE rc.mailman} ${RPM_BUILD_ROOT}%{l_prefix}/etc/rc.d/
   160     #   avoid root permissions on log file creation
   161     touch ${RPM_BUILD_ROOT}%{l_prefix}/var/mailman/logs/error
   162     touch ${RPM_BUILD_ROOT}%{l_prefix}/var/mailman/logs/fromusenet
   164     #   determine installation files
   165     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   166         %{l_files_std} \
   167         '%dir %attr(2700,%{l_nusr},%{l_mgrp}) %{l_prefix}/libexec/mailman/mail/mailman-sendmail' \
   168         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman' \
   169         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/logs' \
   170         '%dir %attr(644,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/logs/*' \
   171         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/spam' \
   172         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/qfiles' \
   173         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/locks' \
   174         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/lists' \
   175         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives' \
   176         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives/*' \
   177         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/data' \
   178         '%config %attr(0640,%{l_nusr},%{l_mgrp}) %{l_prefix}/etc/mailman/mailman.cfg' \
   179         '%config %{l_prefix}/etc/mailman/*'
   181 %files -f files
   183 %clean
   184     rm -rf $RPM_BUILD_ROOT
   186 %post
   187     #   add hook to MTA configuration
   188     if [ $1 -eq  1 ]; then
   189         aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
   190         update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
   191         if [ ".$aliases_file" != . ]; then
   192             ( echo "mailman:       postmaster"
   193               echo "mailman-owner: postmaster"
   194             ) |\
   195             $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
   196                 -a -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
   197         fi
   198         if [ ".$update_command" != . ]; then
   199             eval $update_command
   200         fi
   201     fi
   203     #   after upgrade, restart service
   204     [ $1 -eq 2 ] || exit 0
   205     $RPM_INSTALL_PREFIX/libexec/mailman/bin/update
   206     eval `%{l_rc} mailman status 2>/dev/null`
   207     [ ".$mailman_active" = .yes ] && %{l_rc} mailman restart
   208     exit 0
   210 %preun
   211     #   before erase, stop service (and remove files)
   212     [ $1 -eq 0 ] || exit 0
   213     rm -f $RPM_INSTALL_PREFIX/libexec/mailman/bin/paths.pyc     >/dev/null 2>&1 || true
   214     rm -f $RPM_INSTALL_PREFIX/libexec/mailman/cron/paths.pyc    >/dev/null 2>&1 || true
   215     rm -f $RPM_INSTALL_PREFIX/libexec/mailman/scripts/paths.pyc >/dev/null 2>&1 || true
   216     %{l_rc} mailman stop 2>/dev/null
   217     exit 0
   219 %postun
   220     #   remove hook from MTA configuration
   221     [ $1 -eq 0 ] || exit 0
   222     aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
   223     update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
   224     if [ ".$aliases_file" != . ]; then
   225         $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
   226             -r -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
   227     fi
   228     if [ ".$update_command" != . ]; then
   229         eval $update_command
   230     fi

mercurial