diff --git a/clamav-clamd.initscript b/clamav-clamd.initscript new file mode 100644 index 0000000..c5b66f6 --- /dev/null +++ b/clamav-clamd.initscript @@ -0,0 +1,71 @@ +#!/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 diff --git a/clamav-freshclam.initscript b/clamav-freshclam.initscript new file mode 100644 index 0000000..7240046 --- /dev/null +++ b/clamav-freshclam.initscript @@ -0,0 +1,67 @@ +#!/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 diff --git a/clamav.spec b/clamav.spec index 10f2303..58402a7 100644 --- a/clamav.spec +++ b/clamav.spec @@ -6,8 +6,8 @@ %define libname lib%{name} Name: clamav -Version: 1.0.1 -Release: 2mamba +Version: 1.1.1 +Release: 1mamba Summary: Clam AntiVirus is a GPL anti-virus toolkit for UNIX Group: Applications/Security Vendor: openmamba @@ -16,7 +16,9 @@ Packager: Silvan Calarco 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 @@ -95,8 +97,7 @@ This package contains the static %{libname} library and its header files. %build %cmake -d build \ - -DAPP_CONFIG_DIRECTORY=%{_sysconfdir} \ - -DDATABASE_DIRECTORY=/var/lib/clamav + -DAPP_CONFIG_DIRECTORY=%{_sysconfdir} #export SENDMAIL="%{_libdir}/sendmail" #% configure \ @@ -115,7 +116,9 @@ 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} @@ -247,8 +250,11 @@ fi #% doc BUGS ChangeLog NEWS README %changelog -* Mon May 08 2023 Silvan Calarco 1.0.1-2mamba -- set DATABASE_DIRECTORY to /var/lib/clamav to fix searching definitions in /usr/share/clamav +* Thu Aug 17 2023 Automatic Build System 1.1.1-1mamba +- automatic version update by autodist + +* Tue May 02 2023 Automatic Build System 1.1.0-1mamba +- automatic version update by autodist * Thu Feb 16 2023 Automatic Build System 1.0.1-1mamba - automatic version update by autodist