aboutsummaryrefslogtreecommitdiffstats
path: root/main/amavisd-new/APKBUILD
blob: 9827bae01bc3885c7347538a0bfa8dbf763b9dda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=amavisd-new
pkgver=2.9.1
pkgrel=0
pkgdesc="High-performance interface between mailer (MTA) and content checkers"
url="http://www.ijs.si/software/amavisd"
arch="noarch"
license="GPL2+ BSD"
depends="sed file perl perl-archive-zip perl-convert-tnef
perl-convert-uulib perl-mime-tools perl-mail-tools perl-net-server
perl-io-stringy perl-unix-syslog perl-db perl-mail-dkim"
makedepends=""
install="$pkgname.pre-install"
subpackages=""
source="http://www.ijs.si/software/amavisd/$pkgname-$pkgver.tar.gz"
pkgusers="amavis"
pkggroups="amavis"

_builddir="$srcdir"/$pkgname-$pkgver
build() {
	return 0
}

package() {
	cd "$_builddir"
	(
	HOME=/var/amavis
	QUARANTINE=$HOME/quarantine
	USER=amavis
	GROUP=amavis
	DIRS="$HOME $HOME/tmp $HOME/var $HOME/db $HOME/home $QUARANTINE"
	CONFIG=/etc/amavisd.conf

	for dir in $DIRS
	do
		mkdir -p ${pkgdir}$dir
	done

	install -m 755 -o root -D amavisd $pkgdir/usr/sbin/amavisd
	install -m 755 -o root -D amavisd-nanny $pkgdir/usr/bin/amavisd-nanny
	install -m 755 -o root -D amavisd-release $pkgdir/usr/bin/amavisd-release
	sed -e "s:^.*\$MYHOME = .*$:\$MYHOME = '$HOME';:" \
	 -e 's:^.*\$TEMPBASE = .*$:\$TEMPBASE = "\$MYHOME/tmp";:' \
	 -e 's:^.*\$db_home  = .*$:\$db_home = "$MYHOME/db";:' \
	 -e "s:^.*\$QUARANTINEDIR = .*$:\$QUARANTINEDIR = '$QUARANTINE';:" \
	 -e "s:^.*\$daemon_user  = 'vscan';\(.*\)$:\$daemon_user  = 'amavis';\1:" \
	 -e "s:^.*\$daemon_group = 'vscan';\(.*\)$:\$daemon_group  = 'amavis';\1:" < amavisd.conf > amavisd.conf.alpine
	install -m 640 -o root -D amavisd.conf.alpine ${pkgdir}${CONFIG}
	install -m 755 -D ../../amavisd.init $pkgdir/etc/init.d/amavisd
	)

	chown -R amavis:amavis "$pkgdir"/var/amavis
	chmod -R 750 "$pkgdir"/var/amavis
	chown root:amavis "$pkgdir"/etc/amavisd.conf
}

md5sums="a1d75f118ae6e25b822be4a2d2fde807  amavisd-new-2.9.1.tar.gz"
sha256sums="dcb599fef892493f2add7fd50743c51850ed462037525edd5aea2fe2a52f9eb7  amavisd-new-2.9.1.tar.gz"
sha512sums="4a6a9e1d00b8c68c8f8d40f1ee04e9ece1ad658ae5560fcd3002d81b1fde08fdfbc29f673b2938a0c479ed5581adb789f28ab9b744e46884bb7c19c6401a9340  amavisd-new-2.9.1.tar.gz"