Merge branch 'f31' into epel8

This commit is contained in:
Sérgio M. Basto 2020-01-31 05:18:15 +00:00
commit 9ecdbbb23f
14 changed files with 81 additions and 633 deletions

View File

@ -1,14 +0,0 @@
MAKEFILE_COMMON = $(HOME)/.fedora/common.mk
-include $(MAKEFILE_COMMON)
# can not use final tarball name here as it will conflict with rules
# within Makefile.common
TARBALL_CLEAN = ${NAME}-${VERSION}-norar.tar.xz.tmp
TARBALL = ${NAME}-${VERSION}.tar.gz
clean-sources: ${TARBALL_CLEAN}
${TARBALL_CLEAN}: ${TARBALL}
rm -f $@.tmp
zcat $< | tar --delete -f - '*/libclamunrar/*' | xz -c > $@.tmp
mv $@.tmp $@

View File

@ -1,93 +0,0 @@
#!/bin/bash
#
# clamav-milter Starts/stop the "clamav-milter" daemon
#
# chkconfig: - 79 31
# description: A virus scanning milter
# Source function library.
. /etc/rc.d/init.d/functions
exec=/usr/sbin/clamav-milter
prog="clamav-milter"
OPTS='-c /etc/mail/clamav-milter.conf'
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
pidfile=/var/run/clamav-milter/milter.pid
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
daemon --pidfile=${pidfile} $exec $OPTS --foreground=no --pid=${pidfile}
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc -p "${pidfile}" $exec
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p "${pidfile}" $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -1,14 +0,0 @@
### !!! Uncomment only *one* of the 'start on' statements !!!
### Uncomment these lines when you want clamav-milter to be a milter
### for a locally running MTA
#start on (starting sendmail or starting postfix)
### Uncomment these lines when you want clamav-milter to be a milter
### for a remotely running MTA
#start on runlevel [345] and starting local
stop on runlevel [!345]
respawn
exec /usr/sbin/clamav-milter -c /etc/mail/clamav-milter.conf --foreground=yes

View File

@ -1,6 +0,0 @@
## Adjust this line...
MAILTO=root
## It is ok to execute it as root; freshclam drops privileges and becomes
## user 'clamupdate' as soon as possible
0 */3 * * * root /usr/share/clamav/freshclam-sleep

View File

@ -1,4 +0,0 @@
/var/log/freshclam.log {
monthly
notifempty
}

View File

