added extra/clamav, add arm fanotify numbers

This commit is contained in:
Kevin Mihelich 2013-09-20 03:39:40 +00:00
parent 31259b75a2
commit 51c3e7eedf
8 changed files with 150 additions and 0 deletions

66
extra/clamav/PKGBUILD Normal file
View file

@ -0,0 +1,66 @@
# $Id$
# Contributor: Dale Blount <dale@archlinux.org>
# Contributor: Gregor Ibic <gregor.ibic@intelicom.si>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - add ARM fanotify system call numbers
pkgname=clamav
pkgver=0.98
pkgrel=1
pkgdesc='Anti-virus toolkit for Unix'
url='http://www.clamav.net/'
license=('GPL')
options=('!libtool')
arch=('i686' 'x86_64')
depends=('bzip2' 'libltdl')
backup=('etc/logrotate.d/clamav')
source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz"
'service'
'service.fresh'
'logrotate'
'tmpfiles.d'
'config.patch'
'arm.patch')
sha1sums=('1e6a7284721387646c713a8d32fa8b5a897985db'
'b6ac0c5de1e5b41232b10d4f84e86201c370eaeb'
'cda9a087e5593992150cb456e34c5f6f589aca82'
'bb488a56b0f6a0760446cde89c1e3321e2717b78'
'a224ea9b4d0f4f196827347d54bed51e11c197ea'
'00dfadd93d11186793cb1161745f9dd7370beb99'
'7855de9eb13c1ec7623375d36f184a2c0b208fcc')
install=install
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch -p1 -i ../config.patch
patch -p1 -i ../arm.patch
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--sysconfdir=/etc/clamav \
--with-dbdir=/var/lib/clamav \
--disable-clamav \
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
install -Dm644 ../service.fresh "${pkgdir}"/usr/lib/systemd/system/freshclamd.service
install -Dm644 ../service "${pkgdir}"/usr/lib/systemd/system/clamd.service
install -Dm644 ../tmpfiles.d "${pkgdir}"/usr/lib/tmpfiles.d/clamav.conf
install -Dm644 ../logrotate "${pkgdir}"/etc/logrotate.d/clamav
install -d -o 64 -g 64 "${pkgdir}"/run/clamav
install -d -o 64 -g 64 "${pkgdir}"/var/log/clamav
install -d -o 64 -g 64 "${pkgdir}"/var/lib/clamav
}

13
extra/clamav/arm.patch Normal file
View file

@ -0,0 +1,13 @@
diff -urN a/clamd/fan-syscalllib.h b/clamd/fan-syscalllib.h
--- a/clamd/fan-syscalllib.h 2013-09-16 13:28:14.000000000 -0600
+++ b/clamd/fan-syscalllib.h 2013-09-19 21:29:47.314868930 -0600
@@ -10,6 +10,9 @@
#elif defined(__i386__)
# define __NR_fanotify_init 338
# define __NR_fanotify_mark 339
+#elif defined(__ARM_EABI__)
+# define __NR_fanotify_init 367
+# define __NR_fanotify_mark 368
#else
# error "System call numbers not defined for this architecture"
#endif

30
extra/clamav/config.patch Normal file
View file

@ -0,0 +1,30 @@
diff -arU 0 old/etc/clamd.conf.sample new/etc/clamd.conf.sample
--- old/etc/clamd.conf.sample 2010-12-02 19:31:21.773357389 +0100
+++ new/etc/clamd.conf.sample 2010-12-02 19:31:45.873357389 +0100
@@ -14 +14 @@
-#LogFile /tmp/clamd.log
+LogFile /var/log/clamav/clamd.log
@@ -34 +34 @@
-#LogTime yes
+LogTime yes
@@ -61 +61 @@
-#PidFile /var/run/clamd.pid
+PidFile /run/clamav/clamd.pid
@@ -65 +65 @@
-#TemporaryDirectory /var/tmp
+TemporaryDirectory /tmp
@@ -80 +80 @@
-#LocalSocket /tmp/clamd.socket
+LocalSocket /var/lib/clamav/clamd.sock
@@ -190 +190 @@
-#User clamav
+User clamav
diff -arU 0 old/etc/freshclam.conf.sample new/etc/freshclam.conf.sample
--- old/etc/freshclam.conf.sample 2010-12-02 19:31:21.773357389 +0100
+++ new/etc/freshclam.conf.sample 2010-12-02 19:31:51.190024057 +0100
@@ -17 +17 @@
-#UpdateLogFile /var/log/freshclam.log
+UpdateLogFile /var/log/clamav/freshclam.log
@@ -121 +121 @@
-#NotifyClamd /path/to/clamd.conf
+NotifyClamd /etc/clamav/clamd.conf

10
extra/clamav/install Normal file
View file

@ -0,0 +1,10 @@
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
}
post_remove() {
getent passwd clamav &>/dev/null && userdel clamav >/dev/null
getent group clamav &>/dev/null && groupdel clamav >/dev/null
return 0
}

10
extra/clamav/logrotate Normal file
View file

@ -0,0 +1,10 @@
/var/log/clamav/clamd.log /var/log/clamav/freshclam.log {
create 644 clamav clamav
sharedscripts
missingok
notifempty
postrotate
/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
}

10
extra/clamav/service Normal file
View file

@ -0,0 +1,10 @@
[Unit]
Description=clamav daemon
[Service]
Type=forking
PIDFile=/run/clamav/clamd.pid
ExecStart=/usr/bin/clamd
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,10 @@
[Unit]
Description=clamav updater
[Service]
Type=forking
PIDFile=/run/clamav/freshclam.pid
ExecStart=/usr/bin/freshclam -d -p /run/clamav/freshclam.pid
[Install]
WantedBy=multi-user.target

1
extra/clamav/tmpfiles.d Normal file
View file

@ -0,0 +1 @@
d /run/clamav 0755 clamav clamav