clamav/clamav.spec.rej
2011-12-13 17:51:57 -06:00

153 lines
4.7 KiB
Plaintext

--- clamav.spec
+++ clamav.spec
@@ -5,7 +5,7 @@
Summary: Anti-virus software
Name: clamav
Version: 0.97.3
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Group: Applications/System
URL: http://www.clamav.net/
@@ -15,7 +15,14 @@
Source0: clamav-0.97.3-norar.tar.xz
Source1: clamav.init
Source2: clamav-milter.init
-Source3: clamd-wrapper.tar.bz2
+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
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: bzip2-devel, zlib-devel, gmp-devel, curl-devel, xz
@@ -171,53 +178,6 @@
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}" \
@@ -240,19 +200,30 @@
rm -rf %{buildroot}
make install DESTDIR="%{buildroot}"
-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
+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
%if %{!?_without_milter:1}0
install -Dp -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/clamav-milter
-install -Dp -m0644 clamav-milter.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
+install -Dp -m0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
%else
rm %{buildroot}%{_mandir}/man8/clamav-milter.8*
%endif
+
# Install clamav-wrapper:
-tar xjf %{SOURCE3} -C %{buildroot}/%{_prefix}/share
+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}
install -d -m0755 %{buildroot}%{_localstatedir}/log/clamav/
touch %{buildroot}%{_localstatedir}/log/clamav/freshclam.log
@@ -345,8 +316,6 @@
%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
@@ -366,10 +335,12 @@
%config(noreplace) %{_sysconfdir}/clamd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/clamav
%{_sysconfdir}/clamd.d
-%config %{_initrddir}/clamd
+%config %{_initrddir}/clamav
%{_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/
@@ -409,6 +380,10 @@
%exclude %{_libdir}/libclamav.la
%changelog
+* Fri Nov 25 2011 Philip Prindeville <philipp@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@fedoraproject.org> - 0.97.3-1
- Update to 0.97.3
- Fix CVE-2011-3627 clamav: Recursion level crash fixed in v0.97.3