mailman/mailman.spec

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
child 8
012d4ffc4892
permissions
-rw-r--r--

Import original revisions from the OpenPKG project.

     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 #   FIXME: rse: is this packaging complete?
    26 #   package information
    27 Name:         mailman
    28 Summary:      Mailing List Management System
    29 URL:          http://www.list.org/
    30 Vendor:       John Viega et al.
    31 Packager:     OpenPKG Foundation e.V.
    32 Distribution: OpenPKG Community
    33 Class:        EVAL
    34 Group:        Mail
    35 License:      GPL
    36 Version:      2.1.11
    37 Release:      20080701
    39 #   list of sources
    40 Source0:      http://switch.dl.sourceforge.net/mailman/mailman-%{version}.tgz
    41 Source1:      manpages.tar.gz
    42 Source2:      mailman-sendmail.m4
    43 Source3:      mailman-apache.conf
    44 Source4:      rc.mailman
    45 Patch0:       mailman.patch
    47 #   build information
    48 Prefix:       %{l_prefix}
    49 BuildRoot:    %{l_buildroot}
    50 BuildPreReq:  OpenPKG, openpkg >= 20060823, python
    51 PreReq:       OpenPKG, openpkg >= 20060823, python, MTA
    52 AutoReq:      no
    53 AutoReqProv:  no
    55 %description
    56     Mailman is software to help manage email discussion lists, much
    57     like Majordomo and Smartmail. Unlike most similar products, Mailman
    58     gives each mailing list a webpage, and allows users to subscribe,
    59     unsubscribe, etc. over the Web. Even the list manager can administer
    60     his or her list entirely from the Web. Mailman also integrates most
    61     things people want to do with mailing lists, including archiving,
    62     mail/news gateways, and so on.
    64 %track
    65     prog mailman = {
    66         version   = %{version}
    67         url       = http://prdownloads.sourceforge.net/mailman/
    68         regex     = mailman-(\d+\.\d+\.\d+)\.tgz
    69     }
    71 %prep
    72     %setup -q
    73     %setup -q -D -T -a 1
    74     %patch -p0
    76 %build
    77     #   configure package
    78     CC="%{l_cc}" \
    79     CFLAGS="%{l_cflags -O}" \
    80     CPPFLAGS="%{l_cppflags}" \
    81     LDFLAGS="%{l_ldflags}" \
    82     ./configure \
    83         --prefix=%{l_prefix}/libexec/mailman \
    84         --exec-prefix=%{l_prefix}/libexec/mailman \
    85         --sysconfdir=%{l_prefix}/etc/mailman \
    86         --with-var-prefix=%{l_prefix}/var/mailman \
    87         --with-username=%{l_nusr} \
    88         --with-groupname=%{l_mgrp} \
    89         --with-cgi-gid=%{l_ngrp} \
    90         --with-mail-gid=%{l_mgrp} \
    91         --with-cgi-ext="" \
    92         --with-urlhost="localhost" \
    93         --with-mailhost="localhost" \
    94         --without-permcheck \
    95         --enable-static
    97     #   build package
    98     %{l_make} %{l_mflags}
   100 %install
   101     #   install package
   102     rm -rf $RPM_BUILD_ROOT
   103     %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT DIRSETGID=true
   105     #   create additional directories
   106     %{l_shtool} mkdir -f -p -m 755 \
   107         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
   108         $RPM_BUILD_ROOT%{l_prefix}/etc/mailman \
   109         $RPM_BUILD_ROOT%{l_prefix}/man/man8
   111     #   strip down installation tree
   112     rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/tests
   114     #   install Sendmail mailer handler
   115     %{l_shtool} install -c -m 755 \
   116         -e 's;#!/usr/local/bin/perl;#!%{l_prefix}/bin/perl;' \
   117         -e 's;/home/mailman/mail/mailman;%{l_prefix}/libexec/mailman/mail/mailman;' \
   118         -e 's;/home/mailman/lists;%{l_prefix}/var/mailman/lists;' \
   119         -e 's;/usr/lib/sendmail;%{l_prefix}/sbin/sendmail;' \
   120         contrib/mm-handler \
   121         $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/mail/mailman-sendmail
   123     #   install Apache and Sendmail configurations
   124     %{l_shtool} install -c -m 644 %{l_value -s -a} \
   125         %{SOURCE mailman-sendmail.m4} %{SOURCE mailman-apache.conf} \
   126         $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/
   128     #   install manual pages
   129     %{l_shtool} install -c -m 644 \
   130         man8/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
   132     #   post-adjust default configuration
   133     mv $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py \
   134        $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
   135     ln -s %{l_prefix}/etc/mailman/mailman.cfg \
   136        $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py
   137     ( echo ""
   138       echo "DEFAULT_EMAIL_HOST           = 'host.example.com'"
   139       echo "DEFAULT_URL_HOST             = 'host.example.com'"
   140       echo "IMAGE_LOGOS                  = '/mailman/icons/'"
   141       echo "PUBLIC_ARCHIVE_URL           = '/mailman/pipermail/%%(listname)s'"
   142       echo "MAILMAN_USER                 = '%{l_nusr}'"
   143       echo "MAILMAN_GROUP                = '%{l_mgrp}'"
   144       echo "DEFAULT_SERVER_LANGUAGE      = 'en'"
   145       echo "VERP_PASSWORD_REMINDERS      = 1"
   146       echo "VERP_PERSONALIZED_DELIVERIES = 1"
   147       echo "VERP_CONFIRMATIONS           = 1"
   148       echo "VERP_DELIVERY_INTERVAL       = 1"
   149       echo ""
   150       echo "#   For available options and their descriptions see:"
   151       echo "#   %{l_prefix}/libexec/mailman/Mailman/Defaults.py"
   152       echo ""
   153     ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
   155     #   install run-command script
   156     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   157         %{SOURCE rc.mailman} ${RPM_BUILD_ROOT}%{l_prefix}/etc/rc.d/
   159     #   determine installation files
   160     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   161         %{l_files_std} \
   162         '%dir %attr(2700,%{l_nusr},%{l_mgrp}) %{l_prefix}/libexec/mailman/mail/mailman-sendmail' \
   163         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman' \
   164         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/logs' \
   165         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/spam' \
   166         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/qfiles' \
   167         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/locks' \
   168         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/lists' \
   169         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives' \
   170         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives/*' \
   171         '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/data' \
   172         '%config %attr(0640,%{l_nusr},%{l_mgrp}) %{l_prefix}/etc/mailman/mailman.cfg' \
   173         '%config %{l_prefix}/etc/mailman/*'
   175 %files -f files
   177 %clean
   178     rm -rf $RPM_BUILD_ROOT
   180 %post
   181     #   add hook to MTA configuration
   182     if [ $1 -eq  1 ]; then
   183         aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
   184         update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
   185         if [ ".$aliases_file" != . ]; then
   186             ( echo "mailman:       postmaster"
   187               echo "mailman-owner: postmaster"
   188             ) |\
   189             $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
   190                 -a -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
   191         fi
   192         if [ ".$update_command" != . ]; then
   193             eval $update_command
   194         fi
   195     fi
   197     #   after upgrade, restart service
   198     [ $1 -eq 2 ] || exit 0
   199     $RPM_INSTALL_PREFIX/libexec/mailman/bin/update
   200     eval `%{l_rc} mailman status 2>/dev/null`
   201     [ ".$mailman_active" = .yes ] && %{l_rc} mailman restart
   202     exit 0
   204 %preun
   205     #   before erase, stop service (and remove files)
   206     [ $1 -eq 0 ] || exit 0
   207     rm -f $RPM_INSTALL_PREFIX/libexec/mailman/bin/paths.pyc     >/dev/null 2>&1 || true
   208     rm -f $RPM_INSTALL_PREFIX/libexec/mailman/cron/paths.pyc    >/dev/null 2>&1 || true
   209     rm -f $RPM_INSTALL_PREFIX/libexec/mailman/scripts/paths.pyc >/dev/null 2>&1 || true
   210     %{l_rc} mailman stop 2>/dev/null
   211     exit 0
   213 %postun
   214     #   remove hook from MTA configuration
   215     [ $1 -eq 0 ] || exit 0
   216     aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
   217     update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
   218     if [ ".$aliases_file" != . ]; then
   219         $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
   220             -r -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
   221     fi
   222     if [ ".$update_command" != . ]; then
   223         eval $update_command
   224     fi

mercurial