Blob Blame History Raw
Summary: Transparent SMTP/LMTP proxy filter using spamassassin
Name: spampd
Version: 2.30
Release: 4
License: GPLv2+
Group: System Environment/Daemons
URL: http://www.worlddesign.com/index.cfm/rd/mta/spampd.htm
Source0: http://www.worlddesign.com/Content/rd/mta/spampd/spampd-%{version}.tar.gz
Source1: spampd.init
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/service, /sbin/chkconfig
Requires(postun): /sbin/service
BuildArch: noarch

%description
Spampd is a program used within an e-mail delivery system to scan messages for
possible Unsolicited Commercial E-mail (UCE, aka spam) content. It uses
SpamAssassin (SA) to do the actual message scanning. Spampd acts as a
transparent SMTP/LMTP proxy between two mail servers, and during the
transaction it passes the mail through SA. If SA decides the mail could be
spam, then spampd will ask SA to add some headers and a report to the message
indicating it's spam and why.


%prep
%setup -q
%{__rm} -f spampd.html
%{__chmod} -x changelog.txt


%build
%{__make} spampd.8
%{__make} spampd.html


%install
%{__rm} -rf %{buildroot}
# Main program
%{__install} -D -p -m 0755 spampd \
    %{buildroot}%{_sbindir}/spampd
# Man page
%{__install} -D -p -m 0644 spampd.8 \
    %{buildroot}%{_mandir}/man8/spampd.8
# Init script
%{__install} -D -p -m 0755 %{SOURCE1} \
    %{buildroot}%{_sysconfdir}/rc.d/init.d/spampd
# Home directory
%{__mkdir_p} %{buildroot}/var/spool/spampd


%clean
%{__rm} -rf %{buildroot}


%pre
/usr/sbin/useradd -r -M -s /sbin/nologin -d /var/spool/spampd \
    spampd &>/dev/null || :

%post
/sbin/chkconfig --add spampd

%preun
if [ $1 -eq 0 ]; then
    /sbin/service spampd stop &>/dev/null || :
    /sbin/chkconfig --del spampd
fi

%postun
if [ $1 -ge 1 ]; then
    /sbin/service spampd condrestart &>/dev/null || :
fi


%files
%defattr(-,root,root,-)
%doc changelog.txt spampd.html
%{_sysconfdir}/rc.d/init.d/spampd
%{_sbindir}/spampd
%{_mandir}/man8/spampd.8*
%attr(0750,spampd,spampd) /var/spool/spampd/


%changelog
* Mon Aug  6 2007 Matthias Saou <http://freshrpms.net/> 2.30-4
- Update License field.
- Remove dist tag, since the package will seldom change.

* Mon Jan 29 2007 Matthias Saou <http://freshrpms.net/> 2.30-3
- Fix %%pre typo (/dev/nulll).
- Silence %%setup.
- Add scriplet chkconfig and service requirements.

* Tue Nov  7 2006 Matthias Saou <http://freshrpms.net/> 2.30-2
- Initial RPM release.