%define _use_internal_dependency_generator 0 %define name spamassassin %define real_name Mail-SpamAssassin %define krb5backcompat %([ -a /usr/kerberos/include/krb5.h ] && echo 1 || echo 0) %{!?perl_vendorlib: %define perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)} Summary: Spam filter for email which can be invoked from mail delivery agents. Name: %{name} Version: 3.0 Release: 7.rc2 License: Apache License Group: Applications/Internet URL: http://spamassassin.org/ Source0: Mail-SpamAssassin-3.0.0-rc2.tar.bz2 Source2: redhat_local.cf Source3: spamassassin-default.rc Source4: spamassassin-spamc.rc Source5: spamassassin.sysconfig Source10: spamassassin-helper.sh Source99: filter-requires-spamassassin.sh Patch3: spamassassin-3.0-krb5-backcompat.patch Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Buildroot: %{_tmppath}/%{name}-root Prefix: %{_prefix} Requires: /sbin/chkconfig /sbin/service BuildRequires: perl >= 2:5.8.0 BuildRequires: perl(Net::DNS) BuildRequires: perl(Time::HiRes) BuildRequires: perl(HTML::Parser) BuildRequires: openssl-devel 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 Mail-SpamAssassin-3.0.0 # %%setup -q -n %{real_name}-%{version} # Backwards compatibility with older krb5-devel echo %{krb5backcompat} %if %{krb5backcompat} %patch3 -p1 %endif %build export CFLAGS="$RPM_OPT_FLAGS" %{__perl} Makefile.PL DESTDIR=$RPM_BUILD_ROOT/ SYSCONFDIR=%{_sysconfdir} INSTALLDIRS=vendor ENABLE_SSL=yes < /dev/null %{__make} OPTIMIZE="$RPM_OPT_FLAGS" #%make test %install rm -rf $RPM_BUILD_ROOT %makeinstall PREFIX=%buildroot/%{prefix} \ INSTALLMAN1DIR=%buildroot/%{_mandir}/man1 \ INSTALLMAN3DIR=%buildroot/%{_mandir}/man3 \ LOCAL_RULES_DIR=%{buildroot}/etc/mail/spamassassin chmod 755 %buildroot/%{_bindir}/* # allow stripping install -d %buildroot/%{_initrddir} install -m 0755 spamd/redhat-rc-script.sh %buildroot/%{_initrddir}/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 install -m 0755 %{SOURCE10} %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 -type d -depth -exec rmdir {} 2>/dev/null ';' 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 find $RPM_BUILD_ROOT%{perl_vendorlib}/* -type d -print | sed "s@^$RPM_BUILD_ROOT@%dir @g" >> %{name}-%{version}-filelist %files -f %{name}-%{version}-filelist %defattr(-,root,root) %doc BUGS LICENSE CREDITS Changes README STATUS TRADEMARK UPGRADE %doc USAGE sample-nonspam.txt sample-spam.txt %config(noreplace) %{_initrddir}/spamassassin %config(noreplace) %{_sysconfdir}/mail/spamassassin %config(noreplace) %{_sysconfdir}/sysconfig/spamassassin %clean rm -rf $RPM_BUILD_ROOT %post /sbin/chkconfig --add spamassassin # -a and --auto-whitelist options were removed from 3.0.0 # prevent service startup failure perl -p -i -e 's/(["\s]-\w+)a/$1/ ; s/(["\s]-)a(\w+)/$1$2/ ; s/(["\s])-a\b/$1/' /etc/sysconfig/spamassassin perl -p -i -e 's/ --auto-whitelist//' /etc/sysconfig/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 %postun if [ "$1" -ge "1" ]; then /sbin/service spamassassin condrestart > /dev/null 2>&1 fi %preun if [ $1 = 0 ] ; then /sbin/service spamassassin stop >/dev/null 2>&1 /sbin/chkconfig --del spamassassin fi exit 0 %changelog * Sun Aug 29 2004 Warren Togami - 3.0-7.rc2 - 3.0 rc2 * Sat Aug 21 2004 Warren Togami - 3.0-6.rc1 - fix perl module syntax in req and buildreqs * Thu Aug 19 2004 Warren Togami - 3.0-5.rc1 - 3.0 rc1 * Sat Aug 07 2004 Warren Togami - 3.0-3.pre4 - 3.0 pre4 * Wed Jul 28 2004 Warren Togami - 3.0-3.pre2 - 3.0 pre2 * Mon Jun 20 2004 Warren Togami - 3.0-2.pre1 - 3.0.0 pre1 - remove unnecessary patches applied upstream - update krb5 backcompat patch * Tue Jun 15 2004 Elliot Lee - rebuilt * Mon May 31 2004 Warren Togami - 3.0-svn20040530 - svn snapshot 20040530 - #124870 prevent service startup failure due to old -a option - #124871 more docs - #124872 unowned directories * Tue May 24 2004 Warren Togami - 3.0-svn20040524 - #123432 do not start service by default - #122488 remove CRLF's - #123706 correct license - svn snapshot 20040524 - svn snapshot 20040518 * Sun May 2 2004 Ville Skyttä - 2.63-8 - #122233 - Require perl(:MODULE_COMPAT_*). - Use %%{_mandir} and %%{_initrddir}. - Fix License tag and include License in docs. - Backslashify multiline init script description. * Fri Feb 13 2004 Elliot Lee - rebuilt * Wed Feb 11 2004 Warren Togami 2.63-6 - require sitelib instead * Wed Jan 21 2004 Warren Togami 2.63-3 - krb5-backcompat.patch so older krb5-devel does not fail * Wed Jan 21 2004 Warren Togami 2.63-2 - upgrade to 2.63 * Mon Jan 19 2004 Warren Togami 2.62-3 - Ville Skyttä's fixes from #113596 including: - Fix buildroot traces - enable openssl - Trailing slash to DESTDIR (bug 90202 comment 14). - export optflags so they're honored, affects spamc only. * Mon Jan 19 2004 Warren Togami 2.62-2 - upgrade to 2.62 - Prereq -> Requires, former is deprecated - Require current version of perl - Remove urban myth clean test - TODO: Get rid of prefix * Wed Dec 31 2003 Dan Walsh 2.61-2 - Change sysconfdir to not use full path * Tue Dec 9 2003 Chip Turner 2.61-1 - upgrade to 2.61 * Fri Sep 26 2003 Chip Turner 2.60-2 - update to 2.60 * Sat Jul 5 2003 Chip Turner 2.55-3 - change perl dependency to more accurate versions with explicit epochs * Wed Jun 04 2003 Elliot Lee - rebuilt * Sat May 31 2003 Chip Turner 2.55-1 - move to upstream version 2.55 * Tue May 13 2003 Chip Turner - bump for build - change init.d script to not default to started * Sun May 04 2003 Florian La Roche - remove Distribution: tag in spec file * Wed Apr 16 2003 Chip Turner 2.53-5 - remove SIGCHILD patch to properly return it to SIG_IGN now that waitpid isn't used on Linux * Mon Apr 14 2003 Chip Turner 2.53-4.8.x - update to 2.53 from upstream * Fri Mar 21 2003 Chip Turner 2.50-3.8.x - update patch for servicename; should fix restarting/runlevel issues (#85975) * Thu Mar 13 2003 Chip Turner 2.50-2.8.x - update to 2.50 * Tue Feb 25 2003 Elliot Lee - rebuilt * Fri Feb 21 2003 Chip Turner - revert double fix for 84774 * Mon Feb 17 2003 Bill Nottingham - fix startup (#84445) * Thu Feb 13 2003 Bill Nottingham - fix paths in initscript (#84216) * Thu Feb 13 2003 Chip Turner - removing -P option since it is the default now, bug 84144 * Wed Feb 12 2003 Florian La Roche - fix SIGCHLD handling * Mon Feb 10 2003 Bill Nottingham - move condrestart to %postun * Sun Feb 2 2003 Chip Turner - update to 2.44 - add condrestart to service script * Thu Jan 30 2003 Chip Turner - release bump and rebuild * Wed Jan 29 2003 Chip Turner - add upstream bsmtp off-by-one patch * Mon Jan 20 2003 Chip Turner - add wrapper for 'spamassassin -e' for native evolution spam filtering * Sat Jan 4 2003 Jeff Johnson 2.43-10 - use internal dep generator. * Wed Jan 1 2003 Chip Turner - rebuild * Tue Dec 17 2002 Bill Nottingham 2.43-7 - don't run by default * Sat Dec 14 2002 Tim Powers 2.43-6 - don't use rpms internal dep generator - buildrequire perl-Time-HiRes instead of perl(Time:HiRes) so we can satisfy build deps in the build system * 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.