# Template file for 'nullmailer'
pkgname=nullmailer
version=2.2
revision=1
build_style=gnu-configure
configure_args="--enable-tls"
conf_files="/etc/nullmailer/*"
make_dirs="
	/var/spool/nullmailer/failed	0700	_nullmail	root
	/var/spool/nullmailer/queue	0700	_nullmail	root
	/var/spool/nullmailer/tmp	0700	_nullmail	root"
makedepends="gnutls-devel"
short_desc="Simple relay-only mail transport agent"
maintainer="Deneys S. Maartens <deneys.maartens@gmail.com>"
license="GPL-2.0-or-later"
homepage="https://untroubled.org/nullmailer/"
distfiles="https://untroubled.org/nullmailer/archive/nullmailer-${version}.tar.gz"
checksum=9886fa627b7e7e775e2f09fbe789247b1ca304f152da04ff705e50079263a855
system_accounts="_nullmail"

post_install() {
	for f in mailq sendmail; do
		mv ${DESTDIR}/usr/bin/{,nullmailer-}$f
		ln -sf nullmailer-$f ${DESTDIR}/usr/bin/$f
	done

	vinstall /dev/null 600 etc/nullmailer remotes
	vsv nullmailer

	# fifos cause xbps-create (v0.53) to segfault
	rm -vf ${DESTDIR}/var/spool/nullmailer/trigger
}
