aboutsummaryrefslogtreecommitdiffstats
path: root/main/amavisd-new/APKBUILD
blob: a61070502a22b4fc82b2630cf3193fc04150e0dc (plain) (blame)
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
61
62
63
64
65
66
67
68
69
70
71
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=amavisd-new
pkgver=2.11.1
pkgrel=0
pkgdesc="High-performance interface between mailer (MTA) and content checkers"
url="http://www.ijs.si/software/amavisd"
arch="noarch"
license="GPL-2.0-or-later BSD"
depends="sed file perl perl-archive-zip perl-carp perl-convert-tnef
	perl-compress-raw-zlib perl-convert-uulib perl-digest-md5 perl-io
	perl-exporter perl-io-compress perl-io-stringy perl-mime-tools
	perl-mailtools perl-socket perl-net-libidn perl-net-server
	perl-time-hires perl-unix-syslog perl-db perl-mail-dkim
	perl-io-socket-inet6
	"
makedepends=""
install="$pkgname.pre-install"
options="!check"
subpackages=""
source="
	https://www.ijs.si/software/amavisd/$pkgname-$pkgver.tar.bz2
	amavisd.initd
	amavisd.confd
	"
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 -Dm755 "$srcdir"/amavisd.initd "$pkgdir"/etc/init.d/amavisd
	install -Dm644 "$srcdir"/amavisd.confd "$pkgdir"/etc/conf.d/amavisd

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

sha512sums="06180a4efa777af2f91781ba6e3ea302041c5dd721981d960bab24cecb160c17df8a927e95df9dd7ee5ba64004b8edd3c6c0c5ef7f96fd702d1d84e4a856ea83  amavisd-new-2.11.1.tar.bz2
6a9dd16a6b52f3d1fbd16887f29ccceddc58e88a02e681f23c1fe54b7e24feea5089d52813f4f3e87d9242daf79d2b2ea1e7c451d83d7de943403e71dc61c4e5  amavisd.initd
a5ce3583c34197f335372728cf92da23bae2cd7a9ae48daff6eaadbf66fbd5be6bb8b480b0fce1ea2b3a662b0a54d1d2f1f277d2f9a06d9630b57fa5d7ac2635  amavisd.confd"