# $Id: Portfile,v 1.8 2005/11/09 02:37:38 yeled Exp $
PortSystem 1.0
PortGroup perl5 1.0

perl5.setup		Mail-SpamAssassin 3.0.4
maintainers		darwinports@opendarwin.org
categories-append	mail
description		mail filter to identify spam
long_description	SpamAssassin(tm) is a mail filter to identify spam. \
					Using its rule base, it uses a wide range of \
					heuristic tests on mail headers and body text to \
					identify spam, also known as unsolicited commercial \
					email.
homepage		http://www.spamassassin.org/
master_sites-append	${homepage}/released/
checksums		md5 51926fe5aabaf57eed2c09061fe8fb02
platforms		darwin sunos

# Depends on these Perl modules
depends_lib-append	port:p5-digest-sha1 \
					port:p5-html-parser \
					port:p5-mailtools \
					port:p5-mail-audit \
					port:p5-net-dns \
					port:p5-net-ident

post-patch {
	reinplace "s|return ''|return 'PRIV'|" ${worksrcpath}/Makefile.PL
}

set datadir		${prefix}/share/spamassassin
set confdir		${prefix}/etc/mail/spamassassin

configure.args-append	CONTACT_ADDRESS=root@localhost \
						PREFIX=${prefix} \
						SYSCONFDIR=${prefix}/etc \
						DATADIR=${datadir} \
						CONFDIR=${confdir}

variant	razor {
	depends_lib-append		port:p5-razor-agents
	configure.args-append	RUN_RAZOR_TESTS=yes
}

variant	ssl {
	depends_lib-append		lib:libssl.0.9:openssl \
							port:p5-io-socket-ssl
	configure.args-append	ENABLE_SSL=yes
}

variant bayes {
	depends_lib-append		port:p5-db_file
}

destroot.target-append	conf__install data__install

