[clamav/el6: 2/4] Revert "Add files from bug 756854"

Nick Bebout nb at fedoraproject.org
Sun Jan 1 22:45:22 UTC 2012


commit 1b188a1f3f19a9a627083b1407aa831810ad6c2f
Author: Nick Bebout <nb at fedoraproject.org>
Date:   Sun Jan 1 16:39:31 2012 -0600

    Revert "Add files from bug 756854"
    
    This reverts commit 14d21bc46d3a59c90e91420a310f14102e8d859b.

 README.clamd-wrapper    |  116 -----
 clamav-milter.sysconfig |    8 -
 clamav.spec             |   91 +++--
 clamav.spec.orig        | 1091 -----------------------------------------------
 clamav.spec.rej         |  152 -------
 clamd-wrapper           |   86 ----
 clamd.init              |   18 -
 clamd.logrotate         |    8 -
 clamd.sysconfig         |    5 -
 freshclam.cron          |   34 --
 freshclam.logrotate     |   10 -
 sources                 |    1 +
 12 files changed, 59 insertions(+), 1561 deletions(-)
---
diff --git a/clamav.spec b/clamav.spec
index 53db81e..bd8c933 100644
--- a/clamav.spec
+++ b/clamav.spec
@@ -5,7 +5,7 @@
 Summary: Anti-virus software
 Name: clamav
 Version: 0.97.3
-Release: 2%{?dist}
+Release: 1%{?dist}
 License: GPLv2
 Group: Applications/System
 URL: http://www.clamav.net/
@@ -15,14 +15,7 @@ URL: http://www.clamav.net/
 Source0: clamav-0.97.3-norar.tar.xz
 Source1: clamav.init
 Source2: clamav-milter.init
-Source3: clamd-wrapper
-Source4: clamd.init
-Source5: README.clamd-wrapper
-Source6: clamd.sysconfig
-Source7: freshclam.logrotate
-Source8: freshclam.cron
-Source9: clamd.logrotate
-Source10: clamav-milter.sysconfig
+Source3: clamd-wrapper.tar.bz2
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires: bzip2-devel, zlib-devel, gmp-devel, curl-devel, xz
@@ -178,6 +171,53 @@ xz -dc %{SOURCE0} | (cd .. ; tar xvvf -)
 		s|^#(ClamdSocket) .+$|$1 unix:%{_localstatedir}/run/clamav/clamd.sock|;
 	' etc/clamav-milter.conf
 
+
+cat <<EOF >clamd.logrotate
+%{_localstatedir}/log/clamav/clamd.log {
+	missingok
+	notifempty
+	create 644 clam clam
+	postrotate
+		killall -HUP clamd 2>/dev/null || :
+	endscript
+}
+EOF
+
+cat <<EOF >freshclam.logrotate
+%{_localstatedir}/log/clamav/freshclam.log {
+	missingok
+	notifempty
+	create 644 clam clam
+}
+EOF
+
+cat <<'EOF' >freshclam.cron
+#!/bin/sh
+
+### A simple update script for the clamav virus database.
+### This could as well be replaced by a SysV script.
+
+### fix log file if needed
+LOG_FILE="%{_localstatedir}/log/clamav/freshclam.log"
+if [ ! -f "$LOG_FILE" ]; then
+    touch "$LOG_FILE"
+    chmod 644 "$LOG_FILE"
+    chown clam.clam "$LOG_FILE"
+fi
+
+%{_bindir}/freshclam \
+    --quiet \
+    --datadir="%{_localstatedir}/lib/clamav" \
+    --log="$LOG_FILE" 
+EOF
+
+%{__cat} <<EOF >clamav-milter.sysconfig
+### Simple config file for clamav-milter, you should
+### read the documentation and tweak it as you wish.
+
+CLAMAV_FLAGS=""
+EOF
+
 %build
 %configure  \
 	--program-prefix="%{?_program_prefix}" \
