[clamav/el6/master] Milter cleanups after problems reported in bz#579370. Delete mirrors.dat in %post since I see no oth
Jan-Frode Myklebust
janfrode at fedoraproject.org
Fri Mar 18 08:06:26 UTC 2011
commit 0de58a44516ae5ea2eab503715ab5ea2fb9bf4a7
Author: Jan-Frode Myklebust <janfrode at tanso.net>
Date: Fri Mar 18 09:05:10 2011 +0100
Milter cleanups after problems reported in bz#579370.
Delete mirrors.dat in %post since I see no other way of getting
the permissions correct.
clamav-milter.init | 2 +-
clamav.spec | 27 +++++++++++++++++----------
2 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/clamav-milter.init b/clamav-milter.init
index f87efa7..347fe4b 100644
--- a/clamav-milter.init
+++ b/clamav-milter.init
@@ -25,7 +25,7 @@ test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter
case "$1" in
start)
echo -n "Starting Clamav Milter Daemon: "
- daemon clamav-milter $CLAMAV_FLAGS $SOCKET_ADDRESS
+ daemon clamav-milter $CLAMAV_FLAGS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamav-milter
diff --git a/clamav.spec b/clamav.spec
index 90e38b4..4d7776f 100644
--- a/clamav.spec
+++ b/clamav.spec
@@ -5,7 +5,7 @@
Summary: Anti-virus software
Name: clamav
Version: 0.97
-Release: 10%{?dist}
+Release: 11%{?dist}
License: GPLv2
Group: Applications/System
URL: http://www.clamav.net/
@@ -160,6 +160,13 @@ you will need to install %{name}-devel.
s|^#(NotifyClamd) .+$|$1 %{_sysconfdir}/clamd.conf|;
' etc/freshclam.conf
+%{__perl} -pi.orig -e '
+ s|^(Example)|#$1|;
+ s|^#(User) .+$|$1 clam|;
+ s|^#(ClamdSocket) .+$|$1 %{_localstatedir}/run/clamav/clamd.sock|;
+ ' etc/clamav-milter.conf
+
+
cat <<EOF >clamd.logrotate
%{_localstatedir}/log/clamav/clamd.log {
missingok
@@ -204,9 +211,7 @@ EOF
### Simple config file for clamav-milter, you should
### read the documentation and tweak it as you wish.
-CLAMAV_FLAGS="
- --config-file=%{_sysconfdir}/clamd.conf
-"
+CLAMAV_FLAGS=""
EOF
%build
@@ -252,12 +257,11 @@ touch %{buildroot}%{_localstatedir}/log/clamav/clamd.log
install -d -m0755 %{buildroot}%{_localstatedir}/run/clamav/
install -d -m0755 %{buildroot}%{_sysconfdir}/clamd.d/
-# mirrors.dat might exists with the wrong user on upgrades from pre v0.97,
-# touch it here, and later %ghost it so that the permissions are fixed if needed.
-touch %{buildroot}%{_localstatedir}/lib/clamav/mirrors.dat
-
-
%post
+# Remove old mirrors.dat, mostly because it will have the wrong
+# owner after upgrading from clamav < 0.97:
+test -f /var/lib/clamav/mirrors.dat && rm -f /var/lib/clamav/mirrors.dat
+
/sbin/ldconfig
ZONES="/usr/share/zoneinfo/zone.tab"
@@ -387,7 +391,6 @@ rm -rf %{buildroot}
%config(noreplace) %verify(user group mode) %{_localstatedir}/lib/clamav/
%dir %{_localstatedir}/log/clamav/
%ghost %{_localstatedir}/log/clamav/freshclam.log
-%ghost %{_localstatedir}/lib/clamav/mirrors.dat
%files devel
%defattr(-, root, root, 0755)
@@ -399,6 +402,10 @@ rm -rf %{buildroot}
%exclude %{_libdir}/libclamav.la
%changelog
+* Fri Mar 18 2011 Jan-Frode Myklebust <janfrode at tanso.net> - 0.97-11
+- Delete /var/lib/clamav/mirrors.dat, it will be recreated on first run.
+- clamav-milter config cleanups.
+
* Wed Mar 16 2011 Jan-Frode Myklebust <janfrode at tanso.net> - 0.97-10
- Make sure /var/lib/clamav/mirrors.dat has owner fixed on upgrade.
- Don't start clamd or milter service by default.
More information about the scm-commits
mailing list