1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mailman/mailman.spec Wed Dec 17 15:02:08 2008 +0100 1.3 @@ -0,0 +1,225 @@ 1.4 +## 1.5 +## mailman.spec -- OpenPKG RPM Package Specification 1.6 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 +# FIXME: rse: is this packaging complete? 1.28 + 1.29 +# package information 1.30 +Name: mailman 1.31 +Summary: Mailing List Management System 1.32 +URL: http://www.list.org/ 1.33 +Vendor: John Viega et al. 1.34 +Packager: OpenPKG Foundation e.V. 1.35 +Distribution: OpenPKG Community 1.36 +Class: EVAL 1.37 +Group: Mail 1.38 +License: GPL 1.39 +Version: 2.1.11 1.40 +Release: 20080701 1.41 + 1.42 +# list of sources 1.43 +Source0: http://switch.dl.sourceforge.net/mailman/mailman-%{version}.tgz 1.44 +Source1: manpages.tar.gz 1.45 +Source2: mailman-sendmail.m4 1.46 +Source3: mailman-apache.conf 1.47 +Source4: rc.mailman 1.48 +Patch0: mailman.patch 1.49 + 1.50 +# build information 1.51 +Prefix: %{l_prefix} 1.52 +BuildRoot: %{l_buildroot} 1.53 +BuildPreReq: OpenPKG, openpkg >= 20060823, python 1.54 +PreReq: OpenPKG, openpkg >= 20060823, python, MTA 1.55 +AutoReq: no 1.56 +AutoReqProv: no 1.57 + 1.58 +%description 1.59 + Mailman is software to help manage email discussion lists, much 1.60 + like Majordomo and Smartmail. Unlike most similar products, Mailman 1.61 + gives each mailing list a webpage, and allows users to subscribe, 1.62 + unsubscribe, etc. over the Web. Even the list manager can administer 1.63 + his or her list entirely from the Web. Mailman also integrates most 1.64 + things people want to do with mailing lists, including archiving, 1.65 + mail/news gateways, and so on. 1.66 + 1.67 +%track 1.68 + prog mailman = { 1.69 + version = %{version} 1.70 + url = http://prdownloads.sourceforge.net/mailman/ 1.71 + regex = mailman-(\d+\.\d+\.\d+)\.tgz 1.72 + } 1.73 + 1.74 +%prep 1.75 + %setup -q 1.76 + %setup -q -D -T -a 1 1.77 + %patch -p0 1.78 + 1.79 +%build 1.80 + # configure package 1.81 + CC="%{l_cc}" \ 1.82 + CFLAGS="%{l_cflags -O}" \ 1.83 + CPPFLAGS="%{l_cppflags}" \ 1.84 + LDFLAGS="%{l_ldflags}" \ 1.85 + ./configure \ 1.86 + --prefix=%{l_prefix}/libexec/mailman \ 1.87 + --exec-prefix=%{l_prefix}/libexec/mailman \ 1.88 + --sysconfdir=%{l_prefix}/etc/mailman \ 1.89 + --with-var-prefix=%{l_prefix}/var/mailman \ 1.90 + --with-username=%{l_nusr} \ 1.91 + --with-groupname=%{l_mgrp} \ 1.92 + --with-cgi-gid=%{l_ngrp} \ 1.93 + --with-mail-gid=%{l_mgrp} \ 1.94 + --with-cgi-ext="" \ 1.95 + --with-urlhost="localhost" \ 1.96 + --with-mailhost="localhost" \ 1.97 + --without-permcheck \ 1.98 + --enable-static 1.99 + 1.100 + # build package 1.101 + %{l_make} %{l_mflags} 1.102 + 1.103 +%install 1.104 + # install package 1.105 + rm -rf $RPM_BUILD_ROOT 1.106 + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT DIRSETGID=true 1.107 + 1.108 + # create additional directories 1.109 + %{l_shtool} mkdir -f -p -m 755 \ 1.110 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ 1.111 + $RPM_BUILD_ROOT%{l_prefix}/etc/mailman \ 1.112 + $RPM_BUILD_ROOT%{l_prefix}/man/man8 1.113 + 1.114 + # strip down installation tree 1.115 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/tests 1.116 + 1.117 + # install Sendmail mailer handler 1.118 + %{l_shtool} install -c -m 755 \ 1.119 + -e 's;#!/usr/local/bin/perl;#!%{l_prefix}/bin/perl;' \ 1.120 + -e 's;/home/mailman/mail/mailman;%{l_prefix}/libexec/mailman/mail/mailman;' \ 1.121 + -e 's;/home/mailman/lists;%{l_prefix}/var/mailman/lists;' \ 1.122 + -e 's;/usr/lib/sendmail;%{l_prefix}/sbin/sendmail;' \ 1.123 + contrib/mm-handler \ 1.124 + $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/mail/mailman-sendmail 1.125 + 1.126 + # install Apache and Sendmail configurations 1.127 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 1.128 + %{SOURCE mailman-sendmail.m4} %{SOURCE mailman-apache.conf} \ 1.129 + $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/ 1.130 + 1.131 + # install manual pages 1.132 + %{l_shtool} install -c -m 644 \ 1.133 + man8/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ 1.134 + 1.135 + # post-adjust default configuration 1.136 + mv $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py \ 1.137 + $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg 1.138 + ln -s %{l_prefix}/etc/mailman/mailman.cfg \ 1.139 + $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py 1.140 + ( echo "" 1.141 + echo "DEFAULT_EMAIL_HOST = 'host.example.com'" 1.142 + echo "DEFAULT_URL_HOST = 'host.example.com'" 1.143 + echo "IMAGE_LOGOS = '/mailman/icons/'" 1.144 + echo "PUBLIC_ARCHIVE_URL = '/mailman/pipermail/%%(listname)s'" 1.145 + echo "MAILMAN_USER = '%{l_nusr}'" 1.146 + echo "MAILMAN_GROUP = '%{l_mgrp}'" 1.147 + echo "DEFAULT_SERVER_LANGUAGE = 'en'" 1.148 + echo "VERP_PASSWORD_REMINDERS = 1" 1.149 + echo "VERP_PERSONALIZED_DELIVERIES = 1" 1.150 + echo "VERP_CONFIRMATIONS = 1" 1.151 + echo "VERP_DELIVERY_INTERVAL = 1" 1.152 + echo "" 1.153 + echo "# For available options and their descriptions see:" 1.154 + echo "# %{l_prefix}/libexec/mailman/Mailman/Defaults.py" 1.155 + echo "" 1.156 + ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg 1.157 + 1.158 + # install run-command script 1.159 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 1.160 + %{SOURCE rc.mailman} ${RPM_BUILD_ROOT}%{l_prefix}/etc/rc.d/ 1.161 + 1.162 + # determine installation files 1.163 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 1.164 + %{l_files_std} \ 1.165 + '%dir %attr(2700,%{l_nusr},%{l_mgrp}) %{l_prefix}/libexec/mailman/mail/mailman-sendmail' \ 1.166 + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman' \ 1.167 + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/logs' \ 1.168 + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/spam' \ 1.169 + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/qfiles' \ 1.170 + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/locks' \ 1.171 + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/lists' \ 1.172 + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives' \ 1.173 + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives/*' \ 1.174 + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/data' \ 1.175 + '%config %attr(0640,%{l_nusr},%{l_mgrp}) %{l_prefix}/etc/mailman/mailman.cfg' \ 1.176 + '%config %{l_prefix}/etc/mailman/*' 1.177 + 1.178 +%files -f files 1.179 + 1.180 +%clean 1.181 + rm -rf $RPM_BUILD_ROOT 1.182 + 1.183 +%post 1.184 + # add hook to MTA configuration 1.185 + if [ $1 -eq 1 ]; then 1.186 + aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file` 1.187 + update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update` 1.188 + if [ ".$aliases_file" != . ]; then 1.189 + ( echo "mailman: postmaster" 1.190 + echo "mailman-owner: postmaster" 1.191 + ) |\ 1.192 + $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \ 1.193 + -a -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file 1.194 + fi 1.195 + if [ ".$update_command" != . ]; then 1.196 + eval $update_command 1.197 + fi 1.198 + fi 1.199 + 1.200 + # after upgrade, restart service 1.201 + [ $1 -eq 2 ] || exit 0 1.202 + $RPM_INSTALL_PREFIX/libexec/mailman/bin/update 1.203 + eval `%{l_rc} mailman status 2>/dev/null` 1.204 + [ ".$mailman_active" = .yes ] && %{l_rc} mailman restart 1.205 + exit 0 1.206 + 1.207 +%preun 1.208 + # before erase, stop service (and remove files) 1.209 + [ $1 -eq 0 ] || exit 0 1.210 + rm -f $RPM_INSTALL_PREFIX/libexec/mailman/bin/paths.pyc >/dev/null 2>&1 || true 1.211 + rm -f $RPM_INSTALL_PREFIX/libexec/mailman/cron/paths.pyc >/dev/null 2>&1 || true 1.212 + rm -f $RPM_INSTALL_PREFIX/libexec/mailman/scripts/paths.pyc >/dev/null 2>&1 || true 1.213 + %{l_rc} mailman stop 2>/dev/null 1.214 + exit 0 1.215 + 1.216 +%postun 1.217 + # remove hook from MTA configuration 1.218 + [ $1 -eq 0 ] || exit 0 1.219 + aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file` 1.220 + update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update` 1.221 + if [ ".$aliases_file" != . ]; then 1.222 + $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \ 1.223 + -r -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file 1.224 + fi 1.225 + if [ ".$update_command" != . ]; then 1.226 + eval $update_command 1.227 + fi 1.228 +