mailman/mailman.spec

Sun, 05 Aug 2012 21:46:09 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 05 Aug 2012 21:46:09 +0200
changeset 478
804dbcd7beb4
parent 392
886f36c75532
child 602
6b1bca241155
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

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

mercurial