# Template file for 'dma'
pkgname=dma
version=0.14
revision=1
conf_files="/etc/dma/*.conf"
make_dirs="/var/spool/dma 2775 root mail"
hostmakedepends="flex"
makedepends="openssl-devel"
short_desc="Small Mail Transport Agent (MTA), designed for home and office use"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="BSD-3-Clause"
homepage="https://github.com/corecode/dma"
distfiles="https://github.com/corecode/dma/archive/v${version}.tar.gz"
checksum=a36e77a59dd288a582dbeed7166ac4212e39120323bac75c74d7923e1d7b63e8
system_accounts="mail"

provides="smtp-server-0_1 smtp-forwarder-0_1"
replaces="smtp-server>=0 smtp-forwarder>=0"

if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
	makedepends+=" musl-legacy-compat"
fi

do_build() {
	make PREFIX=/usr SBIN=/usr/bin CC=$CC LEX=flex ${makejobs}
}

do_install() {
	vmkdir usr/bin
	make PREFIX=/usr SBIN=/usr/bin DESTDIR=${DESTDIR} sendmail-link mailq-link install-etc install
	vlicense LICENSE
}
