%define bootstrap 0 %{?_without_bootstrap: %global bootstrap 0} %{?_with_bootstrap: %global bootstrap 1} %define fname Mail-SpamAssassin Summary: A spam filter for email which can be invoked from mail delivery agents Name: spamassassin Version: 3.4.1 Release: %mkrel 2 License: Apache License Group: Networking/Mail URL: http://spamassassin.apache.org/ Source0: http://www.apache.org/dist/spamassassin/source/%{fname}-%{version}.tar.bz2 Source3: spamd.sysconfig Source4: spamassassin-default.rc Source5: spamassassin-spamc.rc # next two sources taken from Fedora Source6: sa-update.crontab Source7: sa-update.cronscript Source8: spamd.logrotate Source9: spamd.conf Source10: %{name}.service Source11: %{name}-tmpfiles.conf Source12: spamassassin-official.conf Source13: sought.conf Source14: README.Mageia # (fc) 2.60-5mdk don't use version dependent perl call in #! Patch0: spamassassin-3.2.0-fixbang.patch Patch1: Mail-SpamAssassin-3.1.5-no_spamcop.diff Patch2: Mail-SpamAssassin-3.4.1-perl-Net_DNS-1.03+.diff Requires(post): systemd >= %{systemd_required_version} Requires(post): rpm-helper >= 0.24.8-1 Requires(preun): rpm-helper >= 0.24.8-1 BuildRequires: gnupg BuildRequires: openssl-devel BuildRequires: perl(Apache::Test) BuildRequires: perl(Archive::Tar) BuildRequires: perl(DB_File) BuildRequires: perl(Digest::SHA) BuildRequires: perl(Encode::Detect) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.17 BuildRequires: perl(Geo::IP) BuildRequires: perl(HTML::Parser) BuildRequires: perl(IO::Socket::IP) >= 0.09 BuildRequires: perl(IO::Socket::SSL) BuildRequires: perl(IO::Zlib) BuildRequires: perl(LWP) BuildRequires: perl(Mail::DKIM) >= 0.37 BuildRequires: perl(Mail::SPF) BuildRequires: perl(Net::DNS) BuildRequires: perl(Net::Ident) BuildRequires: perl(Net::Patricia) >= 1.16 BuildRequires: perl(Razor2::Client::Agent) >= 2.61 BuildRequires: perl(Socket6) BuildRequires: perl(Sys::Hostname::Long) BuildRequires: perl(Time::HiRes) BuildRequires: perl-devel BuildRequires: perl-version BuildRequires: re2c BuildRequires: webfetch BuildRequires: apache-mod_perl # The requires are derived automatically from META.yml. The below require is # given on http://svn.apache.org/repos/asf/spamassassin/branches/3.3/INSTALL # but missing from META.yml ... better safe than sorry! Requires: perl(LWP) # And one on a package we create ourselves: Requires: perl-Mail-SpamAssassin = %{version} # This should be required and not just suggested: Requires: gnupg # Suggests unfortunately do not get derived automatically yet: Recommends: perl(Compress::Zlib) Recommends: perl(DBI) Recommends: perl(DB_File) Recommends: perl(Digest::SHA) Recommends: perl(Encode::Detect) Recommends: perl(Geo::IP) Recommends: perl(Getopt::Long) Recommends: perl(HTTP::Date) Recommends: perl(IO::Socket::IP) >= 0.09 Recommends: perl(IO::Socket::SSL) Recommends: perl(LWP::UserAgent) Recommends: perl(MIME::Base64) Recommends: perl(Mail::DKIM) >= 0.37 Recommends: perl(Mail::SPF) Recommends: perl(Net::DNS) >= 0.58 Recommends: perl(Net::Ident) Recommends: perl(Net::Patricia) >= 1.16 Recommends: perl(Net::SMTP) Recommends: perl(Razor2::Client::Agent) >= 2.61 Recommends: webfetch %if ! %bootstrap Requires: spamassassin-rules >= 3.4.1 %endif %description SpamAssassin provides you with a way to reduce if not completely eliminate Unsolicited Commercial Email (SPAM) from your incoming email. It can be invoked by a MDA such as sendmail or postfix, or can be called from a procmail script, .forward file, etc. It uses a genetic-algorithm evolved scoring system to identify messages which look spammy, then adds headers to the message so they can be filtered by the user's mail reading software. This distribution includes the spamd/spamc components which create a server that considerably speeds processing of mail. SpamAssassin also includes support for reporting spam messages automatically, and/or manually, to collaborative filtering databases such as Vipul's Razor, DCC or pyzor. Install perl-Razor-Agent package to get Vipul's Razor support. Install dcc package to get Distributed Checksum Clearinghouse (DCC) support. Install pyzor package to get Pyzor support. To enable spamassassin, if you are receiving mail locally, simply add this line to your ~/.procmailrc: INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc To filter spam for all users, add that line to /etc/procmailrc or create that file if doesn't exist yet. %package sa-compile Summary: Compiles SpamAssassin rulesets into native perl code Group: Networking/Mail Requires: gcc make Requires: perl-devel Requires: re2c %description sa-compile sa-compile uses re2c to compile the site-wide parts of the SpamAssassin ruleset. No part of user_prefs or any files included from user_prefs can be built into the compiled set. This compiled set is then used by the "Mail::SpamAssassin::Plugin::Rule2XSBody" plugin to speed up SpamAssassin's operation, where possible, and when that plugin is loaded. re2c can match strings much faster than perl code, by constructing a DFA to match many simple strings in parallel, and compiling that to native object code. Not all SpamAssassin rules are amenable to this conversion, however. %package tools Summary: Miscleanous tools for SpamAssassin Group: Networking/Mail Requires: perl-Mail-SpamAssassin = %{version} %description tools Miscleanous tools from various authors, distributed with SpamAssassin. See /usr/share/doc/spamassassin-tools-*/. %package spamd Summary: Daemonized version of SpamAssassin Group: System/Servers %if ! %bootstrap Requires(post): spamassassin-rules >= 3.3.0 %endif Requires(post): rpm-helper >= 0.24.8-1 Requires(preun): rpm-helper >= 0.24.8-1 Requires: spamassassin = %{version} %description spamd The purpose of this program is to provide a daemonized version of the spamassassin executable. The goal is improving throughput performance for automated mail checking. This is intended to be used alongside "spamc", a fast, low-overhead C client program. %package spamc Summary: A client for spamd Group: Networking/Mail %description spamc Spamc is the client half of the spamc/spamd pair. It should be used in place of "spamassassin" in scripts to process mail. It will read the mail from STDIN, and spool it to its connection to spamd, then read the result back and print it to STDOUT. Spamc has extremely low overhead in loading, so it should be much faster to load than the whole spamassassin program. %package -n perl-%{fname} Summary: SpamAssassin e-mail filter Perl modules Group: Development/Perl Requires: perl(HTML::Parser) %description -n perl-%{fname} Mail::SpamAssassin is a module to identify spam using text analysis and several internet-based realtime blacklists. Using its rule base, it uses a wide range of heuristic tests on mail headers and body text to identify ``spam'', also known as unsolicited commercial email. Once identified, the mail can then be optionally tagged as spam for later filtering using the user's own mail user-agent application. %package -n perl-%{fname}-Spamd Summary: A mod_perl2 module implementing the spamd protocol Group: Development/Perl Requires: apache-mod_perl %description -n perl-%{fname}-Spamd This distribution contains a mod_perl2 module, implementing the spamd protocol from the SpamAssassin (http://spamassassin.apache.org/) project in Apache2. It's mostly compatible with the original spamd. %prep %setup -q -n %{fname}-%{version} %patch0 -p0 -b .fixbang %patch1 -p0 %patch2 -p1 # svn cleansing... for i in `find . -type d -name .svn`; do if [ -e "$i" ]; then rm -rf $i; fi >&/dev/null done %build %{__perl} \ Makefile.PL \ INSTALLDIRS=vendor \ SYSCONFDIR=%{_sysconfdir} \ DATADIR=%{_datadir}/spamassassin \ ENABLE_SSL=yes \ RUN_NET_TESTS=no < /dev/null %make OPTIMIZE="%{optflags}" LDFLAGS="%{ldflags}" pushd spamd-apache2 %{__perl} Makefile.PL INSTALLDIRS=vendor < /dev/null %make popd %check #cat >> t/config.dist << EOF #run_net_tests=y #run_spamd_prefork_stress_test=y #EOF export LANG=C export LC_ALL=C export LANGUAGE=C # useless and broken test case rm -f t/make_install.t # may be broken on mga4 only? NO... rm -f t/sa_compile.t make FULLPERL="%{_bindir}/perl" test #TEST_VERBOSE=1 %install %makeinstall_std pushd spamd-apache2 %makeinstall_std popd install -d %{buildroot}%{_sysconfdir}/mail/%{name}/sa-update-keys install -d %{buildroot}%{_sysconfdir}/sysconfig install -d %{buildroot}%{_sysconfdir}/logrotate.d install -d %{buildroot}/var/log/spamassassin install -d %{buildroot}/var/lib/spamassassin install -d %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d cat << EOF >> %{buildroot}%{_sysconfdir}/mail/%{name}/local.cf required_hits 5 rewrite_header Subject [SPAM] report_safe 0 EOF install -d %{buildroot}%{_sysconfdir}/cron.d install -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/spamd install -m0644 %{SOURCE6} %buildroot/etc/cron.d/sa-update # installed mode 744 as non root users can't run it, but can read it. install -m0744 %{SOURCE7} %buildroot%{_datadir}/spamassassin/sa-update.cron install -m0644 %{SOURCE8} %{buildroot}%{_sysconfdir}/logrotate.d/spamd install -m0644 %{SOURCE9} %{buildroot}/%{_sysconfdir}/httpd/conf/webapps.d/spamd.conf install -m0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/mail/spamassassin/ install -m0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/mail/spamassassin/ install -D -p -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/spamd.service install -D -p -m 644 %{SOURCE11} %{buildroot}%{_tmpfilesdir}/%{name}.conf # sa-update channels and keyring directory install -d %{buildroot}%{_sysconfdir}/mail/spamassassin/channel.d/ install -m0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/mail/spamassassin/channel.d/ install -m0644 %{SOURCE13} %{buildroot}%{_sysconfdir}/mail/spamassassin/channel.d/ install -m 0644 %{SOURCE14} $RPM_BUILD_DIR/Mail-SpamAssassin-%{version}/ # bork bork install -m0644 rules/*.pre %{buildroot}%{_sysconfdir}/mail/%{name}/ # cleanup rm -f %{buildroot}%{_bindir}/apache-spamd.pl rm -f %{buildroot}%{_mandir}/man1/apache-spamd.pl.1* # these are not meant to be released rm -f %{buildroot}%{perl_vendorlib}/Mail/SpamAssassin/Plugin/P595Body.pm rm -f %{buildroot}%{perl_vendorlib}/Mail/SpamAssassin/Plugin/RabinKarpBody.pm %post [ -f %{_sysconfdir}/spamassassin.cf ] && %{__mv} %{_sysconfdir}/spamassassin.cf %{_sysconfdir}/mail/spamassassin/migrated.cf || true [ -f %{_sysconfdir}/mail/spamassassin.cf ] && /bin/mv %{_sysconfdir}/mail/spamassassin.cf %{_sysconfdir}/mail/spamassassin/migrated.cf || true %post spamd %_tmpfilescreate %{name} %_post_service spamd %preun spamd %_preun_service spamd %files %doc README Changes sample-*.txt procmailrc.example INSTALL TRADEMARK %doc CREDITS UPGRADE USAGE META.yml README.Mageia %dir %{_sysconfdir}/mail/%{name} %dir %attr(0700,root,root) %{_sysconfdir}/mail/%{name}/sa-update-keys %config(noreplace) %{_sysconfdir}/mail/%{name}/*.cf %config(noreplace) %{_sysconfdir}/mail/%{name}/*.pre %config(noreplace) %{_sysconfdir}/mail/%{name}/spamassassin-default.rc %config(noreplace) %{_sysconfdir}/mail/%{name}/channel.d %config(noreplace) %{_sysconfdir}/logrotate.d/spamd %{_sysconfdir}/cron.d/sa-update %dir /var/lib/spamassassin %{_bindir}/sa-awl %{_bindir}/sa-check_spamd %{_bindir}/sa-learn %{_bindir}/sa-update %{_bindir}/spamassassin %{_mandir}/man1/sa-awl.1* %{_mandir}/man1/sa-learn.1* %{_mandir}/man1/sa-update.1* %{_mandir}/man1/spamassassin.1* %{_mandir}/man1/spamassassin-run.1* %{_datadir}/spamassassin %dir %{_logdir}/spamassassin %files sa-compile %{_bindir}/sa-compile %{_mandir}/man1/sa-compile.1* %files tools %doc sql ldap %files spamd %doc spamd/README* spamd/PROTOCOL %{_unitdir}/spamd.service %config(noreplace) %{_sysconfdir}/sysconfig/spamd %{_bindir}/spamd %{_mandir}/man1/spamd.1* %{_tmpfilesdir}/%{name}.conf %files spamc %config(noreplace) %{_sysconfdir}/mail/%{name}/spamassassin-spamc.rc %{_bindir}/spamc %{_mandir}/man1/spamc.1* %files -n perl-%{fname} %{perl_vendorlib}/Mail/SpamAssassin* %exclude %{perl_vendorlib}/Mail/SpamAssassin/Spamd %{perl_vendorlib}/spamassassin-run.pod %{_mandir}/man3/Mail::SpamAssassin* %exclude %{_mandir}/man3/Mail::SpamAssassin::Spamd* %{_mandir}/man3/spamassassin-run.3pm* %files -n perl-%{fname}-Spamd %doc spamd-apache2/README.apache %config(noreplace) %{_sysconfdir}/httpd/conf/webapps.d/spamd.conf %{perl_vendorlib}/Mail/SpamAssassin/Spamd %{_mandir}/man3/Mail::SpamAssassin::Spamd* %changelog * Wed Mar 30 2016 remmy <remmy> 3.4.1-2.mga5 + Revision: 996925 - Require new spamassassin rules package (mga#16308 comment #4) + oden <oden> - backported to fix "can't restart spamd" * Wed Oct 15 2014 umeabot <umeabot> 3.4.0-5.mga5 + Revision: 743861 - Second Mageia 5 Mass Rebuild * Tue Sep 16 2014 umeabot <umeabot> 3.4.0-4.mga5 + Revision: 689262 - Mageia 5 Mass Rebuild + tv <tv> - s/uggests:/Recommends:/ * Sun Aug 17 2014 remmy <remmy> 3.4.0-3.mga5 + Revision: 664895 - No longer create a (global readable) auto-whitelist file (mga#13899) * Tue May 06 2014 shlomif <shlomif> 3.4.0-2.mga5 + Revision: 620859 - spamd.sysconfig: also listen on a TCP port ( mga#13329 ). * Fri Feb 14 2014 oden <oden> 3.4.0-1.mga5 + Revision: 591291 - disable t/sa_compile.t for now. - 3.4.0 - fix deps * Fri Jan 10 2014 spuhler <spuhler> 3.3.2-21.mga4 + Revision: 566186 + rebuild (emptylog) * Thu Jan 09 2014 spuhler <spuhler> 3.3.2-20.mga4 + Revision: 565924 - removed none existend spamassassin.service - removed Source2: spamd.init and all related files - renamed %%{name}.service to spamd.service - removed obsoleted line # (cg) Make sure we mask the sysvinit script name - removed line ln -s spamassassin.service %%{buildroot}%%{_unitdir}/spamd.service * the %%_post_service spamd line will take care of this - corrected path of sa-update.log file -deleted obsoleted spamd.init file * Fri Nov 22 2013 spuhler <spuhler> 3.3.2-19.mga4 + Revision: 552361 - improving the sa-update process - using reload for amavisd instead of condrestart * prevents from amavisd interrupting the connection when e-mails are in the channel * Thu Nov 21 2013 spuhler <spuhler> 3.3.2-18.mga4 + Revision: 552183 -made the update running if an amavis.pid is detected - added the amavis.pid to the update test * Wed Nov 20 2013 spuhler <spuhler> 3.3.2-17.mga4 + Revision: 552020 - updated cron-sript - converted service to systemctl - corrected spelling of spamd * Fri Nov 15 2013 spuhler <spuhler> 3.3.2-16.mga4 + Revision: 551435 - update do use systemctl for restarting demons * to reflect amavis chang to systemd native - removed scripts for those programs we don't provide * Tue Oct 22 2013 umeabot <umeabot> 3.3.2-15.mga4 + Revision: 544713 - Mageia 4 Mass Rebuild * Tue Oct 15 2013 spuhler <spuhler> 3.3.2-14.mga4 + Revision: 499896 - fixed bug #11246, amavisd doesn't need spamd and spamc * this requires that amavisd needs to be restarted every time sa-update has been run - forces to run sa-update if only spamassassin or/and spamd is installed - added spamassassin-official.conf for the channels - added sa-update.crontab file to force sa-update once per day * regardless of spamd is isntalled - sa-update.cronscript replace the simple sa-update.cron file * this will initiate sa-update through cron, depending if any of these is installed - spamd, amavisd, they will be update. this will take care of bug #11246 - added README.Mageia file * Sun Mar 24 2013 colin <colin> 3.3.2-13.mga3 + Revision: 405136 - Use tmpfiles macros and add system version to requires (mga#9302) * Mon Jan 14 2013 umeabot <umeabot> 3.3.2-12.mga3 + Revision: 382407 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Tue Aug 14 2012 colin <colin> 3.3.2-11.mga3 + Revision: 281265 - Fix /run dir creation after usrmove with tmpfiles.d entry. * Fri Jun 22 2012 remmy <remmy> 3.3.2-10.mga3 + Revision: 262540 - Make gnupg a requirement instead of a suggest (closes mga#5959) - Use pgrep instead of pidof in sa-update script (closes mga#6430) * Sat Apr 28 2012 tmb <tmb> 3.3.2-9.mga2 + Revision: 233858 - Require rpm-helper >= 0.24.8-1 for systemd support * Tue Apr 24 2012 remmy <remmy> 3.3.2-8.mga2 + Revision: 233151 - Systemd unit file pointed to the wrong environment file, keeping spamd from starting properly (mga#5572) * Sat Apr 21 2012 colin <colin> 3.3.2-7.mga2 + Revision: 232384 - We do not use portreserve so remove the call. - Ensure we mask the sysvinit script. * Wed Apr 18 2012 guillomovitch <guillomovitch> 3.3.2-6.mga2 + Revision: 231320 - spec cleanup - systemd support * Wed Mar 21 2012 dlucio <dlucio> 3.3.2-5.mga2 + Revision: 225393 - We move runtime info from /var/run to /var/run/spamd - unix socket and tcp socket are listen at same time * Thu Mar 01 2012 remmy <remmy> 3.3.2-4.mga2 + Revision: 216526 - Add dependancy on perl-Mail-SpamAssassin * Wed Feb 29 2012 remmy <remmy> 3.3.2-3.mga2 + Revision: 216000 - Use a pid file for spamd so systemd can be used to properly start and stop this service. (Closes mga#3402) - Clean up of .spec file - Use META.yml for automatic inclusion of Requires - Require latest spamassassin-rules - Added explicit requirement on spamassassin-rules (closes #3712) * Wed Feb 08 2012 remmy <remmy> 3.3.2-2.mga2 + Revision: 206459 - Flip bootstrap variable, so dependency on spamassassin-rules is included (fixing #3712) * Tue Feb 07 2012 misc <misc> 3.3.2-1.mga2 + Revision: 206203 - remove old conflict - clean old construct and empty %%post - fix tarball name - fix missing file - disable test not working ( for some weird reason related to ssl perl module ) - update to stable release 3.3.2 - make sa-update.cron silent, otherwise, sysadmin received one mail each night when nothing happen * Sun Mar 06 2011 spuhler <spuhler> 3.3.2-0.0.r2260312.1.mga1 + Revision: 65714 - update to r1036809 added echo "need to run sa-update" added /usr/bin/sa-update -v otherwise the spamd will not start until a cron job completes * Mon Feb 21 2011 spuhler <spuhler> 3.3.2-0.0.r1036809.5.mga1 + Revision: 55159 - Increased rel for rebuild against perl-5.12 * Mon Jan 24 2011 ennael <ennael> 3.3.2-0.0.r1036809.4.mga1 + Revision: 37955 - add bootstrap test * Mon Jan 24 2011 ennael <ennael> 3.3.2-0.0.r1036809.3.mga1 + Revision: 37523 - add missing condition * Mon Jan 24 2011 ennael <ennael> 3.3.2-0.0.r1036809.2.mga1 + Revision: 37403 - add bootstrap * Sat Jan 22 2011 ennael <ennael> 3.3.2-0.0.r1036809.1.mga1 + Revision: 33050 - remove mdkversion - imported package spamassassin