%define name sympa %define version 4.1.5 %define release 1mdk %define mod_conf 93_sympa.conf %define lib_s %{_libdir}/sympa %define data_s %{_datadir}/sympa %define conf_s %{_sysconfdir}/sympa %define home_s %{_localstatedir}/sympa %define spool_s /var/spool/sympa %define log_s /var/log/sympa # ugly... %define exceptions perl(\\(Archive\\|Commands\\|Conf\\|Language\\|Ldap\\|List\\|Log\\|Marc.*\\|Message\\|SympaTransport\\|Version\\|X509\\|cookielib\\|mail\\|smtp\\|wwslib\\|.*\.pl\\)) %define _provides_exceptions %{exceptions} %define _requires_exceptions %{exceptions} Summary: SYMPA is an electronic mailing list manager Name: %{name} Version: %{version} Release: %{release} License: GPL Group: System/Servers Source0: %{name}-%{version}.tar.bz2 Source1: %{name}.logrotate.bz2 Source2: %{mod_conf}.bz2 Source3: README.urpmi.bz2 #Patch0: sympa-3.2.1-gprintify.patch.bz2 URL: http://www.sympa.org/ Requires: openssl >= 0.9.5a Requires: MHonArc >= 2.4.5 Requires: perl-MailTools Requires: smtpdaemon Requires: apache2 Requires: apache2-mod_fastcgi Requires: perl-CGI-Fast Requires: perl-Crypt-CipherSaber PreReq: rpm-helper BuildRequires: openssl-devel >= 0.9.5a BuildRequires: perl-MailTools BuildRequires: file BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot %description SYMPA is an electronic mailing list manager. It is used to automate list management functions such as subscription, moderation and management of archives. SYMPA also manages sending of messages to the lists, and makes it possible to reduce the load on the system. Provided that you have enough memory on your system, Sympa is especially well adapted for big lists. For a list with 20 000 subscribers, it takes 5 minutes to send a message to 90% of subscribers, of course considering that the network is available. Documentation is available under HTML and SGML (source) formats. %prep %setup -q #%patch0 -p1 -b .gprintify bzcat %{SOURCE1} > %{name}.logrotate bzcat %{SOURCE3} > README.urpmi perl -pi -e 's/^\\r sympa//' src/etc/script/create_db.mysql # strip away annoying ^M find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//' find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//' %build %serverbuild ./configure \ --prefix=%{home_s} \ --with-mandir=%{_mandir} \ --with-confdir=%{conf_s} \ --with-etcdir=%{conf_s} \ --with-cgidir=%{_var}/www/fcgi-bin \ --with-iconsdir=%{_var}/www/icons/sympa \ --with-bindir=%{lib_s}/bin \ --with-sbindir=%{lib_s}/bin \ --with-libexecdir=%{lib_s}/bin \ --with-libdir=%{lib_s}/lib \ --with-datadir=%{data_s} \ --with-expldir=%{home_s}/expl \ --with-piddir=/var/run/sympa \ --with-nlsdir=%{lib_s}/nls \ --with-scriptdir=%{data_s}/examples/script \ --with-sampledir=%{data_s}/examples/sample \ --with-spooldir=%{spool_s} \ --with-sendmail_aliases=/etc/aliases \ --with-initdir=%{_initrddir} %make sources %install rm -rf $RPM_BUILD_ROOT # Fix owner/group in filelist for i in src/Makefile wwsympa/Makefile Makefile soap/Makefile src/etc/sample/Makefile; do perl -pi -e "s|chown|/bin/true|" $i perl -pi -e "s|chgrp|/bin/true|" $i done # Actually chmod the files but not the directory! perl -pi -e "s|chmod -R 644(.+wws_templates)|chmod 644 \1/*|" ./wwsympa/Makefile %makeinstall_std # Fix permissions chmod 0644 $RPM_BUILD_ROOT%{_mandir}/man8/*.8 chmod 0644 $RPM_BUILD_ROOT%{data_s}/ca-bundle.crt chmod 0644 $RPM_BUILD_ROOT%{data_s}/mhonarc-ressources # Remove docs in bad directory rm -rf $RPM_BUILD_ROOT%{lib_s}/doc cp -a doc/html doc/sympa # Create bounce and archive incoming directories for dir in bounce arc; do mkdir -p $RPM_BUILD_ROOT%{spool_s}/$dir done # Create bounce and archive storage directories for dir in bounce arc; do mkdir -p $RPM_BUILD_ROOT%{home_s}/$dir done # Create PID directory mkdir -p $RPM_BUILD_ROOT/var/run/sympa # Populate config directory #for dir in create_list_templates scenari wws_templates templates; do # mkdir -p $RPM_BUILD_ROOT%{conf_s}/$dir #done cat >> $RPM_BUILD_ROOT%{conf_s}/sympa.conf <<EOF ## Temporary directory tmpdir %{spool_s} EOF # Dispatch config samples and fix permissions mkdir -p $RPM_BUILD_ROOT%{data_s}/examples/config mv $RPM_BUILD_ROOT%{data_s}/examples/sample/{,ww}sympa.conf \ $RPM_BUILD_ROOT%{data_s}/examples/config/ chmod 0644 $RPM_BUILD_ROOT%{data_s}/examples/config/*.conf # Move DB scripts to examples/db mkdir -p $RPM_BUILD_ROOT%{data_s}/examples/db mv $RPM_BUILD_ROOT%{data_s}/examples/script/create_db.* \ $RPM_BUILD_ROOT%{data_s}/examples/db/ # log directory mkdir -p $RPM_BUILD_ROOT/%{log_s} # logrotate mkdir $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d install -m 644 %{name}.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} # Apache configuration for wws install -d %{buildroot}%{_sysconfdir}/httpd/conf.d bzcat %{SOURCE2} > %{buildroot}%{_sysconfdir}/httpd/conf.d/%{mod_conf} %pre %_pre_useradd sympa %{home_s} /bin/false # Add "apache" in group "sympa" so that it could access # /etc/sympa/wwsympa.conf and therefore a working wwsympa ;-) groups=`groups apache | cut -d " " -f 4- | tr ' ' ,` if [ -n "$groups" ]; then groups="$groups,sympa" else groups="sympa"; fi usermod -G $groups apache %post %_post_service sympa if [ $1 = 1 ]; then # installation # Setup log facility for Sympa cntlog=0 while [ `grep -c local${cntlog} /etc/syslog.conf` -gt 0 ];do cntlog=$((cntlog+1));done if [ ${cntlog} -le 9 ];then # syslog configuration cat >> %{_sysconfdir}/syslog.conf <<EOF # added by %{name}-%{version} rpm $(date) local${cntlog}.* -%{log_s}/sympa.log EOF /sbin/service syslog reload # sympa configuration perl -pi -e "s|syslog(\s+)LOCAL[0-9]+|syslog\1LOCAL${cntlog}.*|" %{conf_s}/sympa.conf fi # create log file # %create_ghostfile /var/log/sympa sympa sympa 640 # create directory and log file %create_ghostfile %{log_s}/sympa.log sympa sympa 640 # Try to add some sample entries in /etc/aliases for sympa cat >> %{_sysconfdir}/aliases <<EOF # added by %{name}-%{version} rpm $(date) listmaster: "|%{lib_s}/bin/queue listmaster" sympa: "|%{lib_s}/bin/queue sympa" bounce+*: "|%{lib_s}/bin/bouncequeue sympa" sympa-request: listmaster@${HOSTNAME} sympa-owner: listmaster@${HOSTNAME} EOF /usr/bin/newaliases # Eventually, add queue to sendmail security shell if [ -d /etc/smrsh ]; then if [ ! -e /etc/smrsh/queue ]; then ln -s %{home_s}/bin/queue /etc/smrsh/queue fi fi # hostname configuration perl -pi -e "s|MY_HOST|$ENV{HOSTNAME}|g" %{conf_s}/*.conf fi if [ -e %{_sbindir}/ADVXctl ]; then %{_sbindir}/ADVXctl update;fi %preun %_preun_service sympa if [ $1 = 0 ]; then # uninstallation # clean syslog sed -i \ -e '/^# added by %{name}/d' \ -e '/^local[0-9] \/var\/log\/%{name}$/d' \ %{_sysconfdir}/syslog.conf /sbin/service syslog reload # clean aliases sed -i \ -e '/^# added by %{name}/d' \ -e '/^listmaster:/d' \ -e '/^sympa:/d' \ -e '/^bounce+\*:/d' \ -e '/^sympa-request:/d' \ -e '/^sympa-owner:/d' \ %{_sysconfdir}/aliases /usr/bin/newaliases if [ $1 = 0 -a -d /etc/smrsh ]; then if [ -L /etc/smrsh/queue ]; then rm -f /etc/smrsh/queue fi fi fi %postun %_postun_userdel sympa %files %defattr(-,sympa,sympa) # Home directory %{home_s} # Spools %{spool_s} # PID directory /var/run/sympa # Config files %dir %{conf_s} %config(noreplace) %{conf_s}/sympa.conf %config(noreplace) %{conf_s}/wwsympa.conf # Config directories populated by the user %{conf_s}/create_list_templates %{conf_s}/scenari %{conf_s}/templates %{conf_s}/wws_templates %defattr(-,root,root) # Init scripts %config(noreplace) %{_initrddir}/%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} # Binaries %dir %{lib_s} %dir %{lib_s}/bin %attr(-,sympa,sympa) %{lib_s}/bin/queue %attr(-,sympa,sympa) %{lib_s}/bin/bouncequeue %{lib_s}/bin/*.pl %{lib_s}/bin/aliaswrapper %{lib_s}/bin/virtualwrapper %{lib_s}/lib # Locales %{lib_s}/nls # Data %{data_s} # Logs %dir %{log_s} # Icons and binaries for Apache %{_var}/www/fcgi-bin/wwsympa.fcgi %attr(-,sympa,sympa) %{_var}/www/fcgi-bin/sympa_soap_server.fcgi %{_var}/www/icons/sympa # Documentation %doc COPYING README NEWS KNOWNBUGS %doc doc/sympa doc/sympa.ps %{_mandir}/man8/* %doc README.urpmi %config(noreplace) %{_sysconfdir}/httpd/conf.d/* %clean rm -rf $RPM_BUILD_ROOT %changelog * Thu Feb 26 2005 Anne Nicolas <anicolas@mandrakesoft.com> 4.1.5-1mdk - new version * Fri Feb 18 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 4.1.4-2mdk - spec file cleanups, remove the ADVX-build stuff - strip away annoying ^M * Thu Feb 10 2005 Anne Nicolas <anne@mandrakesoft.com> 4.1.4-1mdk - new version because of bug in web interface * Tue Feb 08 2005 Anne Nicolas <anne@mandrakesoft.com> 4.1.3-1mdk - new version (last one for this branch) * Mon Nov 1 2004 Michael Scherer <misc@mandrake.org> 4.1.2-5mdk - Buildrequires perl-MailTools * Fri Oct 22 2004 Anne Nicolas <anne@mandrake.org> 4.1.2-4mdk - use README.urpmi feature (thanks to rgs and misc) * Fri Oct 22 2004 Anne Nicolas <anne@mandrake.org> 4.1.2-3mdk - fix bug in mysql database creation script - add comment about database creation at the end of install * Wed Aug 04 2004 Anne Nicolas <anne@mandrake.org> 4.1.2-2mdk - create sympa directory in /var/log for sympa's logs - modify syslog : log all priorities in /var/log/sympa/sympa.log * Wed Jul 07 2004 Anne Nicolas <anne@mandrake.org> 4.1.2-1mdk - add apache configuration for wws - remove patch for init file - new version * Fri Apr 23 2004 Anne Nicolas <anne@mandrake.org> 4.1.1-3mdk - add SympaTransport exception - add require perl-MailTools * Thu Apr 22 2004 Olivier Blin <blino@mandrake.org> 4.1.1-2mdk - merge changelog from the real 3.4.4.3-4mdk release to let the package be uploaded again (after a three months break) * Wed Apr 21 2004 Guillaume Rousse <guillomovitch@mandrake.org> 4.1.1-1mdk - new version, by popular demand (you know who you are) - no more explicit perl dependencies, let spec-helper do its job * Wed Apr 07 2004 Guillaume Rousse <guillomovitch@mandrake.org> 3.4.4.3-5mdk - fixed multiple groups handling when adding sympa to apache group (Francis Muguet <muguet@ensta.fr>) - requires mod_fastcgi and install cgi in correct dir (Guillaume Sauvenay <sauvenay@ccr.jussieu.fr>) - user rpm-helper facility to create empty files * Tue Feb 24 2004 Guillaume Rousse <guillomovitch@mandrake.org> 3.4.4.3-4.5mdk - more requires/buildrequires fixes - less directive logrotate configuration - buffered logging - ADVX macros - various fixes from Guillaume Sauvenay <sauvenay@ccr.jussieu.fr>: - aliases path - archive and bounce directories path - missing files * Mon Jan 12 2004 Guillaume Rousse <guillomovitch@mandrake.org> 3.4.4.3-4mdk - more requires/buildrequires fixes - less directive logrotate configuration * Mon Dec 15 2003 Guillaume Rousse <guillomovitch@mandrake.org> 3.4.4.3-3mdk - added *.pl files to provides/requires exceptions - better installation/uninstallation scripts - requires smtpdaemon, not MailTransportAgent - requires perl-CGI-Fast - logrotate config file - do not localise language files, otherwise rpm will filter them at install * Sat Dec 13 2003 Guillaume Rousse <guillomovitch@mandrake.org> 3.4.4.3-2mdk - move perl modules in %{lib_s}/lib - prevent them being listed as perl provides/requires (thanks gc) * Fri Dec 12 2003 Guillaume Rousse <guillomovitch@mandrake.org> 3.4.4.3-1mdk - new version - manage file perm and ownership in %%instal, not in %%post - sanitized file list - localized language files - more macros - prereq spec-helper, not {user,group}add - removed perl requires * Tue May 20 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 3.4.4.1-1mdk - 3.4.4.1 * Thu Aug 15 2002 Pixel <pixel@mandrakesoft.com> 3.2.1-5mdk - rebuild for perl 5.8.0 * Sun Feb 24 2002 Frederic Lepied <flepied@mandrakesoft.com> 3.2.1-4mdk - corrected init script to be grpintify compliant * Mon Nov 26 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 3.2.1-3mdk - Add apache in group sympa so that wwsympa could work * Sun Sep 16 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 3.2.1-2mdk - Get rid of /usr/sbin/usermod * Mon Sep 10 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 3.2.1-1mdk - Rework Patch0 to propagate ICONSDIR and substitute wwsympa.conf - Major cleanups based on guidance from Server team and Debian package: - sympa.conf: move to the dedicated dir /etc/sympa - sympa.conf: set pid file to /var/run/sympa/sympa.pid - wwsympa.conf: move to the dedicated dir /etc/sympa - wwsympa.conf: arc_path is now /var/spool/sympa/wwsarchive - wwsympa.conf: bounce_path is now /var/spool/sympa/wwsbounce - mailing-list descriptions still go to %{_localstatedir}/sympa/expl - Changes from François: - Updated to 3.2.1. - Created Patch1 to use Digest::MD5 instead of MD5 module. * Tue Aug 28 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 3.0.3-2mdk - Rebuild for correct dependencies * Fri Apr 13 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 3.0.3-1mdk - updated to stable version 3.0.3 - sanitized specfile (s/Copyright/License, server macros, Requires, etc.) - sanitized build process: DESTDIR is set to %{home_s} - added directory in sympa home for pids - added missing variables when generating config files (patch0) - fixed file to chown (wwsympa.conf) in %%post section - fixed syslog variable in /etc/[ww]sympa.conf - removed patch1: log_socket_type=inet, openssl path are set correctly - removed patch2: use_fast_cgi=0, no html archives (mhonarc path unset) * Wed Oct 11 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 2.7.3-7mdk - Make something smarter than exit 1 when doing an upgrade and moving the sympa files. * Fri Oct 6 2000 Denis Havlik <denis@mandrakesoft.com> 2.7.3-6mdk - changed home-dir to /var/lib/sympa, fixed config. files - fixed licence (GPL now) * Wed Aug 30 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.7.3-5mdk - requires apache because of wwsympa. - buildrequires apache to fix building for machines without apache (sic). * Fri Aug 18 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.7.3-4mdk - rebuild to enable openssl. - add requires and buildrequires for {openssl,openssl-devel} - copy the wwsympa configuration file on postun if none is present in /etc. * Thu Aug 17 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.7.3-3mdk - rebuild to fix some more annoying bugs. * Mon Aug 14 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.7.3-2mdk - rebuild for sympa disaster * Tue Aug 01 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.7.3-1mdk - big shiny new version and got this ugly fucking piece of shit to package - rebuild for BM * Tue Apr 18 2000 Jerome Dumonteil <jd@mandrakesoft.com> - change group * Fri Mar 31 2000 Jerome Dumonteil <jd@mandrakesoft.com> - change group - modif postun * Wed Dec 29 1999 Jerome Dumonteil <jd@mandrakesoft.com> - version 2.4 * Fri Dec 17 1999 Jerome Dumonteil <jd@mandrakesoft.com> - added link /etc/smrsh/queue - added link for /home/sympa/expl/helpfile * Thu Dec 09 1999 Jerome Dumonteil <jd@mandrakesoft.com> - remove backup files from sources - strip binary * Mon Dec 6 1999 Jerome Dumonteil <jd@mandrakesoft.com> - added prereq info. - little cleanup. * Fri Dec 3 1999 Jerome Dumonteil <jd@mandrakesoft.com> - first version of rpm.