PortSystem 1.0

name			clamsmtp
version			1.10
categories		mail security
platforms		darwin
license			BSD
maintainers		nomaintainer
description		SMTP filter checking for viruses using the ClamAV anti-virus
long_description	ClamSMTP is an SMTP filter that allows you to check for \
					viruses using the ClamAV anti-virus software. It accepts \
					SMTP connections and forwards the SMTP commands and \
					responses to another SMTP server. The 'DATA' email body is \
					intercepted and scanned before forwarding.

homepage		http://thewalter.net/stef/software/${name}/
master_sites	${homepage}
checksums		rmd160 464047852f91d46af79340f10179106c2fb22bbc \
			sha256 a52fdb4b26e11ece30c478a806c95b1eda16f4e73937bd560ece7017fb0df92a

depends_run		bin:clamd:clamav

configure.args	--mandir=${prefix}/share/man

build.args		CFLAGS=-I${prefix}/include \
				LDFLAGS=-L${prefix}/lib

post-destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/ \
		${destroot}${prefix}/var/run/
	xinstall -m 644 ${worksrcpath}/doc/clamsmtpd.conf \
		${destroot}${prefix}/etc/clamsmtpd.conf.sample
	xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING ChangeLog NEWS README \
		${destroot}${prefix}/share/doc/${name}
}
destroot.keepdirs	${destroot}${prefix}/var/run

set pidfile			${prefix}/var/run/clamsmtpd.pid
startupitem.create	yes
startupitem.name	ClamSMTP
startupitem.start	\
	"if \[ -r ${prefix}/etc/clamsmtpd.conf \]; then
		${prefix}/sbin/clamsmtpd -p ${pidfile}
	fi"
startupitem.stop	\
	"if \[ -r ${pidfile} \]; then
		kill \$(cat ${pidfile})
	fi"

