%define pdir Mail %define pnam SpamAssassin %define version 3.4.4 %define real_version 3.4.4 %global saversion 3.004004 %define release 1%{?_dist_release} %define cfdate 20151119 %define rules_release r1873061 %define name spamassassin %define _initrddir /etc/rc.d/init.d %define initdir %{_initrddir} #%define __find_provides /usr/lib/rpm/find-provides.perl #%define __find_requires /usr/lib/rpm/find-requires.perl Summary: a spam filter for email which can be invoked from mail delivery agents Summary(ja): MDA から起動できる spam email filter Group: Applications/Internet Name: %{name} Version: %{version} Release: %{release} License: Apache License 2.0 URL: http://spamassassin.org/ Source0: https://www-eu.apache.org/dist/spamassassin/source/Mail-SpamAssassin-%{real_version}.tar.bz2 Source1: https://www-eu.apache.org/dist/spamassassin/source/Mail-SpamAssassin-rules-%{real_version}.%{rules_release}.tgz Source2: sample-japanese-local.cf-%{cfdate} Source3: README.vine Source4: filter.sh Source5: spamassassin.sysconfig Source6: sa-update.logrotate Source7: sa-update.crontab Source8: sa-update.cronscript Source9: sa-update.force-sysconfig Source11: spamassassin-official.conf Source12: sought.conf Patch0: spamassassin-3.1.7_rules.patch Buildroot: %{_tmppath}/%{name}-%{version}-root Requires(pre): /sbin/chkconfig Requires(pre): perl-Mail-SpamAssassin = %{version}-%{release} Requires(pre): spamassassin-tools = %{version}-%{release} Requires: perl >= 2:5.26.2 BuildRequires: perl >= 2:5.26.2 BuildRequires: perl(HTML::Parser) BuildRequires: perl(Archive::Tar) BuildRequires: perl(IO::Zlib) BuildRequires: perl(Net::DNS) BuildRequires: perl(NetAddr::IP) BuildRequires: perl(Mail::DKIM) BuildRequires: perl(Geo::IP) BuildRequires: perl(Digest::SHA1) BuildRequires: perl(Encode::Detect) BuildRequires: curl BuildRequires: zlib-devel Vendor: Project Vine Distribution: Vine Linux %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. %description -l ja SpamAssassin は商用電子メール(スパム)を除去する手段を提供する filter です。 sendmail または postfix のような MDA から SpamAssassin を起動することが 可能です。 また procmail スクリプト、.forward ファイルなどからも呼ぶことができます。 SpamAssassin は、スパムメッセージを識別するために遺伝的アルゴリズムを 発展させた、得点システムを使用しています。 ユーザのメールソフト (MUA) がそれらをフィルタリングすることができるように、 メッセージにヘッダーを加えます。 また、メイルの処理速度を要求されるサーバーで用いる spamd/spamc コンポー ネントを含んでいます。 日本語のスパムメール用の local.cf を含めています。 /usr/doc/spamassassin-*/sample-japanese-local.conf を見てください。 %package tools Summary: Miscellaneous tools for SpamAssassin Summary(ja): SpamAssassin 向けの各種ツール Group: Applications/Internet Requires(pre): perl-Mail-SpamAssassin = %{version}-%{release} Requires: perl >= 2:5.26.2 Requires: curl %description tools Miscellaneous tools from various authors, distributed with SpamAssassin. See /usr/share/doc/SpamAssassin-tools-*/. %package -n perl-Mail-SpamAssassin Summary: %{pdir}::%{pnam} -- SpamAssassin e-mail filter Perl modules Group: Development/Libraries Requires: perl >= 2:5.26.2 Requires: perl(Pod::Usage) perl(HTML::Parser) Requires: perl(Archive::Tar) Requires: perl(IO::Zlib) Requires: perl(Net::DNS) Requires: perl(NetAddr::IP) Requires: perl(Mail::DKIM) Requires: perl(Geo::IP) Requires: perl(Digest::SHA1) Requires: perl(Encode::Detect) %description -n perl-Mail-SpamAssassin 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. %prep -q %setup -q -n %{pdir}-%{pnam}-%{real_version} # %setup -D -a 1 -T -n %{pdir}-%{pnam}-%{real_version} %patch0 -p0 -b .rules # Japanese sample file / README cp -p %{SOURCE2} sample-japanese-local.cf cp -p %{SOURCE3} README.vine cp -p %{SOURCE4} filter.sh # sa-update sample cp -p %{SOURCE6} . cp -p %{SOURCE7} . cp -p %{SOURCE8} . # change README filename cp spamd/README spamd/README.spamd %build CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS %{__perl} Makefile.PL INSTALLDIRS=vendor < /dev/null %{__make} %{__make} spamd/libspamc.so %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} make DESTDIR=%{buildroot} install install -d %{buildroot}/%{initdir} install -m 0755 spamd/redhat-rc-script.sh %{buildroot}%{initdir}/spamassassin mkdir -p %{buildroot}%{_sysconfdir}/mail/spamassassin mkdir -p %{buildroot}%{_sysconfdir}/sysconfig mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d mkdir -p %{buildroot}%{_sysconfdir}/cron.d install -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/spamassassin install -m 0644 %{SOURCE6} %{buildroot}/etc/logrotate.d/sa-update install -m 0644 %{SOURCE7} %{buildroot}/etc/cron.d/sa-update install -m 0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/sysconfig/sa-update # installed mode 744 as non root users can't run it, but can read it. install -m 0744 %{SOURCE8} %{buildroot}%{_datadir}/spamassassin/sa-update.cron # [ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress find %{buildroot} \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \; find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';' # Default rules from separate tarball cd %{buildroot}%{_datadir}/spamassassin/ tar xfvz %{SOURCE1} sed -i -e 's|\@\@VERSION\@\@|%{saversion}|' *.cf cd - find %{buildroot}/usr -type f -print | sed "s@^%{buildroot}@@g" | grep -v perllocal.pod | grep -v "\.packlist" > %{name}-%{version}-filelist if [ "$(cat %{name}-%{version}-filelist)X" = "X" ] ; then echo "ERROR: EMPTY FILE LIST" exit -1 fi find %{buildroot}%{perl_vendorlib}/* -type d -print | sed "s@^%{buildroot}@%dir @g" >> %{name}-%{version}-filelist # sa-update channels and keyring directory mkdir -m 0700 %{buildroot}%{_sysconfdir}/mail/spamassassin/sa-update-keys/ mkdir -m 0755 %{buildroot}%{_sysconfdir}/mail/spamassassin/channel.d/ install -m 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/mail/spamassassin/channel.d/ install -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/mail/spamassassin/channel.d/ %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %post # install if [ $1 = 1 ]; then /sbin/chkconfig --add spamassassin fi # update if [ $1 = 2 ]; then if [ -x /usr/bin/sa-learn ] ; then echo "Sync DB (sa-learn --sync)" /usr/bin/sa-learn --sync fi if [ -f /var/lock/subsys/spamassassin ]; then echo "restarting spamd" %{initdir}/spamassassin restart else echo 'If you use spamd,' echo ' "/etc/rc.d/init.d/spamassassin start"' echo 'to start the spamd daemon.' fi fi %post tools if [ -x /usr/bin/sa-update ] ; then echo "Update rules" /usr/bin/sa-update ||: fi %post -n perl-Mail-SpamAssassin if [ -x /usr/bin/sa-update ] ; then echo "Update rules" /usr/bin/sa-update ||: fi %pre -n perl-Mail-SpamAssassin # update if [ $1 = 2 ]; then if [ -x /usr/bin/sa-learn ] ; then echo "Sync DB (sa-learn --sync)" /usr/bin/sa-learn --sync ||: fi fi %preun # remove if [ $1 = 0 ]; then if [ -f /var/lock/subsys/spamassassin ]; then %{initdir}/spamassassin stop 1>&2 fi /sbin/chkconfig --del spamassassin fi %files %defattr(-,root,root) %license LICENSE %doc CREDITS Changes INSTALL INSTALL.VMS MANIFEST MANIFEST.SKIP %doc NOTICE PACKAGING README README.vine TRADEMARK UPGRADE USAGE %doc sql %doc filter.sh %doc sample-nonspam.txt sample-spam.txt %doc spamd/README.spamd %doc sample-japanese-local.cf %doc sa-update.* %config(noreplace) %{_sysconfdir}/sysconfig/spamassassin %attr(755,root,root) %{_bindir}/spam* %config %attr(755,root,root) %{initdir}/spamassassin %{_mandir}/man1/spam* %files -n spamassassin-tools %defattr(644,root,root,755) %doc sql %config(noreplace) %{_sysconfdir}/sysconfig/sa-update %config(noreplace) %{_sysconfdir}/logrotate.d/sa-update %{_sysconfdir}/cron.d/sa-update %attr(755,root,root) %{_bindir}/sa-* %{_mandir}/man1/sa-* %files -n perl-Mail-SpamAssassin %defattr(-,root,root) %{perl_vendorlib}/Mail/* %{perl_vendorlib}/spamassassin-run.pod %config(noreplace) %{_sysconfdir}/mail/spamassassin %{_datadir}/spamassassin %{_mandir}/man3/* %changelog * Sat Feb 01 2020 Tomohiro "Tomo-p" KATO 3.4.4-1 - new upstream release. * Fri Dec 20 2019 Tomohiro "Tomo-p" KATO 3.4.3-1 - new upstream release. * Sun May 19 2019 Tomohiro "Tomo-p" KATO 3.4.2-1 - new upstream release. - rebuilt with perl-5.26. * Sat Nov 28 2015 Tomohiro "Tomo-p" KATO 3.4.1-1 - new upstream release. - removed %%patch1000 (no longer needed). * Wed Dec 17 2014 Tomohiro "Tomo-p" KATO 3.4.0-2 - added Patch1000. * Mon Jun 30 2014 Tomohiro "Tomo-p" KATO 3.4.0-1 - new upstream release. * Mon Jan 13 2014 Tomohiro "Tomo-p" KATO 3.3.2-1 - new upstream release. - added official rules. * Fri Apr 08 2011 Tomohiro "Tomo-p" KATO 3.3.1-1 - new upstream release. - replaced "Prereq:" and "BuildPrereq". - updated sample-japanese-local.cf. - added Patch1 and Patch2 for perl-5.12.x. * Mon Jun 22 2009 Tomohiro "Tomo-p" KATO 3.2.5-1 - new upstream release. - wrote spec in UTF-8. - updated sample-japanese-local.cf. * Thu May 1 2008 Tomohiro 'Tomo-p' KATO - 3.2.4-1 - rebuilt with perl-5.10.0. * Sun Feb 24 2008 Satoshi IWAMOTO - 3.2.4-0vl1 - new upstream release (built for VineSeed) - update Requires/BuildRequires tag perl(HTML::Parser) >= 3.43 - enable Requires for sa-update - remove "(noreplace)" from init script - remove Vine 3.x if-endif section - remove script for upgrading from sa 2.x - turn on daemon restart message - update sample-japanese-local.cf * Wed Jan 02 2008 Shu KONNO 3.2.3-0vl1 - new upstream release * Tue Feb 20 2007 Satoshi IWAMOTO - 3.1.8-0vl2 - rebuilt for VinePlus 4.x - installed perl modules to vendor_perl dir * Sun Feb 18 2007 Satoshi IWAMOTO - 3.1.8-0vl1 - built for VinePlus 3.x - installed perl modules to site_perl dir - add restart spamd process automactically (update) - * Thu Dec 07 2006 Satoshi IWAMOTO - 3.1.7-0vl1.1 - fix file list - sample-japanese-local.cf update - README.vine update * Sun Feb 18 2007 Satoshi IWAMOTO - 3.1.8-0vl0.1 - test package (not released) - built for VinePlus 4.0 - new upstream release with security fix (CVE-2007-0451) - add Source4,5,6 for sa-update sample file * Tue Nov 07 2006 Satoshi IWAMOTO - 3.1.7-0vl3 - fix file list - sample-japanese-local.cf update - README.vine update - fix changelog missing * Mon Oct 16 2006 Satoshi IWAMOTO - 3.1.7-0vl2 - built for VinePlus 4.0 - This package is based on VinePlus 3.x package - installed perl modules to vendor_perl dir - * Tue Jul 11 2006 Ryoichi INAGAKI 2.64-0vl3 - rebuilt with perl 5.8.6 - changed Group to Applications/Internet - installed perl modules to vendor_perl dir * Sat Oct 14 2006 Satoshi IWAMOTO - 3.1.7-0vl1 - new upstream release - add %pre -n perl-Mail-SpamAssassin script for updating package - add README.vine filter.sh - change License to Apache License 2.0 * Sat Oct 07 2006 Satoshi IWAMOTO - 3.1.5-0vl1 - new upstream release - built for VinePlus 3.2 * Sat Nov 27 2004 Satoshi IWAMOTO - 2.64-0vl2 - rebuild for VinePlus 3.0 * Sat Nov 27 2004 Satoshi IWAMOTO - 2.64-0vl1 - rebuild for VinePlus 2.5/2.6 - Source version up - Sample-japanese-local.cf update * Sat Apr 10 2004 Satoshi IWAMOTO - 2.63-0vl4 - rebuild for VineSeed Plus - Sample-japanese-local.cf update * Mon Apr 05 2004 Satoshi IWAMOTO - 2.63-0vl3 - Source version up - Sample-japanese-local.cf update * Sun Apr 04 2004 Satoshi IWAMOTO - 2.63-0vl2 - Source version up - Sample-japanese-local.cf update * Tue Dec 23 2003 Satoshi IWAMOTO - 2.61-0vl1 - Source version up - Sample-japanese-local.cf update - Change make & install method for 2.61 - fix Require - add post/preun script for update from 2.5x - add Vendor/Distribution tag * Sat May 24 2003 Satoshi IWAMOTO - 2.55-0vl2 - Sample-japanese-local.cf update * Sat May 24 2003 Satoshi IWAMOTO - 2.55-0vl1 - Source version up * Fri Apr 25 2003 Satoshi IWAMOTO - 2.53-0vl1 - Source version up - Sample-japanese-local.cf update * Fri Mar 28 2003 Satoshi IWAMOTO - 2.52-0vl1 - Source version up * Thu Feb 06 2003 Satoshi IWAMOTO - 2.44-0vl1 - Source version up - Sample-japanese-local.cf update - Fix japanese discription * Wed Oct 23 2002 Satoshi IWAMOTO - 2.43-0vl2 - Update & fix sample-japanese-local.cf * Fri Oct 18 2002 Satoshi IWAMOTO - 2.43-0vl1 - Source version up - Change make & install method for 2.43 - Update sample-japanese-local.cf - Thanx to MATSUDA Yoh-ichi san - Change Buildprereq, Requires (perl 5.6.0 -> 5.6.1) for Vine 2.5 - Add doc qmail - Fix cvs version tags (Patch0) * Thu Oct 10 2002 Satoshi IWAMOTO - 2.42-3vl3 - stop install sample-japanese-local.cf to /etc/mail/spamassassin - add japanese discription - Fix Buildrequires * Tue Oct 08 2002 Satoshi IWAMOTO - 2.42-3vl2 - Fix Requires, Buildrequires - add local.cf for Japanese (from Linux-Users ML spam filter) * Mon Oct 07 2002 Satoshi IWAMOTO - 2.42-3vl1 - first build for Vine Linux - NO run post/preun script - add requires perl(Time::HiRes) - add define _initrcdir * Sat Oct 05 2002 Theo Van Dinter -3 - fixed some small typos in the spec file * Fri Oct 04 2002 Theo Van Dinter -2 - small bug where 2.42 still called itself 2.42-cvs * Fri Oct 04 2002 Theo Van Dinter -1 - updated to SA 2.42 * Wed Sep 11 2002 Justin Mason - spamassassin RPM now requires perl-Mail-SpamAssassin; from Theo * Tue Sep 03 2002 Theo Van Dinter - added INSTALL to documentation files - install man pages via _manpage macro to make things consistent - added perl requires statement - cleaned out some cruft - fixed "file listed twice" bug * Wed Aug 28 2002 Justin Mason - merged code from PLD rpm, split into spamassassin, perl-Mail-SpamAssassin, and spamassassin-tools rpms * Mon Jul 29 2002 Justin Mason - removed migrate_cfs code, obsolete * Thu Jul 25 2002 Justin Mason - removed findbin patch, obsolete * Fri Apr 19 2002 Theo Van Dinter - Updated for 2.20 release - made /etc/mail/spamassassin a config directory so local.cf doesn't get wiped out - added a patch to remove findbin stuff * Wed Feb 27 2002 Craig Hughes - Updated for 2.1 release * Sat Feb 02 2002 Theo Van Dinter - Updates for 2.01 release - Fixed rc file - RPM now buildable as non-root - fixed post_service errors - fixed provides to include perl modules - use file find instead of manually specifying files * Tue Jan 15 2002 Craig Hughes - Updated for 2.0 release * Wed Dec 05 2001 Craig Hughes - Updated for final 1.5 distribution. * Sun Nov 18 2001 Craig Hughes - first version of rpm.