- updated to 0.86.2 (SECURITY)
- changed the freshclam updating mechanism (again); now, it consists of a crontab which does not need to be changed and a helper script (freshclam-sleep). This helper script is configured by /etc/sysconfig/freshclam
This commit is contained in:
parent
3dd4ae5fdb
commit
3e396f9d26
73
clamav.spec
73
clamav.spec
@ -1,4 +1,4 @@
|
|||||||
## $Id: clamav.spec,v 1.22 2005/06/25 17:38:35 ensc Exp $
|
## $Id: clamav.spec,v 1.23 2005/06/25 18:01:32 ensc Exp $
|
||||||
|
|
||||||
## This package understands the following switches:
|
## This package understands the following switches:
|
||||||
## --without milter ... deactivate the -milter subpackage
|
## --without milter ... deactivate the -milter subpackage
|
||||||
@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
Summary: End-user tools for the Clam Antivirus scanner
|
Summary: End-user tools for the Clam Antivirus scanner
|
||||||
Name: clamav
|
Name: clamav
|
||||||
Version: 0.86.1
|
Version: 0.86.2
|
||||||
Release: %release_func 2
|
Release: %release_func 1
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
Group: Applications/File
|
Group: Applications/File
|
||||||
@ -67,10 +67,13 @@ Requires(postun): fedora-usermgmt >= 0.7
|
|||||||
%package update
|
%package update
|
||||||
Summary: Auto-updater for the Clam Antivirus scanner data-files
|
Summary: Auto-updater for the Clam Antivirus scanner data-files
|
||||||
Group: Applications/File
|
Group: Applications/File
|
||||||
|
Source200: freshclam-sleep
|
||||||
|
Source201: freshclam.sysconfig
|
||||||
|
Source202: clamav-update.cron
|
||||||
Requires: clamav-data = %{version}-%{release}
|
Requires: clamav-data = %{version}-%{release}
|
||||||
Requires(pre): /etc/cron.d
|
Requires(pre): /etc/cron.d
|
||||||
Requires(postun): /etc/cron.d
|
Requires(postun): /etc/cron.d
|
||||||
Requires(post): %__chown %__chmod %__sed diffutils
|
Requires(post): %__chown %__chmod
|
||||||
|
|
||||||
%package server
|
%package server
|
||||||
Summary: Clam Antivirus scanner server
|
Summary: Clam Antivirus scanner server
|
||||||
@ -204,6 +207,20 @@ perl -pi -e 's!^(s,\@INSTALL_(CLAMAV|FRESHCLAM)_CONF_TRUE\@),[^,]*,!\1,,!g;
|
|||||||
rm -rf "$RPM_BUILD_ROOT" _doc*
|
rm -rf "$RPM_BUILD_ROOT" _doc*
|
||||||
%{__make} DESTDIR="$RPM_BUILD_ROOT" install
|
%{__make} DESTDIR="$RPM_BUILD_ROOT" install
|
||||||
|
|
||||||
|
function smartsubst() {
|
||||||
|
local tmp
|
||||||
|
local regexp=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
tmp=$(mktemp /tmp/%name-subst.XXXXXX)
|
||||||
|
for i; do
|
||||||
|
sed -e "$regexp" "$i" >$tmp
|
||||||
|
cmp -s $tmp "$i" || cat $tmp >"$i"
|
||||||
|
rm -f $tmp
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
%{__install} -d -m755 \
|
%{__install} -d -m755 \
|
||||||
${RPM_BUILD_ROOT}%{_sysconfdir}/{clamd.d,cron.d,logrotate.d,sysconfig} \
|
${RPM_BUILD_ROOT}%{_sysconfdir}/{clamd.d,cron.d,logrotate.d,sysconfig} \
|
||||||
${RPM_BUILD_ROOT}%{_var}/log \
|
${RPM_BUILD_ROOT}%{_var}/log \
|
||||||
@ -230,10 +247,7 @@ mkdir _doc_server
|
|||||||
cp -pa _doc_server/* $RPM_BUILD_ROOT%pkgdatadir/template
|
cp -pa _doc_server/* $RPM_BUILD_ROOT%pkgdatadir/template
|
||||||
ln -s %pkgdatadir/clamd-wrapper $RPM_BUILD_ROOT%_initrddir/clamd-wrapper
|
ln -s %pkgdatadir/clamd-wrapper $RPM_BUILD_ROOT%_initrddir/clamd-wrapper
|
||||||
|
|
||||||
f=$RPM_BUILD_ROOT%pkgdatadir/clamd-wrapper
|
smartsubst 's!/usr/share/clamav!%pkgdatadir!g' $RPM_BUILD_ROOT%pkgdatadir/clamd-wrapper
|
||||||
sed -e 's!/usr/share/clamav!%pkgdatadir!g' "$f" >"$f".tmp
|
|
||||||
cmp -s "$f" "$f".tmp || cat "$f".tmp >"$f"
|
|
||||||
rm -f "$f".tmp
|
|
||||||
|
|
||||||
|
|
||||||
## prepare the update-files
|
## prepare the update-files
|
||||||
@ -241,17 +255,17 @@ rm -f "$f".tmp
|
|||||||
%{__install} -m755 -p %{SOURCE8} ${RPM_BUILD_ROOT}%{_sbindir}/clamav-notify-servers
|
%{__install} -m755 -p %{SOURCE8} ${RPM_BUILD_ROOT}%{_sbindir}/clamav-notify-servers
|
||||||
touch ${RPM_BUILD_ROOT}%{freshclamlog}
|
touch ${RPM_BUILD_ROOT}%{freshclamlog}
|
||||||
|
|
||||||
cat >${RPM_BUILD_ROOT}%{_sysconfdir}/cron.d/clamav-update <<"EOF"
|
%__install -p -m0755 %SOURCE200 $RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep
|
||||||
## Adjust this line...
|
%__install -p -m0644 %SOURCE201 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/freshclam
|
||||||
MAILTO=root,postmaster,webmaster,%username
|
%__install -p -m0600 %SOURCE202 $RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update
|
||||||
|
|
||||||
## It is ok to execute it as root; freshclam drops privileges and becomes
|
smartsubst 's!webmaster,clamav!webmaster,%username!g;
|
||||||
## user 'clamav' as soon as possible
|
s!/usr/share/clamav!%pkgdatadir!g;
|
||||||
# @MIN@ @HOUR@/3 * * * root %{_bindir}/freshclam --quiet && { test -x %{_sbindir}/clamav-notify-servers && exec %{_sbindir}/clamav-notify-servers || :; }
|
s!/usr/bin!%_bindir!g;
|
||||||
|
s!/usr/sbin!%_sbindir!g;' \
|
||||||
|
$RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update \
|
||||||
|
$RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep
|
||||||
|
|
||||||
## Comment out or remove this line...
|
|
||||||
1 8 * * * %username /bin/sh -c 'echo "Please activate the clamav update in %_sysconfdir/cron.d/clamav-update" >&2'
|
|
||||||
EOF
|
|
||||||
|
|
||||||
%if 0%{!?_without_milter:1}
|
%if 0%{!?_without_milter:1}
|
||||||
#### The milter stuff
|
#### The milter stuff
|
||||||
@ -260,6 +274,7 @@ function subst() {
|
|||||||
sed -e 's!<SERVICE>!milter!g;s!<USER>!%milteruser!g;'"$3" "$1" >"$RPM_BUILD_ROOT$2"
|
sed -e 's!<SERVICE>!milter!g;s!<USER>!%milteruser!g;'"$3" "$1" >"$RPM_BUILD_ROOT$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
subst etc/clamd.conf /etc/clamd.d/milter.conf \
|
subst etc/clamd.conf /etc/clamd.d/milter.conf \
|
||||||
's!^##*\(\(LogFile\|LocalSocket\|PidFile\|User\)\s\|\(StreamSaveToDisk\|ScanMail\)$\)!\1!;'
|
's!^##*\(\(LogFile\|LocalSocket\|PidFile\|User\)\s\|\(StreamSaveToDisk\|ScanMail\)$\)!\1!;'
|
||||||
|
|
||||||
@ -295,15 +310,6 @@ test -e %{freshclamlog} || {
|
|||||||
%{__chown} root:%{username} %{freshclamlog}
|
%{__chown} root:%{username} %{freshclamlog}
|
||||||
}
|
}
|
||||||
|
|
||||||
min=$[ RANDOM % 60 ]
|
|
||||||
hour=$[ RANDOM % 3 ]
|
|
||||||
tmp=$(mktemp /tmp/freshclam-cron.XXXXXX)
|
|
||||||
src=%_sysconfdir/cron.d/clamav-update
|
|
||||||
%__sed -e "s!@MIN@!$min!g;s!@HOUR@!$hour-23!g" "$src" >$tmp
|
|
||||||
cmp -s $tmp "$src" || cat "$tmp" >"$src"
|
|
||||||
rm -f $tmp
|
|
||||||
|
|
||||||
|
|
||||||
%postun data
|
%postun data
|
||||||
test "$1" != 0 || /usr/sbin/fedora-userdel %{username} &>/dev/null || :
|
test "$1" != 0 || /usr/sbin/fedora-userdel %{username} &>/dev/null || :
|
||||||
test "$1" != 0 || /usr/sbin/fedora-groupdel %{username} &>/dev/null || :
|
test "$1" != 0 || /usr/sbin/fedora-groupdel %{username} &>/dev/null || :
|
||||||
@ -375,9 +381,11 @@ test "$1" = 0 || %{_initrddir}/clamav-milter condrestart >/dev/null || :
|
|||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%_bindir/freshclam
|
%_bindir/freshclam
|
||||||
%_mandir/man1/freshclam*
|
%_mandir/man1/freshclam*
|
||||||
%config(noreplace) %verify(not mtime) %_sysconfdir/freshclam.conf
|
%pkgdatadir/freshclam-sleep
|
||||||
%config(noreplace) %verify(not mtime) %attr(0600,root,root) %_sysconfdir/cron.d/*
|
%config(noreplace) %verify(not mtime) %_sysconfdir/freshclam.conf
|
||||||
%config(noreplace) %verify(not mtime) %_sysconfdir/logrotate.d/*
|
%config(noreplace) %verify(not mtime) %_sysconfdir/logrotate.d/*
|
||||||
|
%config(noreplace) %_sysconfdir/cron.d/*
|
||||||
|
%config(noreplace) %_sysconfdir/sysconfig/freshclam
|
||||||
|
|
||||||
%ghost %attr(0664,root,%{username}) %verify(not size md5 mtime) %{freshclamlog}
|
%ghost %attr(0664,root,%{username}) %verify(not size md5 mtime) %{freshclamlog}
|
||||||
|
|
||||||
@ -414,6 +422,13 @@ test "$1" = 0 || %{_initrddir}/clamav-milter condrestart >/dev/null || :
|
|||||||
%endif # _without_milter
|
%endif # _without_milter
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jul 25 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.86.2-1
|
||||||
|
- updated to 0.86.2 (SECURITY)
|
||||||
|
- changed the freshclam updating mechanism (again); now, it consists
|
||||||
|
of a crontab which does not need to be changed and a helper script
|
||||||
|
(freshclam-sleep). This helper script is configured by
|
||||||
|
/etc/sysconfig/freshclam
|
||||||
|
|
||||||
* Sat Jun 25 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.86.1-2
|
* Sat Jun 25 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.86.1-2
|
||||||
- updated to 0.86.1
|
- updated to 0.86.1
|
||||||
- fixed randomization in %%post scriptlet: hour should be a range but
|
- fixed randomization in %%post scriptlet: hour should be a range but
|
||||||
|
Loading…
Reference in New Issue
Block a user