aboutsummaryrefslogtreecommitdiffstats
path: root/community/exim/APKBUILD
blob: c671d894183f5eda71ac6410bc25d5dc27bf66d8 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Contributor: Ash Berlin-Taylor <ash.berlin@gmail.com>
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
# Contributor: Jesse Young <jlyo@jlyo.org>
# Maintainer: Jesse Young <jlyo@jlyo.org>
pkgname=exim
pkgver=4.92.2
pkgrel=0
pkgdesc="Message Transfer Agent"
url="https://www.exim.org/"
arch="all"
license="GPL-2.0-or-later"
options="!check suid"
depends="ca-certificates"
pkgusers="$pkgname"
pkggroups="$pkgname mail"
makedepends="bash db-dev gawk libidn-dev openssl-dev libspf2-dev linux-headers mariadb-connector-c-dev
	pcre-dev perl postgresql-dev sqlite-dev"
install="exim.pre-install"
subpackages="$pkgname-cdb $pkgname-dbmdb $pkgname-dnsdb $pkgname-sqlite $pkgname-mysql $pkgname-postgresql
	$pkgname-utils $pkgname-scripts::noarch $pkgname-doc $pkgname-openrc"
source="https://ftp.exim.org/pub/exim/exim4/$pkgname-$pkgver.tar.xz
	bounce-charset.patch
	exim.Makefile
	exim.confd
	exim.initd
	exim.logrotate
	exim.gencert"

# secfixes:
#   4.92.2-r0:
#     - CVE-2019-15846
#   4.92.1-r0:
#     - CVE-2019-13917
#   4.92-r0:
#     - CVE-2019-10149
#   4.91-r0:
#     - CVE-2018-6789
#   4.89-r5:
#     - CVE-2017-1000369
#   4.89-r7:
#     - CVE-2017-16943
#   4.89.1-r0:
#     - CVE-2017-16944
#   4.90.1-r0:
#     - CVE-2018-6789

prepare() {
	default_prepare

	cp "$srcdir"/$pkgname.Makefile Local/Makefile
	sed -i \
		-e 's/-lnsl//g' \
		-e 's/^HAVE_ICONV.*$//' \
		OS/Makefile-Linux
}

build() {
	make makefile
	make -j1
}

package() {
	install -m750 -D -g mail -d "$pkgdir"/etc/mail
	make DESTDIR="$pkgdir" INSTALL_ARG="-no_symlink -no_chown exim" install
	install -D -m644 doc/exim.8 "$pkgdir"/usr/share/man/man8/exim.8
	cd "$pkgdir"/usr/sbin
	mv exim-${pkgver%.*}* exim
	chmod u+s exim
	local i; for i in mailq rmail rsmtp runq sendmail newaliases; do
		ln -s exim $i
	done
	install -Dm644 "$srcdir"/$pkgname.logrotate "$pkgdir"/etc/logrotate.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	# Fix clamav local socket path, Add variant to spamd address
	sed -i \
		-e 's~# av_scanner = clamd:/tmp/clamd~# av_scanner = clamd:/run/clamav/clamd.sock~' \
		-e '/# spamd_address = 127.0.0.1 783/a# spamd_address = 127.0.0.1 11333 variant=rspamd' \
		"$pkgdir"/etc/$pkgname/$pkgname.conf
	# Create subdirs for logs and extensions
	install -dm750 -o $pkgname -g mail "$pkgdir"/var/log/$pkgname
	mkdir -p "$pkgdir"/usr/lib/$pkgname
}

scripts() {
	pkgdesc="EXIM scripts"
	depends="$pkgname perl"
	cd "$builddir"
	make	DESTDIR="$subpkgdir" \
		INSTALL_ARG="exicyclog exim_checkaccess eximstats exiqgrep exigrep exinext exiqsumm exipick exiwhat convert4r3 convert4r4" \
		install
	rm -fr "$subpkgdir"/etc
}

utils() {
	pkgdesc="EXIM utils"
	depends="$pkgname"
	cd "$builddir"
	make	DESTDIR="$subpkgdir" \
		INSTALL_ARG="exim_dbmbuild exim_dumpdb exim_tidydb exim_fixdb exim_lock" \
		install
	install -m755 "$srcdir"/exim.gencert "$subpkgdir"/usr/sbin/exim_gencert
	rm -fr "$subpkgdir"/etc
}

_mv_ext() {
	pkgdesc="EXIM extension: $1"
	depends="$pkgname"
	install -D -m755 "$builddir"/build-Linux-*/lookups/$1.so "$subpkgdir"/usr/lib/$pkgname/$1.so
}

sqlite() { _mv_ext sqlite; }
mysql() { _mv_ext mysql; }
postgresql() { _mv_ext pgsql; }
cdb() { _mv_ext cdb; }
dbmdb() { _mv_ext dbmdb; }
dnsdb() { _mv_ext dnsdb; }

sha512sums="d27aca4d4e9df267b0afcbe7b3f74c9ca6e96e7e6eb4d2f86ff00b0e2234eaec90271405eb387a36a2e0d4ec5597b2920753f85318a5618ddbc8af475a7d81cd  exim-4.92.2.tar.xz
691df92954f015711398350963ea321d143127bc731a985bcacc5364c71b6df84b6c21a2e8dc3cc2048fcd3dd02def3dc8015f4d84dd672f23d5a41348e72dc7  bounce-charset.patch
f764a09ac7b6dfa34a5cd8bf5ad8b5fea355ac3b21a14f7218c84804bce420c6212cbebd2811fa40b0034dba626f0c9b293de77dbd634432edd31b237003515e  exim.Makefile
bb6f5ead067af19ace661cc92bcd428da97570aedd1f9dc5b61a34e7e3fb3e028be6c96d51df73353bdfcaf69a3ee053fb03d245f868d63ebf518aa96ec82d66  exim.confd
3769e74a54566362bcdf57c45fbf7d130d7a7529fbc40befce431eef0387df117c71a5b57779c507e30d5b125913b5f26c9d16b17995521a1d94997be6dc3e02  exim.initd
28e748693a6a72d9943fa9c342ff041fe650fa6977f468dee127e845e6c2a91872ce33fb6f5698838906bde3ed92de7a91cdb0349cedc40b806261867e8c06cb  exim.logrotate
abdaf749ed3947a75b997caa300bf9f27ef82760f1854aa4521a9ac0f322f1655b65a375bc7a709259daea88bf93cfab5289997fa8e376fac9a3477f09bab642  exim.gencert"