File clamsmtp.spec of Package clamsmtp

# This spec file was generated using Kpp
# If you find any problems with this spec file please report
# the error to ian geiser <geiseri@msoe.edu>

Summary:   clamsmtp replaces avmailgate
Name:      clamsmtp
Version:   1.10
Release:   1
License:   GPL
Url:       http://memberwebs.com/nielsen/software/clamsmtp/
Group:     System/Security/Mail
Source0:   %{name}-%{version}.tar.bz2
Source1:   clamsmtpd.rc
Source2:   sysconfig.clamsmtp
Source3:   email-virus-notification.sh
Source4:   cron.clamsmtp
Patch0:	   overflow.patch
Patch1:	   eregion.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Requires:  clamav procmail syslog

%if 0%{?suse_version} >= 1230
Requires:                       sysvinit-tools
BuildRequires:                  sysvinit-tools
%endif

%description
ClamSMTP is an SMTP filter that allows you to check for viruses using the
ClamAV anti-virus software. It accepts SMTP connections and forwards the
SMTP commands and responses to another SMTP server. The 'DATA' email body is
intercepted and scanned before forwarding. ClamSMTP aims to be lightweight,
reliable, and simple rather than have a myriad of options. It's written in C
without major dependencies. If you need more options then you could use
something big like AMaViS which is written in PERL and can do almost
anything.

%prep
%setup
%patch0 -p1
%patch1 -p0

cp $RPM_SOURCE_DIR/README.suse $RPM_SOURCE_DIR/README.postfix .

CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure \
                --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
                $LOCALFLAGS
%debug_package

%build
# Setup for parallel builds
numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
if [ "$numprocs" = "0" ]; then
  numprocs=1
fi

make -j$numprocs

%install
make install-strip DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/cron.daily
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/var/spool/clamsmtp
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates

install doc/clamsmtpd.conf $RPM_BUILD_ROOT/etc
install $RPM_SOURCE_DIR/sysconfig.clamsmtp $RPM_BUILD_ROOT/var/adm/fillup-templates/
install -m 755 $RPM_SOURCE_DIR/email-virus-notification.sh $RPM_BUILD_ROOT/usr/sbin
install -m 755 $RPM_SOURCE_DIR/cron.clamsmtp $RPM_BUILD_ROOT/etc/cron.daily/clamsmtp
install $RPM_SOURCE_DIR/clamsmtpd.rc $RPM_BUILD_ROOT/etc/init.d/clamsmtpd
ln -sf ../../etc/init.d/clamsmtpd $RPM_BUILD_ROOT/usr/sbin/rcclamsmtpd

cd $RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT/*
rm -rf $RPM_BUILD_DIR/clamsmtp


%files
%defattr (-,root,root)
/etc/init.d/clamsmtpd
/etc/cron.daily/clamsmtp
/usr/sbin/clamsmtpd
%attr(0755,vscan,root) /usr/sbin/email-virus-notification.sh
/usr/sbin/rcclamsmtpd
/usr/share/man/man5/clamsmtpd.conf.5.gz
/usr/share/man/man8/clamsmtpd.8.gz
/var/adm/fillup-templates/sysconfig.clamsmtp
%dir %attr(0770,root,vscan) /var/spool/clamsmtp
%config /etc/clamsmtpd.conf
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README README.suse README.postfix

%preun
/etc/init.d/clamsmtpd stop

%post
touch /etc/sysconfig/clamsmtp
fillup -m -r /etc/sysconfig/clamsmtp /var/adm/fillup-templates/sysconfig.clamsmtp

%changelog
* Fri Apr 13 2007 admin@eregion.de
- added two readme files for suse
* Thu Apr 5 2007 - admin@eregion.de
- now with notification script and configuration in /etc/sysconfig
- more sensible defaults in clamsmtp.rc
- clamsmtp.rc now marked as config