Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
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 # MSvB FIXME:
25 # MSvB FIXME: Problem with logging to syslog instead of FSL...
26 # MSvB FIXME:
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
28 # MSvB FIXME: Sep 20 17:33:41 host.name.tld wrapper script to be executed as group "pfx", but
29 # MSvB FIXME: Sep 20 17:33:41 host.name.tld the system's mail server executed the mail script as
30 # MSvB FIXME: Sep 20 17:33:41 host.name.tld group "pfx-n". Try tweaking the mail server to run the
31 # MSvB FIXME: Sep 20 17:33:41 host.name.tld script as group "pfx", or re-run configure,
32 # MSvB FIXME: Sep 20 17:33:41 host.name.tld providing the command line option `--with-mail-gid=pfx-n'.
34 # package information
35 Name: mailman
36 Summary: Mailing List Management System
37 URL: http://www.list.org/
38 Vendor: John Viega et al.
39 Packager: OpenPKG Foundation e.V.
40 Distribution: OpenPKG Community
41 Class: EVAL
42 Group: Mail
43 License: GPL
44 Version: 2.1.15
45 Release: 20120800
47 # list of sources
48 Source0: http://ftp.gnu.org/gnu/mailman/mailman-%{version}.tgz
49 Source1: manpages.tar.gz
50 Source2: mailman-sendmail.m4
51 Source3: mailman-apache.conf
52 Source4: rc.mailman
53 Patch0: mailman.patch
55 # build information
56 BuildPreReq: OpenPKG, openpkg >= 20100101, python, make
57 PreReq: OpenPKG, openpkg >= 20100101, python, MTA
59 %description
60 Mailman is software to help manage email discussion lists, much
61 like Majordomo and Smartmail. Unlike most similar products, Mailman
62 gives each mailing list a webpage, and allows users to subscribe,
63 unsubscribe, etc. over the Web. Even the list manager can administer
64 his or her list entirely from the Web. Mailman also integrates most
65 things people want to do with mailing lists, including archiving,
66 mail/news gateways, and so on.
68 %track
69 prog mailman = {
70 version = %{version}
71 url = http://prdownloads.sourceforge.net/mailman/
72 regex = mailman-(\d+\.\d+\.\d+)\.tgz
73 }
75 %prep
76 %setup -q
77 %setup -q -D -T -a 1
78 %patch -p0
79 %{l_shtool} subst \
80 -e 's;\(OWNERS_CAN_DELETE_THEIR_OWN_LISTS\) = No.*;\1 = Yes;' \
81 Mailman/Defaults.py*
83 %build
84 # configure package
85 CC="%{l_cc}" \
86 CFLAGS="%{l_cflags -O}" \
87 CPPFLAGS="%{l_cppflags}" \
88 LDFLAGS="%{l_ldflags}" \
89 ./configure \
90 --prefix=%{l_prefix}/libexec/mailman \
91 --exec-prefix=%{l_prefix}/libexec/mailman \
92 --sysconfdir=%{l_prefix}/etc/mailman \
93 --with-var-prefix=%{l_prefix}/var/mailman \
94 --with-username=%{l_nusr} \
95 --with-groupname=%{l_ngrp} \
96 --with-cgi-gid=%{l_ngrp} \
97 --with-mail-gid=%{l_ngrp} \
98 --with-cgi-ext="" \
99 --with-urlhost="localhost" \
100 --with-mailhost="localhost" \
101 --without-permcheck \
102 --enable-static
104 # build package
105 %{l_make} %{l_mflags -O}
107 %install
108 # install package
109 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT DIRSETGID=true
111 # create additional directories
112 %{l_shtool} mkdir -f -p -m 755 \
113 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
114 $RPM_BUILD_ROOT%{l_prefix}/etc/mailman \
115 $RPM_BUILD_ROOT%{l_prefix}/man/man8
117 # strip down installation tree
118 rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/tests
120 # install Sendmail mailer handler
121 %{l_shtool} install -c -m 755 \
122 -e 's;#!/usr/local/bin/perl;#!%{l_prefix}/bin/perl;' \
123 -e 's;/home/mailman/mail/mailman;%{l_prefix}/libexec/mailman/mail/mailman;' \
124 -e 's;/home/mailman/lists;%{l_prefix}/var/mailman/lists;' \
125 -e 's;/usr/lib/sendmail;%{l_prefix}/sbin/sendmail;' \
126 contrib/mm-handler \
127 $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/mail/mailman-sendmail
129 # install Apache and Sendmail configurations
130 %{l_shtool} install -c -m 644 %{l_value -s -a} \
131 %{SOURCE mailman-sendmail.m4} %{SOURCE mailman-apache.conf} \
132 $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/
134 # install manual pages
135 %{l_shtool} install -c -m 644 \
136 man8/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
138 # post-adjust default configuration
139 mv $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py \
140 $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
141 ln -s %{l_prefix}/etc/mailman/mailman.cfg \
142 $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py
143 ( echo ""
144 echo "DEFAULT_EMAIL_HOST = 'host.example.com'"
145 echo "DEFAULT_URL_HOST = 'host.example.com'"
146 echo "IMAGE_LOGOS = '/mailman/icons/'"
147 echo "PUBLIC_ARCHIVE_URL = '/mailman/pipermail/%%(listname)s'"
148 echo "MAILMAN_USER = '%{l_nusr}'"
149 echo "MAILMAN_GROUP = '%{l_ngrp}'"
150 echo "DEFAULT_SERVER_LANGUAGE = 'en'"
151 echo "VERP_PASSWORD_REMINDERS = 1"
152 echo "VERP_PERSONALIZED_DELIVERIES = 1"
153 echo "VERP_CONFIRMATIONS = 1"
154 echo "VERP_DELIVERY_INTERVAL = 1"
155 echo ""
156 echo "# For available options and their descriptions see:"
157 echo "# %{l_prefix}/libexec/mailman/Mailman/Defaults.py"
158 echo ""
159 ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
161 # install run-command script
162 %{l_shtool} install -c -m 755 %{l_value -s -a} \
163 %{SOURCE rc.mailman} ${RPM_BUILD_ROOT}%{l_prefix}/etc/rc.d/
165 # avoid root permissions on log file creation
166 touch ${RPM_BUILD_ROOT}%{l_prefix}/var/mailman/logs/error
167 touch ${RPM_BUILD_ROOT}%{l_prefix}/var/mailman/logs/fromusenet
169 # determine installation files
170 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
171 %{l_files_std} \
172 '%dir %attr(2700,%{l_nusr},%{l_mgrp}) %{l_prefix}/libexec/mailman/mail/mailman-sendmail' \
173 '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman' \
174 '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/logs' \
175 '%dir %attr(644,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/logs/*' \
176 '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/spam' \
177 '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/qfiles' \
178 '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/locks' \
179 '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/lists' \
180 '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives' \
181 '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives/*' \
182 '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/data' \
183 '%config %attr(0640,%{l_nusr},%{l_mgrp}) %{l_prefix}/etc/mailman/mailman.cfg' \
184 '%config %{l_prefix}/etc/mailman/*'
186 %files -f files
188 %clean
190 %post
191 # add hook to MTA configuration
192 if [ $1 -eq 1 ]; then
193 aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
194 update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
195 if [ ".$aliases_file" != . ]; then
196 ( echo "mailman: postmaster"
197 echo "mailman-owner: postmaster"
198 ) |\
199 $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
200 -a -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
201 fi
202 if [ ".$update_command" != . ]; then
203 eval $update_command
204 fi
205 fi
207 # after upgrade, restart service
208 [ $1 -eq 2 ] || exit 0
209 $RPM_INSTALL_PREFIX/libexec/mailman/bin/update
210 eval `%{l_rc} mailman status 2>/dev/null`
211 [ ".$mailman_active" = .yes ] && %{l_rc} mailman restart
212 exit 0
214 %preun
215 # before erase, stop service (and remove files)
216 [ $1 -eq 0 ] || exit 0
217 rm -f $RPM_INSTALL_PREFIX/libexec/mailman/bin/paths.pyc >/dev/null 2>&1 || true
218 rm -f $RPM_INSTALL_PREFIX/libexec/mailman/cron/paths.pyc >/dev/null 2>&1 || true
219 rm -f $RPM_INSTALL_PREFIX/libexec/mailman/scripts/paths.pyc >/dev/null 2>&1 || true
220 %{l_rc} mailman stop 2>/dev/null
221 exit 0
223 %postun
224 # remove hook from MTA configuration
225 [ $1 -eq 0 ] || exit 0
226 aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
227 update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
228 if [ ".$aliases_file" != . ]; then
229 $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
230 -r -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
231 fi
232 if [ ".$update_command" != . ]; then
233 eval $update_command
234 fi