|
|
@@ -0,0 +1,220 @@
|
|
|
+##
|
|
|
+## mailman.spec -- OpenPKG RPM Package Specification
|
|
|
+## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
|
|
|
+## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/>
|
|
|
+##
|
|
|
+## Permission to use, copy, modify, and distribute this software for
|
|
|
+## any purpose with or without fee is hereby granted, provided that
|
|
|
+## the above copyright notice and this permission notice appear in all
|
|
|
+## copies.
|
|
|
+##
|
|
|
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
|
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
|
|
|
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
+## SUCH DAMAGE.
|
|
|
+##
|
|
|
+
|
|
|
+# package information
|
|
|
+Name: mailman
|
|
|
+Summary: Mailing List Management System
|
|
|
+URL: http://www.list.org/
|
|
|
+Vendor: John Viega et al.
|
|
|
+Packager: OpenPKG
|
|
|
+Distribution: OpenPKG
|
|
|
+Class: JUNK
|
|
|
+Group: Network
|
|
|
+License: GPL
|
|
|
+Version: 2.1.5
|
|
|
+Release: 20050430
|
|
|
+
|
|
|
+# list of sources
|
|
|
+Source0: ftp://ftp.gnu.org/gnu/mailman/mailman-%{version}.tgz
|
|
|
+Source1: manpages.tar.gz
|
|
|
+Source3: mailman-sendmail.pl
|
|
|
+Source2: mailman-sendmail.m4
|
|
|
+Source4: mailman-apache.conf
|
|
|
+Source5: rc.mailman
|
|
|
+Patch0: mailman.patch
|
|
|
+
|
|
|
+# build information
|
|
|
+Prefix: %{l_prefix}
|
|
|
+BuildRoot: %{l_buildroot}
|
|
|
+BuildPreReq: OpenPKG, openpkg >= 20040701, python
|
|
|
+PreReq: OpenPKG, openpkg >= 20040701, python, MTA
|
|
|
+AutoReq: no
|
|
|
+AutoReqProv: no
|
|
|
+
|
|
|
+%description
|
|
|
+ Mailman is software to help manage email discussion lists, much
|
|
|
+ like Majordomo and Smartmail. Unlike most similar products, Mailman
|
|
|
+ gives each mailing list a webpage, and allows users to subscribe,
|
|
|
+ unsubscribe, etc. over the Web. Even the list manager can administer
|
|
|
+ his or her list entirely from the Web. Mailman also integrates most
|
|
|
+ things people want to do with mailing lists, including archiving,
|
|
|
+ mail/news gateways, and so on.
|
|
|
+
|
|
|
+%track
|
|
|
+ prog mailman = {
|
|
|
+ version = %{version}
|
|
|
+ url = ftp://ftp.gnu.org/gnu/mailman/
|
|
|
+ regex = mailman-(__VER__)\.tgz
|
|
|
+ }
|
|
|
+
|
|
|
+%prep
|
|
|
+ %setup -q
|
|
|
+ %setup -q -D -T -a 1
|
|
|
+ %patch -p0
|
|
|
+
|
|
|
+%build
|
|
|
+ # configure package
|
|
|
+ CC="%{l_cc}" \
|
|
|
+ CFLAGS="%{l_cflags -O}" \
|
|
|
+ CPPFLAGS="%{l_cppflags}" \
|
|
|
+ LDFLAGS="%{l_ldflags}" \
|
|
|
+ ./configure \
|
|
|
+ --prefix=%{l_prefix}/libexec/mailman \
|
|
|
+ --exec-prefix=%{l_prefix}/libexec/mailman \
|
|
|
+ --sysconfdir=%{l_prefix}/etc/mailman \
|
|
|
+ --with-var-prefix=%{l_prefix}/var/mailman \
|
|
|
+ --with-username=%{l_nusr} \
|
|
|
+ --with-groupname=%{l_mgrp} \
|
|
|
+ --with-cgi-gid=%{l_ngrp} \
|
|
|
+ --with-mail-gid=%{l_mgrp} \
|
|
|
+ --with-cgi-ext="" \
|
|
|
+ --with-urlhost="localhost" \
|
|
|
+ --with-mailhost="localhost" \
|
|
|
+ --without-permcheck \
|
|
|
+ --enable-static
|
|
|
+
|
|
|
+ # build package
|
|
|
+ %{l_make} %{l_mflags}
|
|
|
+
|
|
|
+%install
|
|
|
+ # install package
|
|
|
+ rm -rf $RPM_BUILD_ROOT
|
|
|
+ %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT DIRSETGID=true
|
|
|
+
|
|
|
+ # create additional directories
|
|
|
+ %{l_shtool} mkdir -f -p -m 755 \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/mailman \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/man/man8
|
|
|
+
|
|
|
+ # install Sendmail mailer command
|
|
|
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
|
|
|
+ %{SOURCE mailman-sendmail.pl} \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/mail/
|
|
|
+
|
|
|
+ # install icons
|
|
|
+ %{l_shtool} install -c -m 644 \
|
|
|
+ misc/PythonPowered.png misc/mailman.jpg \
|
|
|
+ misc/mm-icon.png misc/mailman-large.jpg \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/icons/
|
|
|
+
|
|
|
+ # install Apache and Sendmail configurations
|
|
|
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
+ %{SOURCE mailman-sendmail.m4} %{SOURCE mailman-apache.conf} \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/
|
|
|
+
|
|
|
+ # install manual pages
|
|
|
+ %{l_shtool} install -c -m 644 \
|
|
|
+ man8/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
|
|
|
+
|
|
|
+ # post-adjust default configuration
|
|
|
+ mv $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
|
|
|
+ ln -s %{l_prefix}/etc/mailman/mailman.cfg \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py
|
|
|
+ ( echo ""
|
|
|
+ echo "DEFAULT_EMAIL_HOST = 'host.example.com'"
|
|
|
+ echo "DEFAULT_URL_HOST = 'host.example.com'"
|
|
|
+ echo "IMAGE_LOGOS = '/mailman/icons/'"
|
|
|
+ echo "PUBLIC_ARCHIVE_URL = '/mailman/pipermail/%%(listname)s'"
|
|
|
+ echo "MAILMAN_USER = '%{l_nusr}'"
|
|
|
+ echo "MAILMAN_GROUP = '%{l_mgrp}'"
|
|
|
+ echo "DEFAULT_SERVER_LANGUAGE = 'en'"
|
|
|
+ echo ""
|
|
|
+ echo "# For available options and their descriptions see:"
|
|
|
+ echo "# %{l_prefix}/libexec/mailman/Mailman/Defaults.py"
|
|
|
+ echo ""
|
|
|
+ ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg
|
|
|
+
|
|
|
+ # install run-command script
|
|
|
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
|
|
|
+ %{SOURCE rc.mailman} ${RPM_BUILD_ROOT}%{l_prefix}/etc/rc.d/
|
|
|
+
|
|
|
+ # determine installation files
|
|
|
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
|
|
|
+ %{l_files_std} \
|
|
|
+ '%dir %attr(2700,%{l_nusr},%{l_mgrp}) %{l_prefix}/libexec/mailman/mail/mailman-sendmail.pl' \
|
|
|
+ '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman' \
|
|
|
+ '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/logs' \
|
|
|
+ '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/spam' \
|
|
|
+ '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/qfiles' \
|
|
|
+ '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/locks' \
|
|
|
+ '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/lists' \
|
|
|
+ '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives' \
|
|
|
+ '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives/*' \
|
|
|
+ '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/data' \
|
|
|
+ '%config %attr(0640,%{l_nusr},%{l_mgrp}) %{l_prefix}/etc/mailman/mailman.cfg' \
|
|
|
+ '%config %{l_prefix}/etc/mailman/*'
|
|
|
+
|
|
|
+%files -f files
|
|
|
+
|
|
|
+%clean
|
|
|
+ rm -rf $RPM_BUILD_ROOT
|
|
|
+
|
|
|
+%post
|
|
|
+ # add hook to MTA configuration
|
|
|
+ if [ $1 -eq 1 ]; then
|
|
|
+ aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_file`
|
|
|
+ update_command=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_update`
|
|
|
+ if [ ".$aliases_file" != . ]; then
|
|
|
+ ( echo "mailman: postmaster"
|
|
|
+ echo "mailman-owner: postmaster"
|
|
|
+ ) |\
|
|
|
+ $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
|
|
|
+ -a -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
|
|
|
+ fi
|
|
|
+ if [ ".$update_command" != . ]; then
|
|
|
+ eval $update_command
|
|
|
+ fi
|
|
|
+ fi
|
|
|
+
|
|
|
+ # after upgrade, restart service
|
|
|
+ [ $1 -eq 2 ] || exit 0
|
|
|
+ $RPM_INSTALL_PREFIX/libexec/mailman/bin/update
|
|
|
+ eval `%{l_rc} mailman status 2>/dev/null`
|
|
|
+ [ ".$mailman_active" = .yes ] && %{l_rc} mailman restart
|
|
|
+ exit 0
|
|
|
+
|
|
|
+%preun
|
|
|
+ # before erase, stop service (and remove files)
|
|
|
+ [ $1 -eq 0 ] || exit 0
|
|
|
+ rm -f $RPM_INSTALL_PREFIX/libexec/mailman/bin/paths.pyc >/dev/null 2>&1 || true
|
|
|
+ rm -f $RPM_INSTALL_PREFIX/libexec/mailman/cron/paths.pyc >/dev/null 2>&1 || true
|
|
|
+ rm -f $RPM_INSTALL_PREFIX/libexec/mailman/scripts/paths.pyc >/dev/null 2>&1 || true
|
|
|
+ %{l_rc} mailman stop 2>/dev/null
|
|
|
+ exit 0
|
|
|
+
|
|
|
+%postun
|
|
|
+ # remove hook from MTA configuration
|
|
|
+ [ $1 -eq 0 ] || exit 0
|
|
|
+ aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_file`
|
|
|
+ update_command=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_update`
|
|
|
+ if [ ".$aliases_file" != . ]; then
|
|
|
+ $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
|
|
|
+ -r -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file
|
|
|
+ fi
|
|
|
+ if [ ".$update_command" != . ]; then
|
|
|
+ eval $update_command
|
|
|
+ fi
|
|
|
+
|