mailman/mailman.spec

371 lines
13 KiB
RPMSpec
Raw Permalink Normal View History

%define mailman_uid 64910
%define mailman_gid 64910
%define nobody_gid 65013
%define pkgver %(echo %version | tr _ -)
Name: mailman
Version: 2.1.39
Release: 2mamba
Summary: Free software for managing electronic mail discussion and e-newsletter lists
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://mailman.sourceforge.io/
Source0: http://downloads.sourceforge.net/sourceforge/mailman/mailman-%{pkgver}.tgz
Source1: %{name}-update_aliases.sh
Source2: %{name}-cron
Source3: %{name}-update_aliases_vmailmgr.sh
Source4: %{name}-apache.conf
Source5: mailman.service
Patch0: %{name}-2.1.9-fix_buildroot.patch
Patch1: %{name}-2.1.10-template_it_antispam_fix.patch
Patch2: %{name}-2.1.10-cmd_subscribe_fixsyntax.patch
Patch3: %{name}-2.1.11-use_python2.4.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
## AUTOBUILDREQ-END
BuildRequires: expect
BuildRequires: libpython27-devel
BuildRequires: python27
BuildRequires: python-dnspython-py27
Requires(pre): expect >= 8.4.5
Requires: python27 >= 2.7.18
#Requires: apache >= 2.0.45
#Requires: vixie-cron >= 3.0.1
Requires: python-dnspython-py27
Requires: mta
# FIXME: postfix integration is missing
%description
Mailman is free software for managing electronic mail discussion and e-newsletter lists.
Mailman is integrated with the web, making it easy for users to manage their accounts and for list owners to administer their lists.
Mailman supports built-in archiving, automatic bounce processing, content filtering, digest delivery, spam filters, and more.
%debug_package
%prep
%setup -q -n %{name}-%{pkgver}
#%patch0 -p1
# FIXME: the following patch disables the confirmation url link in email
# so that some smtp server filters like smpt.fastwebnet.it don't
# block the message (error "554 Message Refused")
%patch1 -p1
#%patch2 -p0
#%patch3 -p1
%build
# activate sendmail patching the handler (otherwise it won't work for
# safety reasons)
sed -i "s|assert 0|#assert 0|" Mailman/Handlers/Sendmail.py
sed -i "s|/usr/bin/env|/bin/env|" bin/msgfmt.py tests/onebounce.py
%configure \
--prefix=%{_datadir}/mailman \
--exec_prefix=%{_datadir}/mailman \
--bindir=%{_bindir} \
--with-permcheck=no \
--with-var-prefix=/var/mailman \
--with-cgi-gid=nobody \
--with-mail-gid=mailman \
--with-mailhost=localhost \
--with-urlhost=localhost \
--with-mail-uid=mailman \
--with-python=%{__python27} \
PYTHON=%{__python27}
%make
%install
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
install -d %{buildroot}/var/www/cgi-bin
%makeinstall
sed -i "s|MAILMAN_USER = ''|MAILMAN_USER = 'mailman'|
s|MAILMAN_GROUP = ''|MAILMAN_GROUP = 'mailman'|" \
%{buildroot}%{_datadir}/mailman/Mailman/Defaults.py
install -D %{buildroot}%{_datadir}/mailman/cron/crontab.in \
%{buildroot}%{_sysconfdir}/cron.d/mailman
install -D -m 0755 %{S:5} \
%{buildroot}%{_unitdir}/mailman.service
install -m 0755 %{S:1} \
%{buildroot}%{_datadir}/mailman/bin/update_aliases.sh
install -m 0755 %{S:3} \
%{buildroot}%{_datadir}/mailman/bin/update_aliases_vmailmgr.sh
install -D %{S:2} \
%{buildroot}%{_sysconfdir}/cron.daily/mailman
install -D %{S:4} \
%{buildroot}%{_sysconfdir}/httpd/httpd.d/mailman.conf
mv %{buildroot}%{_datadir}/mailman/icons %{buildroot}/var/www
%clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%pre
# new install
if [ $1 -ge 1 ]; then
groupadd -g %{nobody_gid} nobody 2>/dev/null
groupadd -g %{mailman_gid} mailman 2>/dev/null
useradd -u %{mailman_uid} -g mailman -d /dev/null mailman \
-s /bin/false 2>/dev/null
fi
:
%post
# new install
if [ $1 -eq 1 ]; then
sed -i "s|\(DEFAULT_EMAIL_HOST = \).*|\1'`hostname -f`'|
s|\(DEFAULT_URL_HOST = \).*|\1'`hostname -f`'|
s|#\(DELIVERY_MODULE = 'Sendmail'\)|\1|
s|\(DELIVERY_MODULE = 'SMTPDirect'\)|#\1|" \
%{_datadir}/mailman/Mailman/Defaults.py
[ -e /usr/sbin/postfix ] && {
# postfix configuation
postconf -e alias_database=hash:/etc/aliases,hash:/etc/aliases-mailman
%{_datadir}/mailman/bin/newlist -q \
mailman postmaster@`postconf -hv mydomain` \
`/usr/bin/mkpasswd -l 10 -s 0` &>/dev/null
echo "\
Mailman list created.
Use %{_datadir}/mailman/bin/mmsitepass to set mailman administrator password."
} || {
[ -f /etc/qmail/me ] && {
# qmail configuration
%{_datadir}/mailman/bin/newlist -q \
mailman postmaster@`cat /etc/qmail/me` \
`/usr/bin/mkpasswd -l 10 -s 0` &>/dev/null
%{_datadir}/mailman/bin/update_aliases.sh
echo "\
Mailman list created.
Use %{_datadir}/mailman/bin/mmsitepass to set mailman administrator password."
}
}
fi
%systemd_post mailman
:
%postun
# update
%systemd_postun_with_restart mailman
if [ $1 -eq 0 ]; then
[ -e /usr/sbin/postconf ] && postconf -e alias_database=hash:/etc/aliases
fi
:
%preun
# erase
%systemd_preun mailman.service
if [ $1 -eq 0 ]; then
userdel mailman 2>/dev/null
groupdel mailman 2>/dev/null
fi
:
%files
%defattr(-,root,root)
%{_sysconfdir}/cron.d/mailman
%{_sysconfdir}/cron.daily/mailman
%config(noreplace) %{_sysconfdir}/httpd/httpd.d/mailman.conf
%{_unitdir}/mailman.service
%dir %attr(2775,root,root) %{_datadir}/mailman/
%attr(2775,root,mailman) %{_datadir}/mailman/bin/*
%attr(2775,root,mailman) %{_datadir}/mailman/cgi-bin/*
%attr(2775,root,mailman) %{_datadir}/mailman/cron/*
%attr(2775,root,mailman) %{_datadir}/mailman/mail/*
%attr(2775,root,mailman) %{_datadir}/mailman/Mailman/*
%attr(2775,root,mailman) %{_datadir}/mailman/messages/*
#%attr(2775,root,mailman) %{_datadir}/mailman/pythonlib/*
%attr(2775,root,mailman) %{_datadir}/mailman/scripts/*
%attr(2775,root,mailman) %{_datadir}/mailman/templates/*
%attr(2775,root,mailman) %{_datadir}/mailman/tests/*
%config(noreplace) %{_datadir}/mailman/Mailman/Defaults.py
%config(noreplace) %{_datadir}/mailman/Mailman/mm_cfg.py
%dir %attr(2775,root,mailman) /var/mailman
%dir %attr(2770,root,mailman) /var/mailman/archives/private
%dir %attr(2775,root,mailman) /var/mailman/archives/public
%dir %attr(2775,root,mailman) /var/mailman/data
%attr(2775,root,mailman) /var/mailman/data/sitelist.cfg
%dir %attr(2775,root,mailman) /var/mailman/lists
%dir %attr(2775,root,mailman) /var/mailman/locks
%dir %attr(2775,root,mailman) /var/mailman/logs
%dir %attr(2775,root,mailman) /var/mailman/qfiles
%dir %attr(2775,root,mailman) /var/mailman/spam
/var/www/icons/*
%doc gnu-COPYING-GPL
#%doc README ACKNOWLEDGMENTS FAQ BUGS README.* TODO UPGRADING NEWS
%changelog
* Wed Sep 20 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.39-2mamba
- migrate from sysv5 to systemd service
* Wed Sep 20 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.39-1mamba
- update to 2.1.39
* Fri Jul 17 2020 Automatic Build System <autodist@mambasoft.it> 2.1.34-1mamba
- automatic version update by autodist
* Sat May 09 2020 Automatic Build System <autodist@mambasoft.it> 2.1.33-1mamba
- automatic version update by autodist
* Wed May 06 2020 Automatic Build System <autodist@mambasoft.it> 2.1.32-1mamba
- automatic version update by autodist
* Sat Apr 25 2020 Automatic Build System <autodist@mambasoft.it> 2.1.30-1mamba
- automatic version update by autodist
* Sun Aug 19 2018 Automatic Build System <autodist@mambasoft.it> 2.1.29-1mamba
- automatic version update by autodist
* Sat Feb 10 2018 Automatic Build System <autodist@mambasoft.it> 2.1.26-1mamba
- automatic version update by autodist
* Thu Dec 07 2017 Automatic Build System <autodist@mambasoft.it> 2.1.25-1mamba
- automatic update by autodist
* Sat Sep 02 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.24-2mamba
- recompile with --with-mail-gid=mailman
* Mon Aug 07 2017 Automatic Build System <autodist@mambasoft.it> 2.1.24-1mamba
- automatic version update by autodist
* Sun Aug 28 2016 Automatic Build System <autodist@mambasoft.it> 2.1.23-1mamba
- automatic version update by autodist
* Mon Apr 18 2016 Automatic Build System <autodist@mambasoft.it> 2.1.22-1mamba
- automatic version update by autodist
* Mon Feb 29 2016 Automatic Build System <autodist@mambasoft.it> 2.1.21-1mamba
- automatic version update by autodist
* Tue Mar 31 2015 Automatic Build System <autodist@mambasoft.it> 2.1.20-1mamba
- automatic update by autodist
* Sat Feb 28 2015 Automatic Build System <autodist@mambasoft.it> 2.1.19-1mamba
- automatic update by autodist
* Sat Jul 19 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.18_1-3mamba
- rebuilt with --with-mail-gid=nobody
* Fri Jul 18 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.18_1-2mamba
- provide required directory /var/mailman/locks
* Tue Jun 17 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.18_1-1mamba
- update to 2.1.18_1
* Mon Nov 25 2013 Automatic Build System <autodist@mambasoft.it> 2.1.17-1mamba
- automatic version update by autodist
* Wed Oct 30 2013 Automatic Build System <autodist@mambasoft.it> 2.1.16-1mamba
- automatic version update by autodist
* Thu May 30 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.15-3mamba
- python 2.7 rebuild
* Sat Apr 13 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.15-2mamba
- fix pidfile location in initscript for systemd to correctly detect status
* Thu Jan 03 2013 Automatic Build System <autodist@mambasoft.it> 2.1.15-1mamba
- update to 2.1.15
* Tue Sep 21 2010 Automatic Build System <autodist@mambasoft.it> 2.1.14-1mamba
- automatic update by autodist
* Thu Feb 04 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.13-1mamba
- update to 2.1.13
* Mon Mar 30 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.12-2mamba
- remove use_python2.4 patch
* Mon Mar 30 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.12-1mamba
- automatic update by autodist
* Thu Jan 08 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.11-2mamba
- update cron and update_aliases script for exiting with 0
* Fri Dec 05 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.11-1mamba
- update to 2.1.11
- added patch to force use of python 2.4 (python 2.6 not supported yet); initscript patched too
* Thu Jun 12 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.10-2mamba
- added a patch to fix a syntax error in cmd_subscribe.py
* Tue Jun 10 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.10-1mamba
- update to 2.1.10
- added anti-spam patch to workaround a problem with fastweb-it smtp server
* Fri Jan 18 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.9-7mamba
- initscript: send output to /dev/null so startup script won't hung when
used with |tee
* Sat Jun 02 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.9-6mamba
- fix various permissions
* Thu May 24 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.9-5mamba
- fix permissions on %{_datadir}/mailman directory
* Thu May 24 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.9-4mamba
- use nobody as cgi and mail gid
- patch: remove buildroot patchs in python compiled files
- set nofiles as the mail-gid
* Sun Mar 18 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.9-3qilnx
- change gid to nobody as used by postfix
- fixed general permissions
- added httpd.d configuration file
* Wed Mar 14 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.9-2qilnx
- fixed scripts for integration with postfix as well as qmail
* Mon Sep 18 2006 Davide Madrisan <davide.madrisan@qilinux.it> 2.1.9-1qilnx
- update to version 2.1.9 by autospec
- also fixes several security issues including CVE-2006-[2941,3636] (qibug#88)
* Wed Jun 28 2006 Davide Madrisan <davide.madrisan@qilinux.it> 2.1.8b1-2qilnx
- fixed creation of used mailman when qmail is not installed
- execute qmail dependent commands in the specfile scriptlets only if qmail
is installed
* Thu Apr 06 2006 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.8b1-1qilnx
- update to version 2.1.8b1 by autospec
- removed dependency on qmail
* Thu Sep 22 2005 Davide Madrisan <davide.madrisan@qilinux.it> 2.1.6-1qilnx
- update to version 2.1.6 by autospec
- also fixes the security vulnerability CVE- 2005-3573
- removed security patches (merged upstream)
- %%post script fixed
* Fri Feb 11 2005 Davide Madrisan <davide.madrisan@qilinux.it> 2.1.5-3qilnx
- security fix QSA-2005-014 (CAN-2004-1177, CAN-2005-0202)
* Wed Jun 30 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.5-2qilnx
- fixed a /usr/bin/env dependency problem
* Fri May 28 2004 Davide Madrisan <davide.madrisan@qilinux.it> 2.1.5-1qilnx
- new version rebuild
* Wed May 26 2004 Davide Madrisan <davide.madrisan@qilinux.it> 2.1.4-5qilnx
- added security patch for remote password retrieval (CAN-2004-0412)
backported from mailman 2.1.5 by Mark J Cox <mjc@redhat.com>
* Thu May 13 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.4-4qilnx
- added update_aliases_vmailmgr.sh script for virtual domain aliases creation
* Mon May 10 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.4-3qilnx
- some fixes on post script
* Mon May 03 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.4-2qilnx
- added automatic mailman list configuration
* Tue Feb 17 2004 Davide Madrisan <davide.madrisan@qilinux.it> 2.1.4-1qilnx
- new version rebuilt (security bugfixes)
* Tue Sep 16 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.2-1qilnx
- first build