* http://bugzilla.spamassassin.org/show_bug.cgi?id=3450 Prevent spamassassin service from starting by default for Fedora.
* Attached krb5-backcompat.patch is conditionally patched depending on the location of the krb5.h. Would it be possible for the Makefile.PL to detect the different locations of krb5.h automatically, so we don't need this ugly hack?
Also the following I could use some comment.
* Any suggestions to improve the package "Summary" and "%description" sections?
* Is the "get rid of auto white list" regex replacement too ugly a hack? To be honest I was surprised when today's svn snapshot suddenly failed when starting the service. This behavior will bite many server administrators... many of whom would rather not read documentation and would expect things to just work. Would it not be better to print a BIG AND UGLY WARNING and not fail service startup? Perhaps also add the warning to every spam mail too, saying something like, "Tell your System Administrator that the auto-white list option is obsolete and must be removed."
* Any other questions or comments about Fedora's spamassassin packaging?
NOTE:
I know that some people really want the Fedora package to be more in sync with the upstream RPM packaging. I am very wary of doing so because of the different package split, config locations and other possible upgrade issues. Other RPM packages contain a ton of ugly triggers and special case hacks to deal with broken states left by poorly packaged or upgrade path mistakes from the past. I absolutely do not want even the risk of a poorly thought out migration from one packaging scheme to another, that may necessitate a further migration later.
I would be open to making changes like this during the FC3 development cycle only after a very thorough analysis of upgrade paths from Red Hat and Fedora's past spamassassin releases to the new packaging scheme is done. This is not something I am interested in looking at now though. I am tired of users demanding things like this without offering to put work into making it happen.
Warren Togami [EMAIL PROTECTED]
diff -urN Mail-SpamAssassin-2.63.orig/Makefile.PL Mail-SpamAssassin-2.63/Makefile.PL --- Mail-SpamAssassin-2.63.orig/Makefile.PL 2004-01-17 18:56:12.000000000 -0500 +++ Mail-SpamAssassin-2.63/Makefile.PL 2004-01-21 07:45:14.000000000 -0500 @@ -962,7 +962,7 @@ $(MAKE) -f spamd/binaries.mk $@ spamd/binaries.mk: spamd/configure - cd spamd; ./configure --prefix="$(I_PREFIX)" --sysconfdir="$(I_SYSCONFDIR)" --datadir="$(I_DATADIR)" --enable-ssl="$(ENABLE_SSL)" + cd spamd; ./configure --prefix="$(I_PREFIX)" --sysconfdir="$(I_SYSCONFDIR)" --datadir="$(I_DATADIR)" --enable-ssl="$(ENABLE_SSL) --includedir=/usr/kerberos/include" conf__install: -$(MKPATH) $(B_CONFDIR)
%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)
Summary: Spam filter for email which can be invoked from mail delivery agents.
Name: %{name}
Version: 3.0
Release: 0.0.svn20040530
License: Apache License
Group: Applications/Internet
URL: http://spamassassin.org/
# Subversion Snapshot
# http://wiki.apache.org/spamassassin/DownloadFromSvn
Source0: Mail-SpamAssassin-3.0-svn20040530.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-2.63-krb5-backcompat.patch
# SEND TO UPSTREAM: disable service by default
Patch4: spamassassin-3.0-disable_service.patch
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Buildroot: %{_tmppath}/%{name}-root
Prefix: %{_prefix}
Requires: /sbin/chkconfig /sbin/service
BuildRequires: perl-Net-DNS
BuildRequires: perl >= 2:5.8.0
BuildRequires: perl-Time-HiRes
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 spamassassin
# %%setup -q -n %{real_name}-%{version}
# Backwards compatibility with older krb5-devel
echo %{krb5backcompat}
%if %{krb5backcompat}
%patch3 -p1
%endif
# SEND TO UPSTREAM: disable service by default
%patch4 -p1
%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/usr -type f -print |
sed "[EMAIL PROTECTED]@@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
%doc LICENSE
%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/ -a//' /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 May 30 2004 Warren Togami <[EMAIL PROTECTED]> - 3.0-svn20040530
- svn snapshot 20040530
- prevent service startup failure due to old -a option
* Tue May 24 2004 Warren Togami <[EMAIL PROTECTED]> - 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ä <ville.skytta at iki.fi> - 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.
