Author: oden
Date: Wed Feb 14 16:15:35 2007
New Revision: 120938

Modified:
   packages/cooker/clamav/current/SOURCES/clamav-0.90-mdv-config.patch
   packages/cooker/clamav/current/SOURCES/clamav-clamd.init
   packages/cooker/clamav/current/SOURCES/clamav-freshclamd.init
   packages/cooker/clamav/current/SPECS/clamav.spec

Log:
- make it work
- added the clamdmon sub package


Modified: packages/cooker/clamav/current/SOURCES/clamav-0.90-mdv-config.patch
==============================================================================
--- packages/cooker/clamav/current/SOURCES/clamav-0.90-mdv-config.patch 
(original)
+++ packages/cooker/clamav/current/SOURCES/clamav-0.90-mdv-config.patch Wed Feb 
14 16:15:35 2007
@@ -1,6 +1,15 @@
---- etc/clamd.conf     2007-02-12 18:18:42.000000000 +0000
-+++ clamd.conf.tpg     2007-02-14 01:41:15.000000000 +0000
-@@ -11,7 +11,7 @@
+diff -Naur clamav-0.90/etc/clamd.conf clamav-0.90.oden/etc/clamd.conf
+--- clamav-0.90/etc/clamd.conf 2007-02-12 19:18:42.000000000 +0100
++++ clamav-0.90.oden/etc/clamd.conf    2007-02-14 15:20:47.000000000 +0100
+@@ -3,15 +3,11 @@
+ ## Please read the clamd.conf(5) manual before editing this file.
+ ##
+ 
+-
+-# Comment or remove the line below.
+-Example
+-
+ # Uncomment this option to enable logging.
  # LogFile must be writable for the user running daemon.
  # A full path is required.
  # Default: disabled
@@ -9,7 +18,7 @@
  
  # By default the log file is locked for writing - the lock protects against
  # running clamd multiple times (if want to run another clamd, please
-@@ -49,27 +49,27 @@
+@@ -49,27 +45,27 @@
  
  # Enable verbose logging.
  # Default: no
@@ -25,7 +34,7 @@
  # Optional path to the global temporary directory.
  # Default: system specific (usually /tmp or /var/tmp).
 -#TemporaryDirectory /var/tmp
-+TemporaryDirectory /var/lib/clamav
++TemporaryDirectory /var/lib/clamav/tmp
  
  # Path to the database directory.
  # Default: hardcoded (depends on installation options)
@@ -42,7 +51,7 @@
  
  # Remove stale socket after unclean shutdown.
  # Default: no
-@@ -107,12 +107,12 @@
+@@ -107,12 +103,12 @@
  
  # Maximum number of threads running at the same time.
  # Default: 10
@@ -57,7 +66,7 @@
  
  # Waiting for a new job will timeout after this time (seconds).
  # Default: 30
-@@ -124,11 +124,11 @@
+@@ -124,11 +120,11 @@
  
  # Follow directory symlinks.
  # Default: no
@@ -71,7 +80,7 @@
  
  # Perform a database check.
  # Default: 1800 (30 min)
-@@ -142,11 +142,11 @@
+@@ -142,11 +138,11 @@
  # Run as another user (clamd must be started by root to make this option
  # working).
  # Default: don't drop privileges
@@ -85,7 +94,7 @@
  
  # Stop daemon when libclamav reports out of memory condition.
  #ExitOnOOM yes
-@@ -179,12 +179,12 @@
+@@ -179,12 +175,12 @@
  # required for decompression of popular executable packers such as UPX, FSG,
  # and Petite.
  # Default: yes
@@ -100,7 +109,7 @@
  
  # With this option clamav will try to detect broken executables (both PE and
  # ELF) and mark them as Broken.Executable.
-@@ -199,7 +199,7 @@
+@@ -199,7 +195,7 @@
  # This option enables scanning of OLE2 files, such as Microsoft Office
  # documents and .msi files.
  # Default: yes
@@ -109,7 +118,7 @@
  
  ##
  ## Mail files
-@@ -207,7 +207,7 @@
+@@ -207,7 +203,7 @@
  
  # Enable internal e-mail scanner.
  # Default: yes
@@ -118,7 +127,7 @@
  
  # If an email contains URLs ClamAV can download and scan them.
  # WARNING: This option may open your system to a DoS attack.
-@@ -222,7 +222,7 @@
+@@ -222,7 +218,7 @@
  # With this option enabled ClamAV will try to detect phishing attempts by 
using
  # signatures.
  # Default: yes
@@ -127,7 +136,7 @@
  
  
  # Scan urls found in mails for phishing attempts.
