From 977b78df305a06797773799a7295f2a5f3f013cf Mon Sep 17 00:00:00 2001 From: root Date: Sat, 31 Mar 2012 00:01:07 +0000 Subject: Sat Mar 31 00:01:07 UTC 2012 --- extra/clamav/PKGBUILD | 17 ++++++++++------- extra/clamav/config.patch | 2 +- extra/clamav/install | 4 ++-- extra/clamav/logrotate | 4 ++-- extra/clamav/rc.d | 5 ++--- extra/clamav/tmpfiles.d | 1 + 6 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 extra/clamav/tmpfiles.d (limited to 'extra/clamav') diff --git a/extra/clamav/PKGBUILD b/extra/clamav/PKGBUILD index e5dbf286e..1f9c4ccf4 100644 --- a/extra/clamav/PKGBUILD +++ b/extra/clamav/PKGBUILD @@ -1,11 +1,11 @@ -# $Id: PKGBUILD 153568 2012-03-16 04:06:01Z bisson $ +# $Id: PKGBUILD 154496 2012-03-29 15:43:20Z bisson $ # Contributor: Dale Blount # Contributor: Gregor Ibic # Maintainer: Gaetan Bisson pkgname=clamav pkgver=0.97.4 -pkgrel=1 +pkgrel=2 pkgdesc='Anti-virus toolkit for Unix' url='http://www.clamav.net/' license=('GPL') @@ -17,12 +17,14 @@ source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgver 'rc.d' 'conf.d' 'logrotate' + 'tmpfiles.d' 'config.patch') sha1sums=('56f90cf8a73acba8f97beca86b42c65c3923935d' - '50cfe02c97e4297a0efd25b23142408380305d30' + 'c9d508c1e5972f0f849d8694c1872455fa9e74de' 'cb116cdab49a810381a515cbcfb6a6c148547f07' - 'be3310d2b41a68ce06e33c84ab68ffe59fdce104' - '701a61571788d10ff7af01597785835c6bfea918') + '7cace58743a36dae3e63e5e0c6cc73ea5ef9a6ee' + 'a224ea9b4d0f4f196827347d54bed51e11c197ea' + '1c8ef193919b041135115170acd6313f008de808') install=install @@ -44,15 +46,16 @@ package() { cd "${srcdir}/${pkgname}-${pkgver}" make DESTDIR="${pkgdir}" install - # make sure conf files get installed, because make install + # Make sure conf files get installed, because make install # doesn't do that if clamav is already installed upon building. install -D -m644 etc/clamd.conf "${pkgdir}/etc/clamav/clamd.conf" install -D -m644 etc/freshclam.conf "${pkgdir}/etc/clamav/freshclam.conf" + install -D -m644 ../tmpfiles.d "${pkgdir}/usr/lib/tmpfiles.d/clamav.conf" install -D -m644 ../logrotate "${pkgdir}/etc/logrotate.d/clamav" install -D -m644 ../conf.d "${pkgdir}/etc/conf.d/clamav" install -D -m755 ../rc.d "${pkgdir}/etc/rc.d/clamav" - # un-distribute databases to require freshclam + # Un-distribute databases to require freshclam. rm "${pkgdir}"/var/lib/clamav/*.cvd } diff --git a/extra/clamav/config.patch b/extra/clamav/config.patch index a0105bd48..0640df2c3 100644 --- a/extra/clamav/config.patch +++ b/extra/clamav/config.patch @@ -9,7 +9,7 @@ diff -arU 0 old/etc/clamd.conf new/etc/clamd.conf +LogTime yes @@ -61 +61 @@ -#PidFile /var/run/clamd.pid -+PidFile /var/run/clamav/clamd.pid ++PidFile /run/clamav/clamd.pid @@ -65 +65 @@ -#TemporaryDirectory /var/tmp +TemporaryDirectory /tmp diff --git a/extra/clamav/install b/extra/clamav/install index 144134dde..a2092e815 100644 --- a/extra/clamav/install +++ b/extra/clamav/install @@ -2,9 +2,9 @@ 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/clamav - chown clamav:root /var/log/clamav chown -R clamav:clamav /var/lib/clamav + install -o clamav -g clamav -d /run/clamav + install -o clamav -g clamav -d /var/log/clamav } post_remove() { diff --git a/extra/clamav/logrotate b/extra/clamav/logrotate index d1dc94dce..6a9051bed 100644 --- a/extra/clamav/logrotate +++ b/extra/clamav/logrotate @@ -2,7 +2,7 @@ create 644 clamav clamav sharedscripts postrotate - /bin/kill -HUP `cat /var/run/clamav/clamd.pid 2>/dev/null` 2> /dev/null || true - /bin/kill -HUP `cat /var/run/clamav/freshclam.pid 2>/dev/null` 2> /dev/null || true + /bin/kill -HUP `cat /run/clamav/clamd.pid 2>/dev/null` 2> /dev/null || true + /bin/kill -HUP `cat /run/clamav/freshclam.pid 2>/dev/null` 2> /dev/null || true endscript } diff --git a/extra/clamav/rc.d b/extra/clamav/rc.d index 04e959903..127c86c0f 100644 --- a/extra/clamav/rc.d +++ b/extra/clamav/rc.d @@ -3,8 +3,7 @@ . /etc/rc.conf . /etc/rc.d/functions -[[ -f /etc/conf.d/clamav ]] && . /etc/conf.d/clamav -[[ -d /var/run/clamav ]] || install -d -o clamav -g root /var/run/clamav +[[ -f /etc/conf.d/clamav ]] && source /etc/conf.d/clamav PID_FC=$(pidof -o %PPID /usr/bin/freshclam) PID_CD=$(pidof -o %PPID /usr/sbin/clamd) @@ -24,7 +23,7 @@ case "$1" in 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 + [[ -z $PID_FC ]] && /usr/bin/freshclam -p /run/clamav/freshclam.pid -d $FRESHCLAM_OPTS if [[ $? -gt 0 ]]; then stat_fail else diff --git a/extra/clamav/tmpfiles.d b/extra/clamav/tmpfiles.d new file mode 100644 index 000000000..22d29941e --- /dev/null +++ b/extra/clamav/tmpfiles.d @@ -0,0 +1 @@ +d /run/clamav 0755 clamav clamav -- cgit v1.2.3-54-g00ecf