%define name spamassassin %define real_name Mail-SpamAssassin %define initdir %{_initrddir} Summary: This is SpamAssassin, a spam filter for email which can be invoked from mail delivery agents. Name: %{name} Version: 2.43 Release: 5 License: Artistic Group: Applications/Internet URL: http://spamassassin.org/ Source0: http://spamassassin.org/devel/Mail-SpamAssassin-%{version}.tar.gz Source2: redhat_local.cf Source3: spamassassin-default.rc Source4: spamassassin-spamc.rc Source5: spamassassin.sysconfig Source99: filter-requires-spamassassin.sh Requires: perl >= 5.004 Buildroot: %{_tmppath}/%{name}-root Prefix: %{_prefix} Prereq: /sbin/chkconfig Distribution: SpamAssassin BuildRequires: perl-Net-DNS BuildRequires: perl >= 2:5.8.0 BuildRequires: perl(Time::HiRes) Requires: perl-Net-DNS Requires: perl(Time::HiRes) Requires: procmail Obsoletes: perl-Mail-SpamAssassin %define __find_requires %{SOURCE99} %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. 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 (creating if necessary). %prep %setup -q -n %{real_name}-%{version} %build %{__perl} Makefile.PL PREFIX=$RPM_BUILD_ROOT/%{_prefix} SYSCONFDIR=$RPM_BUILD_ROOT/%{_sysconfdir} INST_PREFIX=%{_prefix} INST_SYSCONFDIR=%{_sysconfdir} INSTALLDIRS=vendor %{__make} OPTIMIZE="$RPM_OPT_FLAGS" #%make test %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %makeinstall PREFIX=%buildroot/%{prefix} \ INSTALLMAN1DIR=%buildroot/%{prefix}/share/man/man1 \ INSTALLMAN3DIR=%buildroot/%{prefix}/share/man/man3 \ LOCAL_RULES_DIR=%{buildroot}/etc/mail/spamassassin install -d %buildroot/%{initdir} install -m 0755 spamd/redhat-rc-script.sh %buildroot/%{initdir}/spamassassin mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/local.cf install -m644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/spamassassin install -m 0644 %{SOURCE3} %buildroot/etc/mail/spamassassin install -m 0644 %{SOURCE4} %buildroot/etc/mail/spamassassin mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig [ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \; find $RPM_BUILD_ROOT/usr -type f -print | sed "s@^$RPM_BUILD_ROOT@@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 %files -f %{name}-%{version}-filelist %defattr(-,root,root) %doc README Changes sample-nonspam.txt sample-spam.txt spamd/README.spamd doc %config(noreplace) %{initdir}/spamassassin %config(noreplace) %{_sysconfdir}/mail/spamassassin %config(noreplace) %{_sysconfdir}/sysconfig/spamassassin %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %post /sbin/chkconfig --add spamassassin if [ -f /etc/spamassassin.cf ]; then %{__mv} /etc/spamassassin.cf /etc/mail/spamassassin/migrated.cf fi if [ -f /etc/mail/spamassassin.cf ]; then %{__mv} /etc/mail/spamassassin.cf /etc/mail/spamassassin/migrated.cf fi %preun if [ $1 = 0 ] ; then /sbin/service spamassassin stop >/dev/null 2>&1 /sbin/chkconfig --del spamassassin fi exit 0 %changelog * Fri Nov 22 2002 Tim Powers - rebuilt to solve broken perl deps * Thu Aug 15 2002 Chip Turner - speedup patch from upstream * Tue Aug 6 2002 Chip Turner - automated release bump and build * Thu Jul 18 2002 Chip Turner - better control of service level, improvement in %post script. - (contribs from schirmer@taytron.net) * Fri Jun 28 2002 Chip Turner - added proper BuildRequire * Wed Jun 26 2002 Chip Turner - updated to 2.31, added .rc file for procmail to INCLUDERC to enable * 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.