-@@ -257,7 +257,7 @@
+@@ -257,7 +253,7 @@
  
  # Perform HTML normalisation and decryption of MS Script Encoder code.
  # Default: yes
@@ -136,7 +145,7 @@
  
  
  ##
-@@ -266,7 +266,7 @@
+@@ -266,7 +262,7 @@
  
  # ClamAV can scan within archives and compressed files.
  # Default: yes
@@ -145,9 +154,17 @@
  
  # The options below protect your system against Denial of Service attacks
  # using archive bombs.
---- etc/freshclam.conf 2007-02-11 09:54:46.000000000 +0000
-+++ freshclam.conf.tpg 2007-02-14 01:34:01.000000000 +0000
-@@ -10,15 +10,15 @@
+diff -Naur clamav-0.90/etc/freshclam.conf clamav-0.90.oden/etc/freshclam.conf
+--- clamav-0.90/etc/freshclam.conf     2007-02-11 10:54:46.000000000 +0100
++++ clamav-0.90.oden/etc/freshclam.conf        2007-02-14 15:21:16.000000000 
+0100
+@@ -3,22 +3,18 @@
+ ## Please read the freshclam.conf(5) manual before editing this file.
+ ##
+ 
+-
+-# Comment or remove the line below.
+-Example
+-
  # Path to the database directory.
  # WARNING: It must match clamd.conf's directive!
  # Default: hardcoded (depends on installation options)
@@ -166,7 +183,7 @@
  
  # Use system logger (can work together with UpdateLogFile).
  # Default: no
-@@ -31,16 +31,16 @@
+@@ -31,16 +27,16 @@
  
  # This option allows you to save the process identifier of the daemon
  # Default: disabled
@@ -186,7 +203,7 @@
  
  # Use DNS to verify virus database version. Freshclam uses DNS TXT records
  # to verify database and software versions. With this directive you can change
-@@ -48,7 +48,7 @@
+@@ -48,7 +44,7 @@
  # WARNING: Do not touch it unless you're configuring freshclam to use your
  # own database verification domain.
  # Default: current.cvd.clamav.net
@@ -195,7 +212,7 @@
  
  # Uncomment the following line and replace XY with your country
  # code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
-@@ -62,15 +62,15 @@
+@@ -62,15 +58,15 @@
  
  # How many attempts to make before giving up.
  # Default: 3 (per mirror)
@@ -214,7 +231,7 @@
  
  # Proxy settings
  # Default: disabled
-@@ -92,7 +92,7 @@
+@@ -92,7 +88,7 @@
  
  # Send the RELOAD command to clamd.
  # Default: no

Modified: packages/cooker/clamav/current/SOURCES/clamav-clamd.init
==============================================================================
--- packages/cooker/clamav/current/SOURCES/clamav-clamd.init    (original)
+++ packages/cooker/clamav/current/SOURCES/clamav-clamd.init    Wed Feb 14 
16:15:35 2007
@@ -28,13 +28,14 @@
 [ -x /usr/sbin/clamd ] || exit 0
 
 USER=`grep '^User\b' /etc/clamd.conf|awk '{ print $2}'`
-LOGFILE=`grep '^LogFile\b' /etc/clamd.conf|awk '{ print $2}'`
+PIDFILE=`grep '^PidFile\b' /etc/clamd.conf|awk '{ print $2}'`
+LOCALSOCKET=`grep '^LocalSocket\b' /etc/clamd.conf|awk '{ print $2}'`
 
 # See how we were called.
 case "$1" in
   start)
        echo -n "Starting Clam AntiVirus Daemon: "
-       touch ${LOGFILE}; chown ${USER}:${USER} ${LOGFILE}
+       chown -R ${USER}:${USER} /var/log/clamav /var/run/clamav /var/lib/clamav
        daemon clamd -c /etc/clamd.conf
        RETVAL=$?
        echo
@@ -45,7 +46,7 @@
        killproc clamd
        RETVAL=$?
        echo
-       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd
+       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd $PIDFILE $LOCALSOCKET
        ;;
   status)
        status clamd

Modified: packages/cooker/clamav/current/SOURCES/clamav-freshclamd.init
==============================================================================
--- packages/cooker/clamav/current/SOURCES/clamav-freshclamd.init       
(original)
+++ packages/cooker/clamav/current/SOURCES/clamav-freshclamd.init       Wed Feb 
14 16:15:35 2007
@@ -28,6 +28,7 @@
 
 USER=`grep '^User\b' /etc/clamd.conf|awk '{ print $2}'`
 LOGFILE=`grep '^UpdateLogFile\b' /etc/freshclam.conf|awk '{ print $2}'`