@ -1,24 +1,7 @@
#global prerelease rc1
## Fedora Extras specific customization below...
%if 0%{?fedora} || 0%{?rhel} > 6
%bcond_without systemd
%bcond_without tmpfiles
%bcond_with sysv
%bcond_with upstart
%else
%if 0%{?rhel} && 0%{?rhel} <= 6
%bcond_with systemd
%bcond_with tmpfiles
%bcond_without sysv
%bcond_without upstart
%else
%bcond_with systemd
%bcond_with tmpfiles
%bcond_without sysv
%bcond_with upstart
%endif
%endif
%bcond_with unrar
%ifnarch ppc64
%bcond_without llvm
@ -38,15 +21,12 @@
%{!?_rundir:%global _rundir /var/run}
%{!?_unitdir:%global _unitdir /lib/systemd/system}
%{!?_initrddir:%global _initrddir /etc/rc.d/init.d}
%global updateuser clamupdate
%global homedir %_var/lib/clamav
%global freshclamlog %_var/log/freshclam.log
%global milteruser clamilt
%global milterlog %_var/log/clamav-milter.log
%global milterstatedir %_rundir/clamav-milter
%global pkgdatadir %_datadir/%name
%global scanuser clamscan
%global scanstatedir %_rundir/clamd.scan
@ -54,7 +34,7 @@
Summary: End-user tools for the Clam Antivirus scanner
Name: clamav
Version: 0.101.5
Release: 1%{?dist}
Release: 7%{?dist}
License: %{?with_unrar:proprietary}%{!?with_unrar:GPLv2}
URL: https://www.clamav.net/
%if %{with unrar}
@ -68,10 +48,8 @@ Source999: https://www.clamav.net/downloads/production/%name-%version%{?prerele
Source0: %name-%version%{?prerelease}-norar.tar.xz
%endif
#for server
Source2: clamd.sysconfig
Source3: clamd.logrotate
Source5: clamd-README
Source7: clamd.SERVICE.init
# To download the *.cvd, go to https://www.clamav.net and use the links
# there (I renamed the files to add the -version suffix for verifying).
# Check the first line of the file for version or run file *cvd
@ -82,34 +60,17 @@ Source10: main-58.cvd
Source11: daily-25642.cvd
#http://database.clamav.net/bytecode.cvd
Source12: bytecode-331.cvd
#for update
Source200: freshclam-sleep
Source201: freshclam.sysconfig
Source202: clamav-update.crond
Source203: clamav-update.logrotate
#for milter
Source300: README.fedora
#for clamav-milter.upstart
Source310: clamav-milter.upstart
#for milter-sysvinit
Source320: clamav-milter.sysv
#for clamav-milter.systemd
Source330: clamav-milter.systemd
#for scanner-upstart
Source410: clamd.scan.upstart
#for scanner-systemd
Source430: clamd@scan.service
#for server-sysvinit
Source520: clamd-wrapper
#for server-systemd
#for scanner-systemd/server-systemd
Source530: clamd@.service
Patch0: clamav-0.100.0-stats-deprecation.patch
Patch1: clamav-0.100.1-defaults_locations.patch
Patch24: clamav-0.99-private.patch
Patch27: clamav-0.100.0-umask.patch
# https://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp?r1=128086&r2=137567
Patch30: llvm-glibc.patch
BuildRequires: autoconf automake gettext-devel libtool libtool-ltdl-devel
@ -122,10 +83,8 @@ BuildRequires: bc tcl groff graphviz
%{?have_ocaml:BuildRequires: ocaml}
# nc required for tests
BuildRequires: nc
%if %{with systemd}
%{?systemd_requires}
BuildRequires: systemd-devel
%endif
#for milter
BuildRequires: sendmail-devel
@ -188,7 +147,7 @@ BuildArch: noarch
%description data
This package contains the virus-database needed by clamav. This
database should be updated regularly; the 'clamav-update' package
ships a corresponding cron-job. Use this package when you want a
ships a corresponding systemd unit file. Use this package when you want a
working (but perhaps outdated) virus scanner immediately after package
installation.
@ -196,19 +155,16 @@ installation.
%package update
Summary: Auto-updater for the Clam Antivirus scanner data-files
Requires: clamav-filesystem = %version-%release
Requires: crontabs
Requires: /etc/cron.d
Provides: data(clamav) = empty
Provides: clamav-data-empty = %{version}-%{release}
Obsoletes: clamav-data-empty < %{version}-%{release}
Requires(post): %__chown %__chmod
%description update
This package contains programs which can be used to update the clamav
anti-virus database automatically. It uses the freshclam(1) utility for
this task. To activate it, uncomment the entry in /etc/cron.d/clamav-update.
this task. To activate it use, systemctl enable --now clamav-freshclam .
Use this package when you go updating the virus database regulary and
do not want to download a >120MB sized rpm-package with outdated virus
do not want to download a >160MB sized rpm-package with outdated virus
definitions.
@ -219,49 +175,11 @@ Requires: clamav-filesystem = %version-%release
Requires: clamav-lib = %version-%release
Requires: coreutils
Requires(pre): shadow-utils
%if %{with sysv}
Requires: %_initrddir
Provides: clamav-server-sysvinit = %version-%release
%endif
Obsoletes: clamav-server-sysvinit < %version-%release
%if %{with systemd}
%endif
# Remove me after EOL of RHEL6
%if %{with sysv}
Requires: %_initrddir
Requires(postun): initscripts
Requires(post): chkconfig
Requires(preun): chkconfig initscripts
%else
Obsoletes: clamav-scanner-sysvinit < %version-%release
%endif
# Remove me after EOL of RHEL6
%if %{with upstart}
Requires: /etc/init
Requires(post): /usr/bin/killall
Requires(preun): /sbin/initctl
Provides: clamav-scanner-upstart = %version-%release
%endif
Obsoletes: clamav-scanner-upstart < %version-%release
%if %{with systemd}
Provides: clamav-scanner-systemd = %{version}-%{release}
Provides: clamav-server-systemd = %{version}-%{release}
%endif
Obsoletes: clamav-scanner-systemd < %{version}-%{release}
Obsoletes: clamav-server-systemd < %{version}-%{release}
### Fedora Extras introduced them differently :(
Provides: clamav-server = %{version}-%{release}
Obsoletes: clamav-server < %{version}-%{release}
Provides: clamav-server-sysv = %{version}-%{release}
Obsoletes: clamav-server-sysv < %{version}-%{release}
Provides: clamav-scanner = %{version}-%{release}
Obsoletes: clamav-scanner < %{version}-%{release}
Provides: clamav-scanner-upstart = %{version}-%{release}
Obsoletes: clamav-scanner-upstart < %{version}-%{release}
Provides: clamav-server-sysvinit = %{version}-%{release}
Obsoletes: clamav-server-sysvinit < %{version}-%{release}
%description -n clamd
@ -279,28 +197,8 @@ Summary: Milter module for the Clam Antivirus scanner
Requires: clamav-filesystem = %version-%release
Requires(post): coreutils
Requires(pre): shadow-utils
# Remove me after EOL of RHEL6
%if %{with sysv}
Requires: %_initrddir
Requires(postun): initscripts
Requires(post): chkconfig
Requires(preun): chkconfig initscripts
Provides: clamav-milter-sysvinit = %version-%release
%endif
Obsoletes: clamav-milter-sysvinit < %version-%release
# Remove me after EOL of RHEL6
%if %{with upstart}
Requires: /etc/init
Requires(post): /usr/bin/killall
Requires(preun): /sbin/initctl
Provides: clamav-milter-upstart = %version-%release
%endif
Obsoletes: clamav-milter-upstart < %version-%release
%if %{with systemd}
Requires(post): %__chown %__chmod
Provides: clamav-milter-systemd = %{version}-%{release}
%endif
Obsoletes: clamav-milter-systemd < %{version}-%{release}
%description milter
@ -315,35 +213,19 @@ This package contains files which are needed to run the clamav-milter.
%patch1 -p1 -b .default_confs
%patch24 -p1 -b .private
%patch27 -p1 -b .umask
%patch30 -p1
install -p -m0644 %SOURCE300 clamav-milter/
mkdir -p libclamunrar{,_iface}
%{!?with_unrar:touch libclamunrar/{Makefile.in,all,install}}
sed -ri \
-e 's!^#?(LogFile ).*!#\1/var/log/clamd.<SERVICE>!g' \
-e 's!^#?(LocalSocket ).*!#\1%{_rundir}/clamd.<SERVICE>/clamd.sock!g' \
-e 's!^(#?PidFile ).*!\1%{_rundir}/clamd.<SERVICE>/clamd.pid!g' \
-e 's!^#?(User ).*!\1<USER>!g' \
-e 's!^#?(AllowSupplementaryGroups|LogSyslog).*!\1 yes!g' \
-e 's! /usr/local/share/clamav,! %homedir,!g' \
etc/clamd.conf.sample
sed -ri \
-e 's!^Example!#Example!' \
-e 's!^#?(UpdateLogFile )!#\1!g;' \
-e 's!^#?(LogSyslog).*!\1 yes!g' \
-e 's!(DatabaseOwner *)clamav$!\1%updateuser!g' etc/freshclam.conf.sample
## ------------------------------------------------------------
%build
#CFLAGS="$RPM_OPT_FLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -std=gnu99"
#CXXFLAGS="$RPM_OPT_FLAGS -std=gnu++98"
export LDFLAGS='%{?__global_ldflags} -Wl,--as-needed'
# add -Wl,--as-needed if not exist
echo %{?__global_ldflags} | sed '/-Wl,--as-needed/!s/$/ -Wl,--as-needed/'
export LDFLAGS=$(echo %{?__global_ldflags} | sed '/-Wl,--as-needed/!s/$/ -Wl,--as-needed/')
# IPv6 check is buggy and does not work when there are no IPv6 interface on build machine
export have_cv_ipv6=yes
@ -367,10 +249,8 @@ autoreconf -i
# TODO: check periodically that CLAMAVUSER is used for freshclam only
# build with --as-needed and disable rpath
# disable rpath
sed -i \
-e 's! -shared ! -Wl,--as-needed\0!g' \
-e '/sys_lib_dlsearch_path_spec=\"\/lib \/usr\/lib /s!\"\/lib \/usr\/lib !/\"/%_lib /usr/%_lib !g' \
libtool
@ -383,33 +263,17 @@ sed -i \
rm -rf _doc*
%make_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 -m 0755 \
$RPM_BUILD_ROOT%_sysconfdir/{mail,clamd.d,logrotate.d} \
$RPM_BUILD_ROOT%_sysconfdir/{mail,clamd.d} \
$RPM_BUILD_ROOT%_tmpfilesdir \
$RPM_BUILD_ROOT%_rundir \
$RPM_BUILD_ROOT%_var/log \
$RPM_BUILD_ROOT%milterstatedir \
$RPM_BUILD_ROOT%pkgdatadir/template \
$RPM_BUILD_ROOT%_initrddir \
$RPM_BUILD_ROOT%homedir \
$RPM_BUILD_ROOT%scanstatedir
rm -f $RPM_BUILD_ROOT%_sysconfdir/clamd.conf.sample \
$RPM_BUILD_ROOT%_libdir/*.la
rm -f $RPM_BUILD_ROOT%_libdir/*.la
touch $RPM_BUILD_ROOT%homedir/{daily,main,bytecode}.cld
@ -419,102 +283,65 @@ install -D -m 0644 -p %SOURCE10 $RPM_BUILD_ROOT%homedir/main.cvd
install -D -m 0644 -p %SOURCE11 $RPM_BUILD_ROOT%homedir/daily.cvd
install -D -m 0644 -p %SOURCE12 $RPM_BUILD_ROOT%homedir/bytecode.cvd
## prepare the server-files
install -D -m 0644 -p %SOURCE2 _doc_server/clamd.sysconfig
## prepare the clamd-files
install -D -m 0644 -p %SOURCE3 _doc_server/clamd.logrotate
%if %{with sysv}
install -D -m 0755 -p %SOURCE7 _doc_server/clamd.init
%endif
install -D -m 0644 -p %SOURCE5 _doc_server/README
install -D -m 0644 -p etc/clamd.conf.sample _doc_server/clamd.conf
%if %{with sysv}
install -m 0644 -p %SOURCE520 $RPM_BUILD_ROOT%pkgdatadir/
%endif
cp -pa _doc_server/* $RPM_BUILD_ROOT%pkgdatadir/template
%if %{with sysv}
smartsubst 's!/usr/share/clamav!%pkgdatadir!g' $RPM_BUILD_ROOT%pkgdatadir/clamd-wrapper
%endif
install -D -p -m 0644 %SOURCE530 $RPM_BUILD_ROOT%_unitdir/clamd@.service
### The freshclam stuff
sed -ri \
-e 's!^Example!#Example!' \
-e 's!^#?(UpdateLogFile )!#\1!g;' \
-e 's!^#?(LogSyslog).*!\1 yes!g' \
-e 's!(DatabaseOwner *)clamav$!\1%updateuser!g' $RPM_BUILD_ROOT%_sysconfdir/freshclam.conf.sample
## prepare the update-files
install -D -m 0644 -p %SOURCE203 $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/clamav-update
touch $RPM_BUILD_ROOT%freshclamlog
install -D -p -m 0755 %SOURCE200 $RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep
install -D -p -m 0644 %SOURCE201 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/freshclam
install -D -p -m 0600 %SOURCE202 $RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update
mv -f $RPM_BUILD_ROOT%_sysconfdir/freshclam.conf{.sample,}
mv $RPM_BUILD_ROOT%_sysconfdir/freshclam.conf{.sample,}
# Can contain HTTPProxyPassword (bugz#1733112)
chmod 600 $RPM_BUILD_ROOT%_sysconfdir/freshclam.conf
smartsubst 's!webmaster,clamav!webmaster,%updateuser!g;
s!/usr/share/clamav!%pkgdatadir!g;
s!/usr/bin!%_bindir!g;
s!/usr/sbin!%_sbindir!g;' \
$RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update \
$RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep
### The scanner stuff
sed -ri \
-e 's!^Example!#Example!' \
-e 's!^#?(LogFile ).*!#\1/var/log/clamd.<SERVICE>!g' \
-e 's!^#?(LocalSocket ).*!#\1%{_rundir}/clamd.<SERVICE>/clamd.sock!g' \
-e 's!^(#?PidFile ).*!\1%{_rundir}/clamd.<SERVICE>/clamd.pid!g' \
-e 's!^#?(User ).*!\1<USER>!g' \
-e 's!^#?(AllowSupplementaryGroups|LogSyslog).*!\1 yes!g' \
-e 's! /usr/local/share/clamav,! %homedir,!g' \
$RPM_BUILD_ROOT%_sysconfdir/clamd.conf.sample
sed -e 's!<SERVICE>!scan!g;s!<USER>!%scanuser!g' \
etc/clamd.conf.sample > $RPM_BUILD_ROOT%_sysconfdir/clamd.d/scan.conf
$RPM_BUILD_ROOT%_sysconfdir/clamd.conf.sample > $RPM_BUILD_ROOT%_sysconfdir/clamd.d/scan.conf
%if %{with sysv}
sed -e 's!<SERVICE>!scan!g;' $RPM_BUILD_ROOT%pkgdatadir/template/clamd.init \
> $RPM_BUILD_ROOT%_initrddir/clamd.scan
%endif
install -D -p -m 0644 %SOURCE410 $RPM_BUILD_ROOT%_sysconfdir/init/clamd.scan.conf
mv $RPM_BUILD_ROOT%_sysconfdir/clamd.conf.sample _doc_server/clamd.conf
cat << EOF > $RPM_BUILD_ROOT%_tmpfilesdir/clamd.scan.conf
d %scanstatedir 0710 %scanuser virusgroup
EOF
touch $RPM_BUILD_ROOT%scanstatedir/clamd.{sock,pid}
### The milter stuff
sed -r \
sed -ri \
-e 's!^#?(User).*!\1 %milteruser!g' \
-e 's!^#?(AllowSupplementaryGroups|LogSyslog) .*!\1 yes!g' \
-e 's! /tmp/clamav-milter.socket! %milterstatedir/clamav-milter.socket!g' \
-e 's! /var/run/clamav-milter.pid! %milterstatedir/clamav-milter.pid!g' \
-e 's! /var/run/clamd/clamd.socket! %scanstatedir/clamd.sock!g' \
-e 's! /tmp/clamav-milter.log! %milterlog!g' \
etc/clamav-milter.conf.sample > $RPM_BUILD_ROOT%_sysconfdir/mail/clamav-milter.conf
$RPM_BUILD_ROOT%_sysconfdir/clamav-milter.conf.sample
mv $RPM_BUILD_ROOT%_sysconfdir/clamav-milter.conf.sample $RPM_BUILD_ROOT%_sysconfdir/mail/clamav-milter.conf
install -D -p -m 0644 %SOURCE310 $RPM_BUILD_ROOT%_sysconfdir/init/clamav-milter.conf
%if %{with sysv}
install -D -p -m 0755 %SOURCE320 $RPM_BUILD_ROOT%_initrddir/clamav-milter
%endif
install -D -p -m 0644 %SOURCE330 $RPM_BUILD_ROOT%_unitdir/clamav-milter.service
cat << EOF > $RPM_BUILD_ROOT%_tmpfilesdir/clamav-milter.conf
d %milterstatedir 0710 %milteruser %milteruser
EOF
rm -f $RPM_BUILD_ROOT%_sysconfdir/clamav-milter.conf.sample
touch $RPM_BUILD_ROOT{%milterstatedir/clamav-milter.{socket,pid},%milterlog}
%{!?with_upstart: rm -rf $RPM_BUILD_ROOT%_sysconfdir/init}
%{!?with_systemd: rm -rf $RPM_BUILD_ROOT%_unitdir}
%{!?with_sysv: rm -f $RPM_BUILD_ROOT%_initrddir/*}
%{!?with_sysv: rm -rf $RPM_BUILD_ROOT%_rundir/*/*.pid}
%{!?with_tmpfiles: rm -rf $RPM_BUILD_ROOT%_tmpfilesdir}
%if %{with systemd}
# TODO: Evaluate using upstream's unit files
rm $RPM_BUILD_ROOT%_unitdir/clamav-{daemon,freshclam}.*
%endif
%if %{with sysv}
# keep clamd-wrapper in every case because it might be needed by other
# packages
ln -s %pkgdatadir/clamd-wrapper $RPM_BUILD_ROOT%_initrddir/clamd-wrapper
%endif
# TODO: Evaluate using upstream's unit with clamav-daemon.socket
rm $RPM_BUILD_ROOT%_unitdir/clamav-daemon.*
## ------------------------------------------------------------
@ -542,48 +369,17 @@ usermod %{scanuser} -a -G virusgroup
exit 0
%post -n clamd
%if %{with sysv}
/sbin/chkconfig --add clamd.scan
%endif
%if %{with upstart}
/usr/bin/killall -u %scanuser clamd 2>/dev/null || :
%endif
%if %{with systemd}
# Point to the new service unit
[ -L /etc/systemd/system/multi-user.target.wants/clamd@scan.service ] &&
ln -sf /usr/lib/systemd/system/clamd@.service /etc/systemd/system/multi-user.target.wants/clamd@scan.service || :
%systemd_post clamd@\*.service
%systemd_post clamd@scan.service
%{?with_tmpfiles:/bin/systemd-tmpfiles --create %_tmpfilesdir/clamd.scan.conf || :}
%endif
%preun -n clamd
%if %{with sysv}
test "$1" != 0 || %_initrddir/clamd.scan stop &>/dev/null || :
test "$1" != 0 || /sbin/chkconfig --del clamd.scan
%endif
%if %{with upstart}
test "$1" != "0" || /sbin/initctl -q stop clamd.scan || :
%endif
%if %{with systemd}
%systemd_preun clamd@\*.service
%endif
%systemd_preun clamd@scan.service
%postun -n clamd
%if %{with sysv}
test "$1" = 0 || %_initrddir/clamd.scan condrestart >/dev/null || :
%endif
%if %{with systemd}
%systemd_postun_with_restart clamd@\*.service
%endif
%post update
test -e %freshclamlog || {
touch %freshclamlog
%__chmod 0664 %freshclamlog
%__chown root:%updateuser %freshclamlog
! test -x /sbin/restorecon || /sbin/restorecon %freshclamlog
}
%systemd_postun_with_restart clamd@scan.service
%triggerin milter -- clamav-scanner
@ -606,36 +402,23 @@ test -e %milterlog || {
chown root:%milteruser %milterlog
! test -x /sbin/restorecon || /sbin/restorecon %milterlog
}
%if %{with sysv}
/sbin/chkconfig --add clamav-milter
%endif
%if %{with upstart}
/usr/bin/killall -u %milteruser clamav-milter 2>/dev/null || :
%endif
%if %{with systemd}
%systemd_post clamav-milter.service
%{?with_tmpfiles:/bin/systemd-tmpfiles --create %_tmpfilesdir/clamav-milter.conf || :}
%endif
%preun milter
%if %{with sysv}
test "$1" != 0 || %_initrddir/clamav-milter stop &>/dev/null || :
test "$1" != 0 || /sbin/chkconfig --del clamav-milter
%endif
%if %{with upstart}
test "$1" != "0" || /sbin/initctl -q stop clamav-milter || :
%endif
%if %{with systemd}
%systemd_preun clamav-milter.service
%endif
%postun milter
%if %{with sysv}
test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || :
%endif
%if %{with systemd}
%systemd_postun_with_restart clamav-milter.service
%endif
%post update
%systemd_post clamav-freshclam.service
%preun update
%systemd_preun clamav-freshclam.service
%postun update
%systemd_postun_with_restart clamav-freshclam.service
%ldconfig_scriptlets lib
@ -659,13 +442,15 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || :
%files lib
%_libdir/libclamav.so.9*
%_libdir/libclammspack.so.0*
%if %{with unrar}
%_libdir/libclamunrar*.so.9*
%endif
## -----------------------
%files devel
%_includedir/*
%_libdir/*.so
%pkgdatadir/template
%_libdir/pkgconfig/*
%_bindir/clamav-config
@ -673,7 +458,6 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || :
%files filesystem
%attr(-,%updateuser,%updateuser) %dir %homedir
%attr(-,root,root) %dir %pkgdatadir
%dir %_sysconfdir/clamd.d
## -----------------------
@ -689,13 +473,8 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || :
%files update
%_bindir/freshclam
%_mandir/*/freshclam*
%pkgdatadir/freshclam-sleep
%_unitdir/clamav-freshclam.service
%config(noreplace) %verify(not mtime) %_sysconfdir/freshclam.conf
%config(noreplace) %verify(not mtime) %_sysconfdir/logrotate.d/*
%config(noreplace) %_sysconfdir/cron.d/clamav-update
%config(noreplace) %_sysconfdir/sysconfig/freshclam
%ghost %attr(0664,root,%updateuser) %verify(not size md5 mtime) %freshclamlog
%ghost %attr(0664,%updateuser,%updateuser) %homedir/*.cld
%ghost %attr(0664,%updateuser,%updateuser) %homedir/mirrors.dat
@ -707,13 +486,7 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || :
%_mandir/man5/clamd.conf.5*
%_mandir/man8/clamd.8*
%_sbindir/clamd
%if %{with sysv}
%_initrddir/clamd-wrapper
%pkgdatadir/clamd-wrapper
%endif
%if %{with systemd}
%_unitdir/clamd@.service
%endif
%config(noreplace) %_sysconfdir/clamd.d/scan.conf
%ghost %scanstatedir/clamd.sock
@ -723,13 +496,6 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || :
%else
%dir %attr(0710,%scanuser,virusgroup) %scanstatedir
%endif
%if %{with sysv}
%attr(0755,root,root) %config %_initrddir/clamd.scan
%ghost %scanstatedir/clamd.pid
%endif
%if %{with upstart}
%config(noreplace) %_sysconfdir/init/clamd.scan*
%endif
## -----------------------
@ -748,19 +514,35 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || :
%else
%dir %attr(0710,%milteruser,%milteruser) %milterstatedir
%endif
%if %{with sysv}
%config %_initrddir/clamav-milter
%ghost %milterstatedir/clamav-milter.pid
%endif
%if %{with upstart}
%config(noreplace) %_sysconfdir/init/clamav-milter*
%endif
%if %{with systemd}
%_unitdir/clamav-milter.service
%endif
%_unitdir/clamav-milter.service
%changelog
* Mon Jan 27 2020 Sérgio Basto <sergio@serjux.com> - 0.101.5-7
- More cleanups
- Remove llvm-glibc.patch (upstream already fixed it)
- Comment "Example" in scan.conf to make clamd@scan.service works without editing
- Improve description of clamav-update
* Sun Jan 26 2020 Sérgio Basto <sergio@serjux.com> - 0.101.5-6
- Fix clamd scriplets on update and add scriplets for clamav-freshclam.service
* Fri Jan 24 2020 Sérgio Basto <sergio@serjux.com> - 0.101.5-5
- Improve upgrade path
- Get rid of pkgdatadir variable
- Use upstream freshclam systemd unit file, remove freshclam-sleep
- Get rid of %freshclamlog variable
- Get rid of smartsubst function
* Fri Jan 17 2020 Sérgio Basto <sergio@serjux.com> - 0.101.5-4
- Fix scriplets (#1788338)
* Tue Dec 17 2019 Sérgio Basto <sergio@serjux.com> - 0.101.5-3
- Remove old init scripts and use systemd
* Tue Dec 17 2019 Orion Poplawski <orion@nwra.com> - 0.101.5-2
- Allow building --with unrar again (bz#1782638)
* Sat Nov 23 2019 Orion Poplawski <orion@nwra.com> - 0.101.5-1
- Update to 0.101.5 (CVE-2019-15961) (bz#1775550)

View File

@ -1,90 +0,0 @@
#!/bin/bash
#
# Xchkconfig: - 75 35
# Xdescription: The clamd daemon listens for incoming connections on \
# Unix or TCP socket and scans files or directories on demand.
test "$CLAMD_SERVICE" || {
echo $"*** $0 can not be called in this way"
echo $"*** Please see /usr/share/doc/clamav-server-*/README how"
echo $"*** the clamav-server can be configured"
exit 6
}
# Source function library.
. /etc/init.d/functions
# Get config.
test -r /etc/sysconfig/network && . /etc/sysconfig/network
# Check that networking is up.
test "$NETWORKING" != "no" || exit 6
lockfile=/var/lock/subsys/clamd.${CLAMD_SERVICE}
sysconffile=/etc/sysconfig/clamd.${CLAMD_SERVICE}
procname=clamd.${CLAMD_SERVICE}
CLAMD_CONFIGFILE=/etc/clamd.d/${CLAMD_SERVICE}.conf
CLAMD_OPTIONS=
CLAMD_PIDFILE=/var/run/clamd.${CLAMD_SERVICE}/clamd.pid
## backward-compatibility check...
for i in /var/run/clamd.${CLAMD_SERVICE}/clamd.sock \
/var/run/clamav.${CLAMD_SERVICE}/clamd.sock; do
CLAMD_SOCKET=$i
test ! -e "$i" || break
done
test -f "$sysconffile" && . "$sysconffile"
RETVAL=0
prog="clamd.${CLAMD_SERVICE}"
start () {
echo -n $"Starting $prog: "
daemon --pidfile=${CLAMD_PIDFILE} \
exec -a $procname /usr/sbin/clamd \
${CLAMD_CONFIGFILE:+-c $CLAMD_CONFIGFILE} ${CLAMD_OPTIONS} --pid ${CLAMD_PIDFILE}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
stop () {
echo -n $"Stopping $prog: "
killproc -p ${CLAMD_PIDFILE} $procname
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile
return $RETVAL
}
reload() {
rc=0
echo -n $"Reloading $prog: "
killproc -p ${CLAMD_PIDFILE} $procname -HUP || rc=$?
echo
echo -n $"Loading new virus-database: "
killproc -p ${CLAMD_PIDFILE} $procname -USR2 || rc=$?
echo
return $rc
}
restart () {
stop
start
}
# See how we were called.
case "$1" in
start|stop|restart|reload)
$1 ;;
status)
status -p ${CLAMD_PIDFILE} $procname ;;
condrestart)
test ! -f $lockfile || restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
exit 2
esac

