aboutsummaryrefslogtreecommitdiffstats
path: root/main/opensmtpd/APKBUILD
blob: f0fdc6e0057866653422914a16163f5d9b24dc47 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Jonathan Curran <jonathan@curran.in>
# Maintainer: Jonathan Curran <jonathan@curran.in>
pkgname=opensmtpd
pkgver=5.7.3p2
pkgrel=1
pkgdesc="secure, reliable, lean, and easy-to configure SMTP server"
url="http://www.opensmtpd.org"
arch="x86_64"
license="ISC"
depends=""
depends_dev=""
makedepends="automake autoconf libtool mdocml db-dev libasr-dev libevent-dev
	fts-dev openssl-dev bison flex-dev"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-doc"
source="https://www.opensmtpd.org/archives/opensmtpd-${pkgver}.tar.gz
	00-opensmtpd.patch
	smtpd.initd
	aliases"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	aclocal -I m4
	autoconf
	autoheader
	automake --foreign --add-missing --copy
}

build() {
	cd "$_builddir"
        ./configure --build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/smtpd \
		--enable-table-db \
		--with-privsep-user=smtpd \
		--with-queue-user=smtpq \
		--with-maildir=/var/spool/mail \
		--with-sock-dir=/run \
		--with-libs="-lfts" \
		--with-pie \
		--with-Werror \
		--mandir=/usr/share/man \
		--libexecdir=/usr/lib/$pkgname \
		--with-ca-file=/etc/ssl/certs/ca-certificates.crt \
		--with-mantype=doc || return 1
        make || return 1
}

package() {
        make DESTDIR=${pkgdir} -C "$_builddir" install || return 1
	sed -i 's#/etc/mail#/etc/smtpd#g' "$pkgdir"/etc/smtpd/smtpd.conf

	install -Dm755 "$srcdir"/smtpd.initd "$pkgdir"/etc/init.d/smtpd || return 1
	install -Dm644 "$srcdir"/aliases "$pkgdir"/etc/smtpd/aliases || return 1

	# Move sendmail to /usr/sbin to overwrite busyboxs sendmail.
	mv "$pkgdir"/usr/bin/sendmail "$pkgdir"/usr/sbin/ || return 1
}

md5sums="85bdccf1f28945771f79fd33e893cc43  opensmtpd-5.7.3p2.tar.gz
e90e077ee170c7806a4657f0fd5778b1  00-opensmtpd.patch
a2f311a82c9a85f5c52975c4dbbdbd53  smtpd.initd
561d2aead043a64a4ce5d66b4f78223e  aliases"
sha256sums="0d2973008d0f66bebb84bed516be6c32617735241cc54dd26643529281a8e52b  opensmtpd-5.7.3p2.tar.gz
1daa9b94e598db9b34e9a1fc717c834519824bdf7e87f1d6729c815ea5ca6acf  00-opensmtpd.patch
ab4b7f066a38dadd7a2dc6d7c3a06c3a8ac2367340d97e2a8b54f571ea0f8cf8  smtpd.initd
7bef80f8d86aa5463c864681482a4908d22ff8b6f3e47d2a410ef2d59b316b53  aliases"
sha512sums="bac0b8d6a6969a5e49a1d45b2c74cb2f3da44d06b12c7162500adf3ca312751020762bc8301075a9d7634d94cf51f978d04fac327f843680646e9e687737c42f  opensmtpd-5.7.3p2.tar.gz
c3a60ec3785903b3118feebde6021e20f1eb26a8d6e8b8c72ae19c6f9d6a9a2ceaee32c45a0ac3ff29d24018d169273f931378c1269eec32d7e36e5d98dd475d  00-opensmtpd.patch
8152fecadeb1d818b7865eae040123f855e81fafbb4b40d12a64336e09dc486c10e6828809182c8172bfd9f54dc7d050a154b61d5e6049df6ffd8a7b6e5e1277  smtpd.initd
929ba0b8befca6cad558602f9793a9c653923924ee524902916b8ef4952d1ea8a391895e7450ed9768eb82a07bd307b49561f5d49ea4711bd87a1a73eb8d7dad  aliases"