+PIDFILE=`grep '^PidFile\b' /etc/freshclam.conf|awk '{ print $2}'`
 
 # See how we were called.
 case "$1" in
@@ -47,7 +48,7 @@
        killproc freshclam
        RETVAL=$?
        echo
-       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/freshclam
+       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/freshclam $PIDFILE
        ;;
   status)
        status freshclam

Modified: packages/cooker/clamav/current/SPECS/clamav.spec
==============================================================================
--- packages/cooker/clamav/current/SPECS/clamav.spec    (original)
+++ packages/cooker/clamav/current/SPECS/clamav.spec    Wed Feb 14 16:15:35 2007
@@ -12,7 +12,7 @@
 Summary:       An anti-virus utility for Unix
 Name:          clamav
 Version:       0.90
-Release:       %mkrel 1
+Release:       %mkrel 2
 License:       GPL
 Group:         File tools
 URL:           http://clamav.sourceforge.net/
@@ -133,6 +133,17 @@
 This package contains the static %{libname} library and its header
 files.
 
+%package -n    clamdmon
+Summary:       A little program for checking ClamAV daemon health
+Group:         System/Servers
+Requires:      clamd = %{clamav_version}
+
+%description -n        clamdmon
+ClamdMon is a little program for checking ClamAV daemon health. ClamdMon send
+to clamd stream, which contain EICAR test signature. If virus found, ClamdMon
+will return 1, otherwise 0. It's time to verify database integrity or/and
+restart ClamAV daemon...
+
 %prep
 
 %setup -q -n %{name}-%{version}
@@ -142,7 +153,7 @@
     if [ -e "$i" ]; then rm -rf $i; fi >&/dev/null
 done
        
-%patch0 -p0 -b .mdkconf
+%patch0 -p1 -b .mdkconf
 
 mkdir -p Mandriva
 cp %{SOURCE2} Mandriva/clamav-clamd.init
@@ -153,6 +164,15 @@
 cp %{SOURCE7} Mandriva/clamav-milter.sysconfig
 
 %build
+
+# build some of the contrib stuff
+pushd contrib/clamdmon
+    tar -zxf clamdmon-*.tar.gz
+       pushd clamdmon-*
+           make CFLAGS="%{optflags}"
+       popd
+popd
+
 %if %mdkversion > 1000
 export WANT_AUTOCONF_2_5=1
 libtoolize --copy --force && aclocal-1.7 && autoconf && automake-1.7
@@ -260,6 +280,18 @@
 %multiarch_binaries %{buildroot}%{_bindir}/clamav-config
 %endif
 
+# clamdmon
+install -m0755 contrib/clamdmon/clamdmon-*/clamdmon 
%{buildroot}%{_sbindir}/clamdmon
+
+install -d %{buildroot}%{_sysconfdir}/cron.d
+cat > clamdmon.crond << EOF
+#!/bin/sh
+
+*/5 * * * * root %{_sbindir}/clamdmon
+EOF
+install -m0755 clamdmon.crond %{buildroot}%{_sysconfdir}/cron.d/clamdmon
+
+
 %pre
 %_pre_useradd %{name} %{_localstatedir}/%{name} /bin/sh
 
@@ -323,7 +355,7 @@
 %files
 %defattr(-,root,root)
 %doc AUTHORS BUGS ChangeLog FAQ NEWS README test UPGRADE
-%doc docs/*.pdf contrib/clamdwatch contrib/clamdmon
+%doc docs/*.pdf
 %doc README.qmail+qmail-scanner COPYING
 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/clamd.conf
 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/freshclam.conf
@@ -381,8 +413,6 @@
 
 %files -n %{libname}-devel
 %defattr(-,root,root)
-%doc contrib/clamdwatch
-%doc contrib/clamdmon
 %if %mdkversion >= 1020
 %multiarch %{multiarch_bindir}/clamav-config
 %endif
@@ -392,3 +422,12 @@
 %{_libdir}/*.so
 %{_libdir}/*.la
 %{_libdir}/pkgconfig/libclamav.pc
+
+%files -n clamdmon
+%defattr(-,root,root)
+%doc contrib/clamdmon/clamdmon-*/COPYING
+%doc contrib/clamdmon/clamdmon-*/ChangeLog
+%doc contrib/clamdmon/clamdmon-*/clamdmon.sh
+%doc contrib/clamdmon/clamdmon-*/readme
+%attr(0755,root,root) %config(noreplace) %{_sysconfdir}/cron.d/clamdmon
+%attr(0755,root,root) %{_sbindir}/clamdmon

Reply via email to