# $Id: Portfile,v 1.16 2004/11/19 00:31:04 jkh Exp $

PortSystem 1.0
name		jabber
version		1.4.2
revision	5
categories	net
maintainers	darwinports@opendarwin.org
description	Online presence and instant messaging server
long_description	The Jabber server (jabberd) is a daemon for Jabber clients to connect and communicate with.
platforms	darwin
master_sites	http://jabberd.jabberstudio.org/downloads/
checksums	md5 10780dbdb93926ea5bb360e1186b939c
depends_lib	lib:libiconv:libiconv lib:libexpat.0:expat \
	lib:libintl.3:gettext lib:libpth.a:pth
configure.env	CPPFLAGS=-no-cpp-precomp
build.type  gnu

platform darwin {
	configure.env	CFLAGS="-DBIND_8_COMPAT=1"
}

platform darwin 6 {
	configure.env   CPPFLAGS=-no-cpp-precomp
}

destroot {
	file mkdir ${destroot}${prefix}/etc
	file mkdir ${destroot}${prefix}/lib
	file mkdir ${destroot}${prefix}/sbin
	file mkdir ${destroot}${prefix}/share/man
	xinstall -o root -m 755 ${worksrcpath}/jabberd/jabberd ${destroot}${prefix}/sbin
		
	xinstall -o root -m 755 -d ${destroot}${prefix}/lib/jabber/pthsock
	xinstall -o root -m 755 ${worksrcpath}/pthsock/pthsock_client.so ${destroot}${prefix}/lib/jabber/pthsock
	
	xinstall -o root -m 755 -d ${destroot}${prefix}/lib/jabber/dialback
	xinstall -o root -m 755 ${worksrcpath}/dialback/dialback.so ${destroot}${prefix}/lib/jabber/dialback
	
	xinstall -o root -m 755 -d ${destroot}${prefix}/lib/jabber/dnsrv
	xinstall -o root -m 755 ${worksrcpath}/dnsrv/dnsrv.so ${destroot}${prefix}/lib/jabber/dnsrv
	
	xinstall -o root -m 755 -d ${destroot}${prefix}/lib/jabber/xdb_file
	xinstall -o root -m 755 ${worksrcpath}/xdb_file/xdb_file.so ${destroot}${prefix}/lib/jabber/xdb_file
	
	xinstall -o root -m 755 -d ${destroot}${prefix}/lib/jabber/jsm
	xinstall -o root -m 755 ${worksrcpath}/jsm/jsm.so ${destroot}${prefix}/lib/jabber/jsm
		
	xinstall -o root -m 755 -d ${destroot}${prefix}/etc/jabber/
	xinstall -o root -m 755 ${worksrcpath}/jabber.xml ${destroot}${prefix}/etc/jabber
	
	destroot.keepdirs \
		${destroot}${prefix}/var/lib/jabber \
		${destroot}${prefix}/var/run/jabber \
		${destroot}${prefix}/var/log/jabber \
		${destroot}${prefix}/var/spool/jabber

	file copy -force ${destroot}${prefix}/etc/jabber/jabber.xml ${destroot}${prefix}/etc/jabber/jabber.xml.default
}

variant ssl {
	depends_lib-append	lib:libssl.0.9:openssl
	configure.args	--enable-ssl
}
