set DATABASE_DIRECTORY to /var/lib/clamav to fix searching definitions in /usr/share/clamav [release 1.0.1-2mamba;Mon May 08 2023]

This commit is contained in:
Silvan Calarco 2024-01-05 21:23:37 +01:00
parent d7a3931869
commit 3036734875
3 changed files with 8 additions and 146 deletions

View File

@ -1,71 +0,0 @@
#!/bin/bash
#
# clamd -- startup script for the Clam AntiVirus Daemon
#
# chkconfig: 2345 79 30
# description: Clam AntiVirus Daemon is a TCP/IP or unix domain
# socket protocol server.
# processname: clamd
# pidfile: /run/clamav/clamd.pid
# config: /etc/clamd.conf
# Source function library.
. /etc/rc.d/init.d/functions
NAME=clamd
DAEMON=/usr/sbin/$NAME
DAEMONPID=/var/run/clamav/$NAME.pid
DAEMONCONF=/etc/clamd.conf
OPTIONS="-c $DAEMONCONF"
[ -x $DAEMON ] || exit 0
# Source networking configuration.
[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
# check if the clamv conf file is present
[ -r "$DAEMONCONF" ] || exit 0
USER=`grep '^User' $DAEMONCONF | awk '{ print $2}'`
LOGFILE=`grep '^LogFile ' $DAEMONCONF | awk '{ print $2}'`
case "$1" in
start)
echo -n $"Starting Clam AntiVirus Daemon: "
if [ "${LOGFILE}" ]; then
touch ${LOGFILE}
chown ${USER}:${USER} ${LOGFILE}
fi
daemon --pidfile=$DAEMONPID $DAEMON $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
;;
stop)
echo -n $"Stopping Clam AntiVirus Daemon: "
killproc -p $DAEMONPID $NAME
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME $DAEMONPID
;;
restart|reload)
$0 stop
sleep 1
$0 start
;;
condrestart)
[ -e /var/lock/subsys/$NAME ] && $0 restart
;;
status)
statusproc $DAEMON
RETVAL=$?
;;
*)
echo $"Usage: ""/etc/init.d/$NAME {start|stop|status|restart|condrestart}"
exit 1
;;
esac
exit $RETVAL

View File

@ -1,67 +0,0 @@
#!/bin/sh
#
# freshclamd -- startup script for the Clam AntiVirus Database Update Daemon
#
# chkconfig: 2345 80 30
# description: Clam AntiVirus Database Update Daemon.
# processname: freshclamd
# pidfile: /run/clamav/freshclam.pid
# config: /etc/freshclam.conf
# config: /etc/clamd.conf
# Source function library.
. /etc/rc.d/init.d/functions
NAME=freshclam
DAEMON=/usr/bin/$NAME
DAEMONPID=/run/clamav/$NAME.pid
DAEMONCONF=/etc/freshclam.conf
OPTIONS="--config-file=$DAEMONCONF --quiet --daemon --pid=/run/clamav/freshclam.pid"
CLAMVDCONF=/etc/clamd.conf
[ -x $DAEMON ] || exit 0
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
# check if the clamv conf file is present
[ -r "$DAEMONCONF" ] || exit 0
USER=`grep '^User' $CLAMVDCONF | awk '{ print $2}'`
LOGFILE=`grep '^UpdateLogFile ' $DAEMONCONF | awk '{ print $2}'`
case "$1" in
start)
echo -n $"Starting Clam AntiVirus Update Daemon: "
touch ${LOGFILE}; chown ${USER}:${USER} ${LOGFILE}
daemon --pidfile=$DAEMONPID $DAEMON $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
;;
stop)
echo -n $"Stopping Clam AntiVirus Update Daemon: "
killproc -p $DAEMONPID $NAME
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME $DAEMONPID
;;
restart|reload)
$0 stop
sleep 1
$0 start
;;
condrestart)
[ -e /var/lock/subsys/$NAME ] && $0 restart
;;
status)
statusproc $DAEMON
RETVAL=$?
;;
*)
echo $"Usage: ""/etc/init.d/$NAME {start|stop|status|restart|condrestart}"
exit 1
;;
esac
exit $RETVAL

View File

@ -7,7 +7,7 @@
Name: clamav
Version: 1.0.1
Release: 1mamba
Release: 2mamba
Summary: Clam AntiVirus is a GPL anti-virus toolkit for UNIX
Group: Applications/Security
Vendor: openmamba
@ -16,9 +16,7 @@ Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://www.clamav.net/
Source0: http://www.clamav.net/downloads/production/clamav-%{version}.tar.gz
#Source0: http://downloads.sourceforge.net/sourceforge/clamav/clamav-%{version}.tar.gz
Source1: %{name}-clamd.initscript
Source2: %{name}-clamd.logrotate
Source3: %{name}-freshclam.initscript
Source4: %{name}-freshclam.logrotate
#Source5: http://db.local.clamav.net/daily.cvd
#Source6: clamav-clamd.service
@ -91,13 +89,14 @@ This package contains the static %{libname} library and its header files.
%prep
%setup -q
%define _default_patch_fuzz 2
%patch0 -p1
%patch1 -p1
%patch 0 -p1
%patch 1 -p1
#cp %{SOURCE5} database/daily.cvd
%build
%cmake -d build \
-DAPP_CONFIG_DIRECTORY=%{_sysconfdir}
-DAPP_CONFIG_DIRECTORY=%{_sysconfdir} \
-DDATABASE_DIRECTORY=/var/lib/clamav
#export SENDMAIL="%{_libdir}/sendmail"
#% configure \
@ -116,9 +115,7 @@ touch %{buildroot}%{_var}/log/%{name}/clamd.log
touch %{buildroot}%{_var}/log/%{name}/freshclam.log
# install needed initscripts and logrotate files
#install -D -m755 %{S:1} %{buildroot}%{_initrddir}/clamd
install -D -m644 %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/clamd
#install -D -m755 %{S:3} %{buildroot}%{_initrddir}/freshclam
install -D -m644 %{S:4} %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
install -d %{buildroot}%{_var}/lib/%{name}
@ -250,6 +247,9 @@ fi
#% doc BUGS ChangeLog NEWS README
%changelog
* Mon May 08 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.1-2mamba
- set DATABASE_DIRECTORY to /var/lib/clamav to fix searching definitions in /usr/share/clamav
* Thu Feb 16 2023 Automatic Build System <autodist@mambasoft.it> 1.0.1-1mamba
- automatic version update by autodist