Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > 5dceb4e874e510c42c62260febcf447c > files > 7

amavis-postfix-0.3.12-3mdk.src.rpm

%define name	amavis-postfix
%define version	0.3.12
%define rel	3

%define build_plf 0
%{?_with_plf: %{expand: %%define build_plf 1}}

%if %build_plf
%define release %{rel}plf
%else
%define release %{rel}mdk
%endif

%define use_syslog	1
%define use_xheader	1
%define use_allscanners 1

Summary:	A Mail Virus Scanner
Name:		amavis-postfix
Version:	%{version}
Release:	%{release}
URL:		http://amavis.sf.net
Source0:	http://switch.dl.sourceforge.net/sourceforge/amavis/amavis-0.3.12.tar.bz2
Patch0:		amavis-0.3.12-localdomain.patch.bz2
Patch1:		amavis-0.3.12-nomarch.patch.bz2
Patch2:		amavis-0.3.12-nozoo.patch.bz2
Patch3:		amavis-0.3.12-nounarj.patch.bz2
Patch4:		amavis-0.3.12-nounrar.patch.bz2
License:	GPL
Group:		Networking/Mail
BuildRequires:	postfix
BuildRequires:	perl-Archive-Tar
BuildRequires:	perl-Archive-Zip
BuildRequires:	perl-Compress-Zlib
BuildRequires:	perl-Convert-UUlib
BuildRequires:	perl-Convert-TNEF
BuildRequires:	perl-Unix-Syslog
%if %build_plf
BuildRequires:	arc
%else
BuildRequires:  nomarch
%endif
BuildRequires:	bzip2
BuildRequires:	lha
BuildRequires:  ncompress
%if %build_plf
BuildRequires:	unarj
BuildRequires:	unrar
BuildRequires:	zoo
%endif
Requires:	postfix
Requires:	perl-Archive-Tar
Requires:	perl-Archive-Zip
Requires:	perl-Compress-Zlib
Requires:	perl-Convert-UUlib
Requires:	perl-Convert-TNEF
Requires:	perl-Unix-Syslog
%if %build_plf
Requires:	arc
%else
Requires:	nomarch
%endif
Requires:	bzip2
Requires:	lha
Requires:	ncompress
%if %build_plf
Requires:	unarj
Requires:	unrar
Requires:	zoo
%endif
Conflicts:	amavisd
Provides:	amavis
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildArch:	noarch
PreReq:		rpm-helper >= 0.3

%description
AMaViS is a perl script that interfaces a Mail Transport Agent (MTA)
with one or more virus scanners (not provided).

For completing AMaVIS installation you need to modify the 
/etc/postfix/main.cf and /etc/postfix/master.cf files as described in
the documentation file README.postfix.

%prep
%setup -q -n amavis-%{version}
%patch0 -p1 -b .localdomain
%if !%build_plf
%patch1 -p1 -b .nomarch
%patch2 -p1 -b .nozoo
%patch3 -p1 -b .unarj
%patch4 -p1 -b .unrar
%endif

%build
%configure \
	--prefix=%{_prefix} \
	--enable-postfix \
	--with-virusdir=/var/spool/amavis/virusmails \
	--with-runtime-dir=/var/spool/amavis/runtime \
%if %use_allscanners
	--enable-all \
%endif
%if %use_syslog
	--enable-syslog \
%else
	--with-logdir=/var/log/amavis \
%endif
	--with-amavisuser=amavis \
	--with-warnrecip \
	--without-warnsender \
	--with-warnadmin \
%if !%use_xheader
	--disable-x-header \
%endif
	--with-mailto=virusalert

make

# the check needs zoo
%if %build_plf
make check
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%pre
%_pre_useradd amavis /var/spool/amavis /bin/false
%_pre_groupadd amavis amavis

%install
rm -rf $RPM_BUILD_ROOT
make install amavisuser=$(id -u) DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/var/log/amavis \
	$RPM_BUILD_ROOT%_sysconfdir
touch $RPM_BUILD_ROOT%_sysconfdir/amavis-localdomains.conf

%post
grep -q "virusalert" %_sysconfdir/aliases || \
	echo "virusalert:\troot" >> %_sysconfdir/aliases

%files
%defattr(-,root,root)
%doc AUTHORS BUGS COPYING ChangeLog FAQ HINTS INSTALL NEWS README* TODO
%doc VERSION doc
%config(noreplace) %attr(644,root,root) %_sysconfdir/amavis-localdomains.conf
%attr(755,root,root) %_sbindir/*
%attr(755,amavis,amavis) %dir /var/spool/amavis/virusmails
%attr(755,amavis,amavis) %dir /var/spool/amavis/runtime
%if !%use_syslog
%attr(755,amavis,amavis) %dir /var/log/amavis
%endif

%changelog
* Wed Dec 10 2003 Franck Villaume <fvill@freesurf.fr> 0.3.12-3mdk
- need postfix to rebuild

* Sat Jun 21 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.3.12-2mdk
- Added Mark Martinek patch to use "nomarch" instead of "arc".
- Added Patches to work without zoo, unarj and unarj (because they are 
  not free).

* Sat Jun 21 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.3.12-1mdk
- Initial release.