APKBUILD 2.88 KB
Newer Older
1 2 3
# Contributor: Carlo Landmeter <clandmeter at gmail>
# Maintainer: Carlo Landmeter <clandmeter at gmail>
pkgname=clamav
4
pkgver=0.96.3
5
pkgrel=0
6 7
pkgusers=clamav
pkggroups=clamav
8 9 10
pkgdesc="An anti-virus toolkit for UNIX"
url="http://www.clamav.net/"
license="GPL"
11 12 13
depends="logrotate"
install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-upgrade"
makedepends="ncurses-dev zlib-dev"
14 15
subpackages="$pkgname-doc $pkgname-dev"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
16 17 18 19
	clamd.initd
	clamd.confd
	freshclam.initd
	freshclam.confd
20
	clamav-0.95.1-nls.patch
21
	clamav.logrotate
22
	"
23

24 25 26 27
_builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	cd "$_builddir"
28

29
	patch -p0 -i "$srcdir/clamav-0.95.1-nls.patch" || return 1
30 31 32 33
}

build() {
	cd "$_builddir"
34 35

	./configure --prefix=/usr \
36
		--sysconfdir=/etc/clamav \
37 38
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
39 40 41
		--without-iconv \
		--disable-llvm
	
42
	make || return 1
43 44 45 46 47
}

package() {
        cd "$_builddir"

48 49
	make DESTDIR="$pkgdir" install

50 51 52 53 54 55 56 57 58
        # Change /etc/clamd.conf to be usable out of the box
        sed -i -e "s:^\(Example\):\# \1:" \
                -e "s:.*\(PidFile\) .*:\1 /var/run/clamav/clamd.pid:" \
                -e "s:.*\(LocalSocket\) .*:\1 /var/run/clamav/clamd.sock:" \
                -e "s:.*\(User\) .*:\1 clamav:" \
                -e "s:^\#\(LogFile\) .*:\1 /var/log/clamav/clamd.log:" \
                -e "s:^\#\(LogTime\).*:\1 yes:" \
                -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
                "$pkgdir"/etc/clamav/clamd.conf
59

60 61 62 63 64 65 66 67 68
        # Do the same for /etc/freshclam.conf
        sed -i -e "s:^\(Example\):\# \1:" \
                -e "s:.*\(PidFile\) .*:\1 /var/run/clamav/freshclam.pid:" \
                -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
                -e "s:^\#\(UpdateLogFile\) .*:\1 /var/log/clamav/freshclam.log:" \
                -e "s:^\#\(NotifyClamd\).*:\1 /etc/clamav/clamd.conf:" \
                -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
                -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
                "$pkgdir"/etc/clamav/freshclam.conf
69

70 71
        install -m755 -D "$srcdir"/clamd.initd "$pkgdir"/etc/init.d/clamd
        install -m644 -D "$srcdir"/clamd.confd "$pkgdir"/etc/conf.d/clamd
72
        install -m755 -D "$srcdir"/freshclam.initd "$pkgdir"/etc/init.d/freshclam
73 74 75
        install -m644 -D "$srcdir"/freshclam.confd "$pkgdir"/etc/conf.d/freshclam
        install -m644 -D "$srcdir"/clamav.logrotate "$pkgdir"/etc/logrotate.d/clamav
        mkdir -p "$pkgdir"/var/run/clamav "$pkgdir"/var/log/clamav
76 77
}

78
md5sums="663274565c4da17abb112ff88895e510  clamav-0.96.3.tar.gz
79
d64432c463850663c5041c3097f3e903  clamd.initd
80
567bc32b657dd7031b9b7beaa946203a  clamd.confd
81
f4d1f415322905128dc27135566ad136  freshclam.initd
82
e48466ddfb56f66c623b83e58777b778  freshclam.confd
83
0d08fd29656bd4b018ecf8ce9706ac55  clamav-0.95.1-nls.patch
84
dffa5af2e7a563fc00fcd52ec4c02347  clamav.logrotate"