diff --git a/.cvsignore b/.cvsignore index e69de29..f9623c0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +Mail-SpamAssassin-2.31.tar.gz diff --git a/redhat_local.cf b/redhat_local.cf new file mode 100644 index 0000000..23344b6 --- /dev/null +++ b/redhat_local.cf @@ -0,0 +1,9 @@ +# These values can be overridden by editing ~/.spamassassin/user_prefs.cf +# (see spamassassin(1) for details) + +# These should be safe assumptions and allow for simple visual sifting +# without risking lost emails. + +required_hits 5 +rewrite_subject 1 +subject_tag [SPAM] diff --git a/sources b/sources index e69de29..8ce7d24 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +a9878b4ea035964c04c4899ee154e222 Mail-SpamAssassin-2.31.tar.gz diff --git a/spamassassin-default.rc b/spamassassin-default.rc new file mode 100644 index 0000000..2c0500c --- /dev/null +++ b/spamassassin-default.rc @@ -0,0 +1,3 @@ +# send mail through spamassassin +:0fw +| /usr/bin/spamassassin -P diff --git a/spamassassin-spamc.rc b/spamassassin-spamc.rc new file mode 100644 index 0000000..911dcd4 --- /dev/null +++ b/spamassassin-spamc.rc @@ -0,0 +1,3 @@ +# send mail through spamassassin +:0fw +| /usr/bin/spamc diff --git a/spamassassin.spec b/spamassassin.spec new file mode 100644 index 0000000..56bc2f9 --- /dev/null +++ b/spamassassin.spec @@ -0,0 +1,164 @@ +%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.31 +Release: 15 +License: Artistic +Group: Networking/Mail +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 +Patch: spamassassin-2.31-migrate.patch +Patch1: spamassassin-2.31-findbin.patch +Patch2: spamassassin-2.31-init.patch +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} +%patch -p1 +%patch1 -p1 -b .findbin +%patch2 -p1 -b .init + +%build +%{__perl} Makefile.PL PREFIX=$RPM_BUILD_ROOT%{prefix} 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 + +install -m 0644 %{SOURCE2} %buildroot/etc/mail/spamassassin/local.cf + +install -m 0644 %{SOURCE3} %buildroot/etc/mail/spamassassin +install -m 0644 %{SOURCE4} %buildroot/etc/mail/spamassassin + +mkdir -p %{buildroot}/etc/mail/spamassassin + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +install -m644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/spamassassin + +[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress + +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 TODO 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 +* 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. + diff --git a/spamassassin.sysconfig b/spamassassin.sysconfig new file mode 100644 index 0000000..5f12aa4 --- /dev/null +++ b/spamassassin.sysconfig @@ -0,0 +1,2 @@ +# Options to spamd +SPAMDOPTIONS="-d -c -a"