%define name mailman %define version 2.1.3 %define release 20mdk %define webroot %{_var}/www %define webconf %{_sysconfdir}/httpd/conf.d %define order 40 Summary: The GNU Mailing List Management System Name: %{name} Version: %{version} Release: %{release} Group: System/Servers License: GPL URL: http://www.list.org/ Source0: ftp://ftp.gnu.org/gnu/mailman/%{name}-%{version}.tar.bz2 Source1: %{name}-apache-conf.bz2 Patch0: %{name}-buildroot-check.patch.bz2 Patch4: %{name}-2.1.1-init.patch.bz2 Patch5: %{name}-2.1.3-indexing.patch.bz2 Patch6: %{name}-2.1.3-htdig.patch.bz2 Patch7: %{name}-2.1.3-modinc.patch.bz2 Patch8: %{name}-2.1.3-grpsec.patch.bz2 Patch9: %{name}-2.1.3-mhonarc.patch.bz2 BuildRoot: %{_tmppath}/%{name}-buildroot BuildRequires: apache-common BuildRequires: python BuildRequires: libpython-devel Prereq: python >= 1.5.2 Prereq: rpm-helper Requires: apache Requires: smtpdaemon %description Mailman -- The GNU Mailing List Management System -- is a mailing list management system written mostly in Python. Features: o Most standard mailing list features, including: moderation, mail based commands, digests, etc... o An extensive Web interface, customizable on a per-list basis. o Web based list administration interface for *all* admin-type tasks o Automatic Web based hypermail-style archives (using pipermail or other external archiver), including provisions for private archives o Integrated mail list to newsgroup gatewaying o Integrated newsgroup to mail list gatewaying (polling-based... if you have access to the nntp server, you should be able to easily do non-polling based news->mail list gatewaying; email viega@list.org, I'd like to help get that going and come up with instructions) o Smart bounce detection and correction o Integrated fast bulk mailing o Smart spam protection o Extensible logging o Multiple list owners and moderators are possible o Optional MIME-compliant digests o Nice about which machine you subscribed from if you're from the right domain %prep %setup -q bzcat %{SOURCE1} > %{name}.conf %patch0 -p1 -b .buildroot %patch4 -p1 -b .init %patch5 -p1 -b .buildroot %patch6 -p1 -b .buildroot %patch7 -p1 -b .buildroot %patch8 -p1 -b .buildroot %patch9 -p1 -b .buildroot %build #mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name} # As a normal user, we don't have permissions to do this. %patch0 changes # configure so that the directory check will never fail. #chown %{username}.%{groupname} $RPM_BUILD_ROOT%{_libdir}/%{name} #chmod 02775 $RPM_BUILD_ROOT%{_libdir}/%{name} ./configure \ --prefix=%{_libdir}/%{name} \ --with-var-prefix=%{_localstatedir}/%{name} \ --with-mail-gid=mail \ --with-cgi-gid=apache \ --with-username=mail \ --with-groupname=mail %make %install rm -rf $RPM_BUILD_ROOT %makeinstall_std install -d -m 755 $RPM_BUILD_ROOT%{webroot}/icons cp misc/mailman.jpg $RPM_BUILD_ROOT%{webroot}/icons/ cp misc/PythonPowered.png $RPM_BUILD_ROOT%{webroot}/icons/ cp misc/gnu-head-tiny.jpg $RPM_BUILD_ROOT%{webroot}/icons/ # (sb) apache2 install -d -m 755 $RPM_BUILD_ROOT%{webconf} install -m 644 %{name}.conf $RPM_BUILD_ROOT%{webconf}/%{order}_%{name}.conf # init script install -d -m 755 $RPM_BUILD_ROOT%{_initrddir} install -m 755 misc/mailman $RPM_BUILD_ROOT%{_initrddir} # (sb) sendmail mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/smrsh ln -sf %{_libdir}/%{name}/mail/%{name} $RPM_BUILD_ROOT%{_sysconfdir}/smrsh/mailman # (sb) grsecure kernel install contrib/check_perms_grsecurity.py $RPM_BUILD_ROOT%{_libdir}/%{name}/bin perl -pi -e "s|#! \@PYTHON\@|#!/usr/bin/python|" $RPM_BUILD_ROOT%{_libdir}/%{name}/bin/check_perms_grsecurity.py # Generate a list of all files but mm_cfg.py in {prefix}/Mailman/ to be # used in files section below (mm_cfg.py is a configuration file) find $RPM_BUILD_ROOT%{_libdir}/%{name}/Mailman -name *.py >Mailman.list perl -pi -e "s|^$RPM_BUILD_ROOT||g;" Mailman.list perl -pi -e "s|^%{_libdir}/%{name}/Mailman/mm_cfg.py||g;" Mailman.list echo "%config(noreplace) %{_libdir}/%{name}/Mailman/mm_cfg.py" >> Mailman.list # cleanup rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/Mailman/mm_cfg.py.dist # (sb) unpackaged, compiled files that we recompile at install anyway find $RPM_BUILD_ROOT -name '*.pyc' | xargs rm -f # (fl) fix executable without magic interpreter line echo "#!/usr/bin/env python" > $RPM_BUILD_ROOT%{_libdir}/%{name}/tests/fblast.py.new cat $RPM_BUILD_ROOT%{_libdir}/%{name}/tests/fblast.py >> $RPM_BUILD_ROOT%{_libdir}/%{name}/tests/fblast.py.new mv -f $RPM_BUILD_ROOT%{_libdir}/%{name}/tests/fblast.py.new $RPM_BUILD_ROOT%{_libdir}/%{name}/tests/fblast.py %post %_post_service %{name} # we have to do the compilation post install otherwise buildroot is always # embedded in the binaries echo "Post-install compilation..." %{_bindir}/python -c 'from compileall import *; compile_dir("%{_libdir}/%{name}/Mailman")' >/dev/null cd %{_libdir}/%{name} if [ $1 = 1 ]; then # installation # generic tasks # mailman basic configuration cat >>Mailman/mm_cfg.py <>Mailman/mm_cfg.py <> %{_sysconfdir}/aliases echo '# Added by the %{name} rpm' >> %{_sysconfdir}/aliases echo 'mailman: root' >> %{_sysconfdir}/aliases echo 'mailman-owner: mailman' >> %{_sysconfdir}/aliases newaliases fi if [ `grep -c '^O DefaultUser=mail:mail' /etc/mail/sendmail.cf` != 0 ]; then echo '' echo '*****' echo "/etc/mail/sendmail.cf user appears to be set to mail:mail" echo "You may want to change this to nobody:nogroup" echo "for mailman to be able to work with sendmail" echo '*****' fi fi # check kernel secure if [ `uname -r | grep -c secure` != 0 ]; then echo '' echo '*****' cd %{_libdir}/%{name}/bin echo 'Running kernel-secure, executing' echo '%{_libdir}/%{name}/bin/check_perms_grsecurity.py' echo 'for proper mailman functionality' echo '*****' ./check_perms -f ./check_perms_grsecurity.py -f fi echo '' echo '*****' echo '* You must now "cd %{_libdir}/%{name}/" and run "bin/mmsitepass" as root to set the' echo '* site password to be used for administrating all Mailman data as necessary.' echo '*****' echo '' echo '*****' echo '* You must also "cd %{_libdir}/%{name}/" and run "bin/newlist mailman" as root to' echo '* setup the base mailman maillist - answer the questions appropriately.' echo '*****' echo '' else # upgrade bin/update | tee ./updates.log > /dev/null fi %preun %_preun_service %{name} if [ $1 = 0 ]; then # since we compile pyc files during %post, we need to remove them here on uninstall find %{_libdir}/%{name}/Mailman -name *.pyc -exec rm -f {} \; find %{_libdir}/%{name}/pythonlib -name *.pyc -exec rm -f {} \; rm -f %{_libdir}/%{name}/{bin,cron}/paths.pyc fi %postun if [ $1 = 0 ]; then # generic tasks # remove cron task crontab -u mail -r # restart web server /sbin/service httpd graceful # check mta mta="`readlink /etc/alternatives/mta 2>/dev/null | cut -d . -f 2`" # mta specific tasks if [ "$mta" == "postfix" ]; then postconf -e 'alias_maps = '`/usr/sbin/postconf -h alias_maps | sed -e 's|, hash:%{_localstatedir}/%{name}/data/aliases||'` fi if [ "$mta" == "sendmail" ]; then if [ `grep -c mailman %{_sysconfdir}/aliases` != 0 ]; then perl -pi -e "s|# Added by the %{name} rpm\n||g;" %{_sysconfdir}/aliases perl -pi -e "s|mailman: root\n||g;" %{_sysconfdir}/aliases perl -pi -e "s|mailman-owner: mailman\n||g;" %{_sysconfdir}/aliases newaliases fi fi fi %clean rm -rf $RPM_BUILD_ROOT %files -f Mailman.list %defattr(-,mail,mail) %attr(-,root,root) %doc ACKNOWLEDGMENTS BUGS FAQ INSTALL NEWS README TODO UPGRADING %attr(-,root,root) %doc README.* %attr(-,root,root) %doc gnu-COPYING-GPL contrib/README.check_perms_grsecurity %dir %{_libdir}/%{name} %{_libdir}/%{name}/bin %{_libdir}/%{name}/cgi-bin %{_libdir}/%{name}/cron %{_libdir}/%{name}/icons %{_libdir}/%{name}/mail %{_libdir}/%{name}/pythonlib %{_libdir}/%{name}/scripts %{_libdir}/%{name}/tests # localised files %dir %{_libdir}/%{name}/messages %lang(cs) %{_libdir}/%{name}/messages/cs %lang(de) %{_libdir}/%{name}/messages/da %lang(de) %{_libdir}/%{name}/messages/de %lang(es) %{_libdir}/%{name}/messages/es %lang(et) %{_libdir}/%{name}/messages/et %lang(de) %{_libdir}/%{name}/messages/eu %lang(fi) %{_libdir}/%{name}/messages/fi %lang(fr) %{_libdir}/%{name}/messages/fr %lang(hu) %{_libdir}/%{name}/messages/hu %lang(it) %{_libdir}/%{name}/messages/it %lang(ja) %{_libdir}/%{name}/messages/ja %lang(ko) %{_libdir}/%{name}/messages/ko %lang(lt) %{_libdir}/%{name}/messages/lt %lang(nl) %{_libdir}/%{name}/messages/nl %lang(no) %{_libdir}/%{name}/messages/no %lang(pl) %{_libdir}/%{name}/messages/pl %lang(pt) %{_libdir}/%{name}/messages/pt %lang(pt_BR) %{_libdir}/%{name}/messages/pt_BR %lang(ru) %{_libdir}/%{name}/messages/ru %lang(de) %{_libdir}/%{name}/messages/sr %lang(sv) %{_libdir}/%{name}/messages/sv %lang(de) %{_libdir}/%{name}/messages/uk %dir %{_libdir}/%{name}/templates %lang(big5) %{_libdir}/%{name}/templates/big5 %lang(cs) %{_libdir}/%{name}/templates/cs %lang(de) %{_libdir}/%{name}/templates/de %lang(en) %{_libdir}/%{name}/templates/en %lang(es) %{_libdir}/%{name}/templates/es %lang(et) %{_libdir}/%{name}/templates/et %lang(de) %{_libdir}/%{name}/templates/eu %lang(fi) %{_libdir}/%{name}/templates/fi %lang(fr) %{_libdir}/%{name}/templates/fr %lang(gb) %{_libdir}/%{name}/templates/gb %lang(hu) %{_libdir}/%{name}/templates/hu %lang(it) %{_libdir}/%{name}/templates/it %lang(ja) %{_libdir}/%{name}/templates/ja %lang(ko) %{_libdir}/%{name}/templates/ko %lang(lt) %{_libdir}/%{name}/templates/lt %lang(nl) %{_libdir}/%{name}/templates/nl %lang(no) %{_libdir}/%{name}/templates/no %lang(pl) %{_libdir}/%{name}/templates/pl %lang(pt) %{_libdir}/%{name}/templates/pt %lang(pt_BR) %{_libdir}/%{name}/templates/pt_BR %lang(ru) %{_libdir}/%{name}/templates/sr %lang(de) %{_libdir}/%{name}/templates/ru %lang(sv) %{_libdir}/%{name}/templates/sv %lang(de) %{_libdir}/%{name}/templates/uk %{_localstatedir}/%{name} %attr(-,root,root) %{webroot}/icons/* %attr(-,root,root) %config(noreplace) %{webconf}/%{order}_%{name}.conf %attr(-,root,root) %config(noreplace) %{_initrddir}/mailman %{_sysconfdir}/smrsh/%{name} %changelog * Sat Oct 11 2003 Jim Drash 2.1.3-0.1-1mdk - Used the patched sources from http://www.openinfo.co.uk to integrate - htdig and MHonarc * Tue Sep 30 2003 Jim Drash 2.1.3-1mdk - upgraded to version 2.1.3 - mail-gid=mail * Mon Sep 15 2003 Guillaume Rousse 2.1.2-9mdk - more postfix fixing (/me sux) * Sat Sep 13 2003 Guillaume Rousse 2.1.2-8mdk - fixed postfix post/postun scripts * Mon Sep 08 2003 Guillaume Rousse 2.1.2-7mdk - fix my previous fix for postfix, it really needs 'nogroup' for gid - more patching for exotic encoding in attachements - added back missing localised files - constant files under %{_libdir}/%{name}, variable files under %{_localstatedir}/%{name} - better mta integration at %post - turned webserver requires to apache, as we use apache specific macros and configuration - additional files as sources, not patches * Tue Aug 12 2003 Per Øyvind Karlsen 2.1.2-6mdk - rebuild for new python - use %%makeinstall_std macro - prereq on rpm-helper * Sun Jul 20 2003 Guillaume Rousse 2.1.2-5mdk - applied i18n attachment description in archive patch (http://sourceforge.net/tracker/?func=detail&aid=670167&group_id=103&atid=300103) * Fri Jul 4 2003 Frederic Lepied 2.1.2-4mdk - fixed forgotten mm_cfg.py file in previous change * Sun Jun 29 2003 Guillaume Rousse 2.1.2-3mdk - fixed configure script to work with postfix flawlessy - remove apache1 integration - spec file cleanup - added missing doc files - used %%_post_service and %%_preun_service macros - %file section cleanup * Tue May 27 2003 Stew Benedict 2.1.2-2mdk - add README, python script for grsecure kernel operation - add %%post script to enable if secure kernel detected - change MAILHOST, WWWHOST from shell vars to config options - add warning about sendmail DefaultUser setting - add mailman symlink in /etc/smrsh * Fri May 16 2003 Stew Benedict 2.1.2-1mdk - 2.1.2 * Mon Apr 28 2003 Stew Benedict 2.1.1-2mdk - BuildRequires, distriblint * Mon Apr 14 2003 Stew Benedict 2.1.1-1mdk - 2.1.1, rework patch0, patch3 - drop patch2, conf file for apache/apache2 setup - chkconfig setup, add patch4, sendmail support for aliases * Fri Nov 29 2002 Vincent Danen 2.0.13-3mdk - P3 to use DESTDIR instead of passing %$RPM_BUILD_ROOT to prefix/var_prefix - compile Mailman python modules in %%post; this seems to be the only way we can strip the buildroot out of the compiled pyc files - force removal of *.pyc files in %%preun if we are removing the package (can't be in %%postun or rpm leaves empty directories behind) - cleanup file list - change location of file list (not in buildroot) - remove unpackaged files (grrr) * Tue Sep 17 2002 Frederic Lepied 2.0.13-2mdk - fixed apache config (patch1) - use a group name instead of an id in cgi-wrapper.c (patch2) * Fri Aug 23 2002 Vincent Danen 2.0.13-1mdk - 2.0.13 * Tue Jul 16 2002 Vincent Danen 2.0.12-1mdk - 2.0.12 (more cross-site scripting vulnerabilities) * Thu May 23 2002 Yves Duret 2.0.11-1mdk - version 2.0.11 (fix cross-site vulnerabilites). * Tue Apr 30 2002 Yves Duret 2.0.10-1mdk - version 2.0.10 (mainly security updates). * Tue Apr 30 2002 Yves Duret 2.0.7-2mdk - use gid nogroup instead of depreciated nobody mailman should now works again. * Thu Nov 15 2001 Lenny Cartier 2.0.7-1mdk - 2.0.7 * Mon Sep 12 2001 Lenny Cartier 2.0.6-1mdk - updated by Paul Cox : - 2.0.6 (finally!) - More secure apache config (in mailman.conf), just in case of insane global settings. * Fri Jun 01 2001 Paul Cox 2.0.5-3mdk - Moved Mailman to /var/lib/mailman to be more compliant with FHS. (See archive of mdk-admin at http://freezer-burn.org/archives/mdk-admin/ if you have questions about this.) - Changed --with-mail-gid and --with-cgi-gid to user names instead of user numbers in case they ever change. - Changed --with-mail-gid=nobody as that's how Postfix is setup by default (see default_privs in Postfix's main.cf). - Fixed upgrades (will not overwrite config files, etc.), and tweaked files section (added a 'BuildRequires: perl' as a result). - Made sure that bin/update runs in order to update any existing lists. - Fixed permissions. Mailman will try to fix its permissions on install. - Added mailman.conf for apache configuration (included into httpd.conf). - Install will now attempt to add the required aliases (Postfix only). - Removed mailman user addition (Mailman requires that whatever user and group is passed to the configure script to be the userid and groupid, so since we did --with-username=mail and --with-groupname=mail (so that we don't have to be root to build), creating a mailman user was not necessary). - Fixed crontab.in import. Not in the right format to be simply put in /etc/cron.d, so we have to use crontab to import it (as user mail). - Removed obsolete LEIAME patch. - Changed URL back to the much nicer www.list.org mirror. - Lots and lots of macroization and countless other .spec file changes. * Wed May 16 2001 Vincent Danen 2.0.5-2mdk - apache runs as gid 48 now, so change --with-cgi-gid from 99 to 48 * Tue May 8 2001 Guillaume Cottenceau 2.0.5-1mdk - version 2.0.5 * Tue Mar 06 2001 Lenny Cartier 2.0.2-1mdk - updated to 2.0.2 * Fri Jan 19 2001 Vincent Danen 2.0.1-1mdk - 2.0.1 - fix url - move /home/httpd to /var/www * Mon Dec 11 2000 Lenny Cartier 2.0-1mdk - change user - used srpm from Stefane Fermigier * Mon Jun 05 2000 Andreas Hasenack - now requires smtpdaemon instead of sendmail * Fri May 26 2000 Eliphas Levy Theodoro - added macros and removed warning-things for the testing environment - added patch to configure so now he don't complain with maildir directory - changed attribute of maildir directory to 02775 in %files * Thu May 25 2000 Gustavo Niemeyer - Updated to 2.0beta2 - Updated images * Mon May 15 2000 Elvis Pfützenreuter - using stackguard compiler - allows non-root compilation * Wed Sep 15 1999 Rudá Moura - First build for Conectiva - Adopted by Conectiva Linux