--- /dev/null
+diff -urN clamav-0.60.orig/etc/clamav.conf clamav-0.60/etc/clamav.conf
+--- clamav-0.60.orig/etc/clamav.conf Thu Aug 28 14:14:08 2003
++++ clamav-0.60/etc/clamav.conf Thu Aug 28 14:15:09 2003
+@@ -5,12 +5,12 @@
+
+
+ # Comment or remove the line below.
+-Example
++# Example
+
+ # Uncomment this option to enable logging.
+ # LogFile must be writable for the user running the daemon.
+ # Full path is required.
+-#LogFile /tmp/clamd.log
++#LogFile /var/log/clamd.log
+
+ # By default the log file is locked for writing - the lock protects against
+ # running clamd multiple times (if want to run another clamd, please
+@@ -30,19 +30,20 @@
+ #LogTime
+
+ # Use system logger (can work together with LogFile).
+-#LogSyslog
++LogSyslog
+
+ # Enable verbose logging.
+-#LogVerbose
++# LogVerbose
+
+ # This option allows you to save the process identifier of the listening
+ # daemon (main thread).
+-#PidFile /var/run/clamd.pid
++# We use dir becouse covering clamd.pid file couse default rights are sane.
++PidFile /var/run/clamav/clamd.pid
+
+ # Path to a directory containing .db files.
+ # Default is the hardcoded directory (mostly /usr/local/share/clamav,
+ # it depends on installation options).
+-#DataDirectory /var/lib/clamav
++DataDirectory /var/lib/clamav
+
+ # The daemon works in local or network mode. Currently the local mode is
+ # recommended for security reasons.
+@@ -50,7 +51,9 @@
+ # Path to the local socket. The daemon doesn't change the mode of the
+ # created file (portability reasons). You may want to create it in a directory
+ # which is only accessible for a user running daemon.
+-LocalSocket /tmp/clamd
++# LocalSocket /var/run/clamav/clamd.socket
++
++LocalSocket /var/lib/clamav/clamd.socket
+
+ # TCP port address.
+ #TCPSocket 3310
+@@ -93,11 +96,11 @@
+
+ # Run as selected user (clamd must be started by root).
+ # By default it doesn't drop privileges.
+-#User clamav
++User clamav
+
+ # Initialize the supplementary group access (for all groups in /etc/group
+ # user is added in. clamd must be started by root).
+-#AllowSupplementaryGroups
++AllowSupplementaryGroups
+
+ # Don't fork into background. Useful in debugging.
+ #Foreground
+@@ -107,13 +110,12 @@
+ ##
+
+ # Uncomment this option if you are planning to scan mail files.
+-#ScanMail
++ScanMail
+
+ ##
+ ## Archive support
+ ##
+
+-
+ # Comment this line to disable scanning of the archives.
+ ScanArchive
+
+# TODO:
+# - Fix inconsistency:
+# clamd uses syslog but log from (crond) db update goes to
+# /var/log/clamd.log
+
%define database_version 20030813
Summary: An anti-virus utility for Unix
Summary(pl): Antywirusowe narzêdzie dla Unixów
Name: clamav
Version: 0.60
-Release: 3
+Release: 4
License: GPL
Group: Applications
Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
# gziped from http://clamav.elektrapro.com/database/:
Source3: %{name}-database-%{database_version}.tar.gz
# Source3-md5: a8848904249edd97b873a43032c0208f
+Patch0: %{name}-pld_config.patch
URL: http://www.clamav.net/
BuildRequires: autoconf
BuildRequires: automake
%prep
%setup -q -a 3
-
+%patch0 -p1
+
%build
rm -f missing
%{__aclocal}
install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
install etc/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
+# NOTE: clamd uses sane rights to it's clamd.pid file
+# So better keep it dir
+# If it is fixed use of dir will be unecesary
+install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
+# touch $RPM_BUILD_ROOT%{_var}/run/%{name}/clamd.pid
+
%clean
rm -rf $RPM_BUILD_ROOT
+# FIXME: Does %triggerin -- amavis-ng really have to written three times ?
+# It's stolen from mksd.spec - if it's wrong fix mksd.spec too
+
+%triggerin -- amavis-ng
+AMAVIS=$(/usr/bin/getgid amavis)
+RESULT=$?
+if [ $RESULT -eq 0 ]; then
+ /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
+ echo "adding clamav to amavis group GID=$AMAVIS"
+fi
+
+%triggerin -- amavisd-new
+AMAVIS=$(/usr/bin/getgid amavis)
+RESULT=$?
+if [ $RESULT -eq 0 ]; then
+ /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
+ echo "adding clamav to amavis group GID=$AMAVIS"
+fi
+
+%triggerin -- amavisd
+AMAVIS=$(/usr/bin/getgid amavis)
+RESULT=$?
+if [ $RESULT -eq 0 ]; then
+ /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
+ echo "adding clamav to amavis group GID=$AMAVIS"
+fi
+
+
%pre
if [ -n "`getgid clamav`" ]; then
if [ "`getgid clamav`" != "43" ]; then
%attr(755,clamav,root) %dir /var/lib/%{name}
%attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/mirrors.txt
%attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
+%attr(750,clamav,clamav) %dir %{_var}/run/%{name}
+# %%attr(666,clamav,clamav) %%ghost %{_var}/run/%{name}/clamd.pid
+
%attr(750,root,root) %{_sysconfdir}/cron.daily/%{name}
%attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf
%attr(754,root,root) /etc/rc.d/init.d/clamd