rpms/clamav/devel clamav.spec,1.27,1.28
David Woodhouse (dwmw2)
fedora-extras-commits at redhat.com
Sat Sep 10 11:20:28 UTC 2005
Author: dwmw2
Update of /cvs/extras/rpms/clamav/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7624
Modified Files:
clamav.spec
Log Message:
add clamav-exim subpackage
Index: clamav.spec
===================================================================
RCS file: /cvs/extras/rpms/clamav/devel/clamav.spec,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- clamav.spec 29 Jul 2005 16:29:09 -0000 1.27
+++ clamav.spec 10 Sep 2005 11:20:26 -0000 1.28
@@ -14,6 +14,9 @@
%global milterlog %_var/log/clamd.milter
%global milteruser clamilt
%global milterstatedir %_var/run/clamav-milter
+%global clameximlog %_var/log/clamd.exim
+%global clameximuser clamexim
+%global clameximstatedir %_var/run/clamd.exim
%global pkgdatadir %_datadir/%name
@@ -22,7 +25,7 @@
Summary: End-user tools for the Clam Antivirus scanner
Name: clamav
Version: 0.86.2
-Release: %release_func 4
+Release: %release_func 5
License: GPL
Group: Applications/File
@@ -107,6 +110,21 @@
Requires(pre): fedora-usermgmt >= 0.7
Requires(postun): fedora-usermgmt >= 0.7
+%package exim
+Summary: Exim dæmon configuration for the Clam Antivirus scanner
+Group: System Environment/Daemons
+## For now, use this as a placeholder. Later, generate separate -sysv
+## and -minit subpackages
+Requires: init(clamav-exim)
+Provides: init(clamav-exim)
+Requires(pre): exim
+Requires(pre): %_initrddir
+Requires(postun): %_initrddir initscripts
+Requires(post): chkconfig coreutils
+Requires(preun): chkconfig initscripts
+Requires(pre): fedora-usermgmt >= 0.7
+Requires(postun): fedora-usermgmt >= 0.7
+
%description
Clam AntiVirus is an anti-virus toolkit for UNIX. The main purpose of this
@@ -159,6 +177,22 @@
THIS PACKAGE IS TO BE CONSIDERED AS EXPERIMENTAL!
+%description exim
+This package contains files which are needed to run the clamav dæmon for use
+by the Exim MTA. It can be activated by adding
+
+ av_scanner = clamd:%clameximstatedir/clamd.sock
+
+to your exim.conf, and using the 'malware' condition in the data ACL,
+as follows:
+
+ deny message = This message contains malware ($malware_name)
+ demime = *
+ malware = *
+
+For further details of Exim content scanning, see chapter 40 of the Exim
+specification: http://www.exim.org/exim-html-4.50/doc/html/spec_40.html
+
## ------------------------------------------------------------
%prep
@@ -226,6 +260,7 @@
${RPM_BUILD_ROOT}%{_sysconfdir}/{clamd.d,cron.d,logrotate.d,sysconfig} \
${RPM_BUILD_ROOT}%{_var}/log \
${RPM_BUILD_ROOT}%milterstatedir \
+ ${RPM_BUILD_ROOT}%clameximstatedir \
${RPM_BUILD_ROOT}%pkgdatadir/template \
${RPM_BUILD_ROOT}%{_initrddir}
@@ -268,15 +303,34 @@
$RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep
-%if 0%{!?_without_milter:1}
-#### The milter stuff
+#### The Exim stuff
function subst() {
- sed -e 's!<SERVICE>!milter!g;s!<USER>!%milteruser!g;'"$3" "$1" >"$RPM_BUILD_ROOT$2"
+ sed -e "s!<SERVICE>!$3!g;s!<USER>!$4!g;""$5" "$1" >"$RPM_BUILD_ROOT$2"
}
+subst etc/clamd.conf %_sysconfdir/clamd.d/exim.conf exim %clameximuser \
+ 's!^##*\(\(LogFile\|LocalSocket\|PidFile\|User\)\s\|\(StreamSaveToDisk\|ScanMail\|LogTime\|ScanArchive\)$\)!\1!;s!^Example!#Example!;'
-subst etc/clamd.conf /etc/clamd.d/milter.conf \
+
+subst %{SOURCE7} %_initrddir/clamd.exim exim %clameximuser ''
+chmod 0755 $RPM_BUILD_ROOT%_initrddir/clamd.exim
+subst %{SOURCE3} %_sysconfdir/logrotate.d/clamd.exim exim %clameximuser ''
+
+cat <<EOF >$RPM_BUILD_ROOT%_sysconfdir/sysconfig/clamd.exim
+CLAMD_CONFIG='%_sysconfdir/clamd.d/exim.conf'
+CLAMD_SOCKET=%clameximstatedir/clamd.sock
+EOF
+
+mkdir -p $RPM_BUILD_ROOT/%clameximstatedir
+ln -sf clamd $RPM_BUILD_ROOT%_sbindir/clamd.exim
+
+touch $RPM_BUILD_ROOT%clameximstatedir/clamd.sock $RPM_BUILD_ROOT%clameximlog
+
+%if 0%{!?_without_milter:1}
+#### The milter stuff
+
+subst etc/clamd.conf /etc/clamd.d/milter.conf milter %milteruser \
's!^##*\(\(LogFile\|LocalSocket\|PidFile\|User\)\s\|\(StreamSaveToDisk\|ScanMail\)$\)!\1!;'
@@ -337,6 +391,26 @@
test "$1" != 0 || /usr/sbin/fedora-groupdel %{milteruser} &>/dev/null || :
test "$1" = 0 || %{_initrddir}/clamav-milter condrestart >/dev/null || :
+%pre exim
+/usr/sbin/fedora-useradd 5 -r -s /sbin/nologin -d %clameximstatedir -M \
+ -c 'Clamav Exim User' -g exim %clameximuser &>/dev/null || :
+
+%post exim
+/sbin/chkconfig --add clamd.exim
+test -e %clameximlog || {
+ touch %clameximlog
+ chmod 0620 %clameximlog
+ chown root:exim %clameximlog
+}
+
+%preun exim
+test "$1" != 0 || %{_initrddir}/clamd.exim stop &>/dev/null || :
+test "$1" != 0 || /sbin/chkconfig --del clamd.exim
+
+%postun exim
+test "$1" != 0 || /usr/sbin/fedora-userdel %{clameximuser} &>/dev/null || :
+test "$1" = 0 || %{_initrddir}/clamd.exim condrestart >/dev/null || :
+
%post lib -p /sbin/ldconfig
%postun lib -p /sbin/ldconfig
@@ -414,6 +488,19 @@
## -----------------------
+%files exim
+%defattr(-,root,root,-)
+%_sbindir/clamd.exim
+%config %{_initrddir}/clamd.exim
+%config(noreplace) %verify(not mtime) %{_sysconfdir}/clamd.d/exim.conf
+%config(noreplace) %verify(not mtime) %{_sysconfdir}/sysconfig/clamd.exim
+%config(noreplace) %verify(not mtime) %{_sysconfdir}/logrotate.d/clamd.exim
+%attr(0750,%clameximuser,exim) %dir %clameximstatedir
+%ghost %clameximstatedir/*
+%ghost %attr(0620,root,exim) %verify(not size md5 mtime) %clameximlog
+
+## -----------------------
+
%files milter
%defattr(-,root,root,-)
%doc clamav-milter/INSTALL
@@ -428,6 +515,9 @@
%endif # _without_milter
%changelog
+* Fri Sep 9 2005 David Woodhouse <dwmw2 at infradead.org> - 0.86.2-5
+- Add clamav-exim configuration package
+
* Fri Jul 29 2005 Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de> - 0.86.2-4
- [milter] create the milter-logfile in the %%post scriptlet
- [milter] reverted the change of the default child_timeout value; it
More information about the fedora-extras-commits
mailing list