summaryrefslogtreecommitdiff
path: root/extra/clamav
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-12-17 23:14:43 +0000
committerroot <root@rshg054.dnsready.net>2011-12-17 23:14:43 +0000
commit146025aa1c838c12fa7b4873414da73816bfb6bd (patch)
tree22bcdae4c400322b756f2f4cc360de8c08b946a4 /extra/clamav
parent492f7c22a61fdb0488000da9f66d68e11bb43918 (diff)
Sat Dec 17 23:14:43 UTC 2011
Diffstat (limited to 'extra/clamav')
-rw-r--r--extra/clamav/PKGBUILD14
-rw-r--r--extra/clamav/install4
-rw-r--r--extra/clamav/rc.d117
3 files changed, 65 insertions, 70 deletions
diff --git a/extra/clamav/PKGBUILD b/extra/clamav/PKGBUILD
index cee554750..c6f92be84 100644
--- a/extra/clamav/PKGBUILD
+++ b/extra/clamav/PKGBUILD
@@ -1,25 +1,25 @@
-# $Id: PKGBUILD 140665 2011-10-17 22:40:35Z bisson $
+# $Id: PKGBUILD 145066 2011-12-16 09:17:40Z bisson $
# Contributor: Dale Blount <dale@archlinux.org>
# Contributor: Gregor Ibic <gregor.ibic@intelicom.si>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
pkgname=clamav
pkgver=0.97.3
-pkgrel=1
+pkgrel=2
pkgdesc='Anti-virus toolkit for Unix'
-arch=('i686' 'x86_64')
-depends=('bzip2' 'zlib' 'libtool')
-options=('!libtool')
+url='http://www.clamav.net/'
license=('GPL')
+options=('!libtool')
+arch=('i686' 'x86_64')
+depends=('bzip2' 'libltdl')
backup=('etc/clamav/clamd.conf' 'etc/clamav/freshclam.conf' 'etc/conf.d/clamav')
-url='http://www.clamav.net/'
source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz"
'rc.d'
'conf.d'
'logrotate'
'config.patch')
sha1sums=('263c7b8b7dc1536652ab64e32263d1c60e138655'
- '7f15f0b13a1c11235bc99ef0add01efd8a442f07'
+ '50cfe02c97e4297a0efd25b23142408380305d30'
'cb116cdab49a810381a515cbcfb6a6c148547f07'
'be3310d2b41a68ce06e33c84ab68ffe59fdce104'
'701a61571788d10ff7af01597785835c6bfea918')
diff --git a/extra/clamav/install b/extra/clamav/install
index 9116dc394..144134dde 100644
--- a/extra/clamav/install
+++ b/extra/clamav/install
@@ -2,8 +2,8 @@ post_install() {
getent group clamav &>/dev/null || groupadd -r -g 64 clamav >/dev/null
getent passwd clamav &>/dev/null || useradd -r -u 64 -g clamav -d /dev/null -s /bin/false -c "Clam AntiVirus" clamav >/dev/null
- install -d /var/{log,run}/clamav
- chown clamav:root /var/{log,run}/clamav
+ install -d /var/log/clamav
+ chown clamav:root /var/log/clamav
chown -R clamav:clamav /var/lib/clamav
}
diff --git a/extra/clamav/rc.d b/extra/clamav/rc.d
index 8e9c6afa9..04e959903 100644
--- a/extra/clamav/rc.d
+++ b/extra/clamav/rc.d
@@ -3,70 +3,65 @@
. /etc/rc.conf
. /etc/rc.d/functions
-# source application-specific settings
-[ -f /etc/conf.d/clamav ] && . /etc/conf.d/clamav
+[[ -f /etc/conf.d/clamav ]] && . /etc/conf.d/clamav
+[[ -d /var/run/clamav ]] || install -d -o clamav -g root /var/run/clamav
-PID_FC=`pidof -o %PPID /usr/bin/freshclam`
-PID_CD=`pidof -o %PPID /usr/sbin/clamd`
+PID_FC=$(pidof -o %PPID /usr/bin/freshclam)
+PID_CD=$(pidof -o %PPID /usr/sbin/clamd)
case "$1" in
- start)
- # if clamd isn't started first, notifyclamd fails at times
- if [ "$START_CLAMD" == "yes" ]; then
- stat_busy "Starting ClamD"
- [ -z "$PID_CD" ] && /usr/sbin/clamd
- if [ $? -gt 0 ]; then
- stat_fail
- else
- add_daemon clamav
- stat_done
- fi
- fi
+ start)
+ if [[ $START_CLAMD = yes ]]; then
+ stat_busy "Starting ClamD"
+ [[ -z $PID_CD ]] && /usr/sbin/clamd
+ if [[ $? -gt 0 ]]; then
+ stat_fail
+ else
+ add_daemon clamav
+ stat_done
+ fi
+ fi
+ sleep 1
+ if [[ $START_FRESHCLAM = yes ]]; then
+ stat_busy "Starting FreshClam"
+ [[ -z $PID_FC ]] && /usr/bin/freshclam -p /var/run/clamav/freshclam.pid -d $FRESHCLAM_OPTS
+ if [[ $? -gt 0 ]]; then
+ stat_fail
+ else
+ add_daemon clamav
+ stat_done
+ fi
+ fi
+ ;;
+ stop)
+ if [[ $START_CLAMD = yes ]]; then
+ stat_busy "Stopping ClamD"
+ [[ -n $PID_CD ]] && kill $PID_CD &> /dev/null
+ if [[ $? -gt 0 ]]; then
+ stat_fail
+ else
+ rm_daemon clamav
+ stat_done
+ fi
+ fi
- # give clamd enough time to start
- sleep 1
-
- if [ "$START_FRESHCLAM" == "yes" ]; then
- stat_busy "Starting FreshClam"
- [ -z "$PID_FC" ] && /usr/bin/freshclam -p /var/run/clamav/freshclam.pid -d $FRESHCLAM_OPTS
- if [ $? -gt 0 ]; then
- stat_fail
- else
- add_daemon clamav
- stat_done
- fi
- fi
- ;;
- stop)
- if [ "$START_CLAMD" == "yes" ]; then
- stat_busy "Stopping ClamD"
- [ -n "$PID_CD" ] && kill $PID_CD &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- else
- rm_daemon clamav
- stat_done
- fi
- fi
-
- if [ "$START_FRESHCLAM" == "yes" ]; then
- stat_busy "Stopping FreshClam"
- [ -n "$PID_FC" ] && kill $PID_FC &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- else
- rm_daemon clamav
- stat_done
- fi
- fi
- ;;
- restart)
- $0 stop
- # will not start if not fully stopped, so sleep
- sleep 2
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
+ if [[ $START_FRESHCLAM = yes ]]; then
+ stat_busy "Stopping FreshClam"
+ [[ -n $PID_FC ]] && kill $PID_FC &> /dev/null
+ if [[ $? -gt 0 ]]; then
+ stat_fail
+ else
+ rm_daemon clamav
+ stat_done
+ fi
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
esac
exit 0