View File

@ -1,7 +0,0 @@
#!/bin/bash
#
# chkconfig: - 75 35
# description: The clamd server running for <SERVICE>
CLAMD_SERVICE=<SERVICE>
. /usr/share/clamav/clamd-wrapper

View File

@ -1,14 +0,0 @@
### !!! Uncomment only *one* of the 'start on' statements !!!
### Uncomment this line when you want clamd.scan to be a scanner for a
### locally running clamav-milter
#start on starting clamav-milter
### Uncomment this line when you want clamd.scan to be a generic
### scanner service
#start on runlevel [345] and starting local
stop on runlevel [!345]
respawn
exec /usr/sbin/clamd -c /etc/clamd.d/scan.conf --foreground=yes

View File

@ -1,3 +0,0 @@
#CLAMD_CONFIGFILE=/etc/clamd.d/<SERVICE>.conf
#CLAMD_SOCKET=/var/run/clamd.<SERVICE>/clamd.sock
#CLAMD_OPTIONS=

View File

@ -1,7 +0,0 @@
.include /lib/systemd/system/clamd@.service
[Unit]
Description = Generic clamav scanner daemon
[Install]
WantedBy = multi-user.target

View File

@ -1,52 +0,0 @@
#! /bin/bash
# Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
FRESHCLAM_MOD=$[ 3*60 ] # 3 hours
f=/etc/sysconfig/freshclam
test ! -e "$f" || . "$f"
case x"$1" in
(xnow) FRESHCLAM_DELAY=0;;
(x|xrandom) : ${FRESHCLAM_DELAY:=$[ 0x`hostid` ]};;
(*) FRESHCLAM_DELAY=$1;;
esac
set -e
case $FRESHCLAM_DELAY in
(disabled-warn)
echo $"\
WARNING: update of clamav database is disabled; please see
'$f'
for information how to enable the periodic update resp. how to turn
off this message." >&2
exit 1
;;
(disabled)
exit 0
;;
(*)
let FRESHCLAM_MOD*=60
sleep $[ (FRESHCLAM_DELAY % FRESHCLAM_MOD + FRESHCLAM_MOD) % FRESHCLAM_MOD ]
;;
esac
/usr/bin/freshclam --quiet

View File

@ -1,18 +0,0 @@
## When changing the periodicity of freshclam runs in the crontab,
## this value must be adjusted also. Its value is the timespan between
## two subsequent freshclam runs in minutes. E.g. for the default
##
## | 0 */3 * * * ...
##
## crontab line, the value is 180 (minutes).
# FRESHCLAM_MOD=
## A predefined value for the delay in seconds. By default, the value is
## calculated by the 'hostid' program. This predefined value guarantees
## constant timespans of 3 hours between two subsequent freshclam runs.
##
## This option accepts two special values:
## 'disabled-warn' ... disables the automatic freshclam update and
## gives out a warning
## 'disabled' ... disables the automatic freshclam silently
# FRESHCLAM_DELAY=

View File

@ -1,12 +0,0 @@
Index: clamav-0.97.3/libclamav/c++/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
===================================================================
--- clamav-0.97.3.orig/libclamav/c++/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
+++ clamav-0.97.3/libclamav/c++/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
@@ -52,6 +52,7 @@ static void runAtExitHandlers() {
#include <sys/stat.h>
#endif
#include <fcntl.h>
+#include <unistd.h>
/* stat functions are redirecting to __xstat with a version number. On x86-64
* linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'
* available as an exported symbol, so we have to add it explicitly.