@@ -200,30 +240,19 @@ make %{?_smp_mflags}
 rm -rf %{buildroot}
 make install DESTDIR="%{buildroot}"
 
-install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/clamav
-install -Dp -m0755 %{SOURCE8} %{buildroot}%{_sysconfdir}/cron.daily/freshclam
-install -Dp -m0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
-install -Dp -m0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/logrotate.d/clamav
-
-# now rewrite scripts and config files in-place
-sed -i \
-	-e 's!%%{_sbindir}!%{_sbindir}!g' \
-	-e 's!%%{_bindir}!%{_bindir}!g' \
-	-e 's!%%{_localstatedir}!%{_localstatedir}!g' \
-	%{buildroot}%{_sysconfdir}/logrotate.d/* \
-	%{buildroot}%{_sysconfdir}/cron.daily/freshclam
+install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/clamd
+install -Dp -m0755 freshclam.cron %{buildroot}%{_sysconfdir}/cron.daily/freshclam
+install -Dp -m0644 freshclam.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
+install -Dp -m0644 clamd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/clamav
 
 %if %{!?_without_milter:1}0
 install -Dp -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/clamav-milter
-install -Dp -m0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
+install -Dp -m0644 clamav-milter.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
 %else
 rm %{buildroot}%{_mandir}/man8/clamav-milter.8*
 %endif
-
 # Install clamav-wrapper:
-install -d -m0755 %{buildroot}/%{_prefix}/share/clamav
-install -m0755 -t %{buildroot}/%{_prefix}/share/clamav %{SOURCE3} %{SOURCE4}
-install -m0444 -t %{buildroot}/%{_prefix}/share/clamav %{SOURCE5} %{SOURCE6}
+tar xjf %{SOURCE3} -C %{buildroot}/%{_prefix}/share
 
 install -d -m0755 %{buildroot}%{_localstatedir}/log/clamav/
 touch %{buildroot}%{_localstatedir}/log/clamav/freshclam.log
@@ -316,6 +345,8 @@ rm -rf %{buildroot}
 %doc %{_mandir}/man1/clamscan.1*
 %doc %{_mandir}/man1/freshclam.1*
 %doc %{_mandir}/man5/freshclam.conf.5*
+%doc %{_prefix}/share/clamav/README.clamd-wrapper
+%{_prefix}/share/clamav/clamd-wrapper
 %config(noreplace) %{_sysconfdir}/freshclam.conf
 %{_bindir}/clamscan
 %{_bindir}/freshclam
@@ -335,12 +366,10 @@ rm -rf %{buildroot}
 %config(noreplace) %{_sysconfdir}/clamd.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/clamav
 %{_sysconfdir}/clamd.d
-%config %{_initrddir}/clamav
+%config %{_initrddir}/clamd
 %{_sbindir}/clamd
 %{_bindir}/clamconf
 %{_bindir}/clamdscan
-%doc %{_prefix}/share/clamav/README.clamd-wrapper
-%{_prefix}/share/clamav/clamd*
 
 %defattr(0644, clam, clam, 0755)
 %{_localstatedir}/run/clamav/
@@ -380,10 +409,6 @@ rm -rf %{buildroot}
 %exclude %{_libdir}/libclamav.la
 
 %changelog
-* Fri Nov 25 2011 Philip Prindeville <philipp at fedoraproject.org> - 0.97.3-2
-- Add missing clamd-wrapper supporting files
-- Remove from init script the unused CLAMD_SOCKET variable
-
 * Tue Oct 18 2011 Nick Bebout <nb at fedoraproject.org> - 0.97.3-1
 - Update to 0.97.3
 - Fix CVE-2011-3627 clamav: Recursion level crash fixed in v0.97.3
diff --git a/sources b/sources
index 05755a5..47b00bc 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
 b319a3f31a16811f1a92d63cda592521  clamav-0.97.3-norar.tar.xz
+e809f74ed139df2e4af3fafbca32f678  clamd-wrapper.tar.bz2


More information about the scm-commits mailing list