# $Id: Portfile 70338 2010-08-06 19:34:05Z ryandesign@macports.org $
PortSystem 1.0
name		bahamut
conflicts	whois
version		1.8.9
description	Bahamut is an Internet Relay Chat Daemon (IRCd) designed for DALnet.
long_description	${description}
maintainers	nomaintainer
categories	irc
platforms	darwin 
homepage	http://bahamut.dal.net/
distname	${name}-${version}-release
master_sites	${homepage}/download ftp://ftp.dal.net/dalnet/server/bahamut/

checksums	md5     e1a2b6ffab3c7a88bdd0a3561da4e5ee \
		sha1    64b783ed04983bb1f5ea2b75b3a479888413fb3e \
		rmd160  35b61b35aac8240b984c2a91ac16dcc47fb1a29b

patchfiles	patch-support.c

depends_lib	port:openssl
#depends_lib	lib:libsoup-2:libsoup port:evolution-data-server

worksrcdir	${name}-${version}

configure.args	--enable-openssl=${prefix}

universal_variant	no

pre-build {
	reinplace "s|INSTALL_DIR=${prefix}|INSTALL_DIR=${destroot}${prefix}|g" \
		${worksrcpath}/Makefile
	reinplace "s|INSTALL_DIR=${prefix}|INSTALL_DIR=${destroot}${prefix}|g" \
		${worksrcpath}/src/Makefile
	reinplace "s|INSTALL_DIR=${prefix}|INSTALL_DIR=${destroot}${prefix}|g" \
		${worksrcpath}/tools/Makefile
	reinplace "s|INSTALL_DIR=${prefix}|INSTALL_DIR=${destroot}${prefix}|g" \
		${worksrcpath}/doc/Makefile
}

post-destroot {
	file rename ${destroot}${prefix}/convert_conf ${destroot}${prefix}/bin/
	file rename ${destroot}${prefix}/mkpasswd ${destroot}${prefix}/bin/
	file rename ${destroot}${prefix}/ircd ${destroot}${prefix}/bin/
	file rename ${destroot}${prefix}/ircd.motd ${destroot}${prefix}/etc/
	file rename ${destroot}${prefix}/opers.txt ${destroot}${prefix}/etc/
	file rename ${destroot}${prefix}/template.conf ${destroot}${prefix}/etc/
	file rename ${destroot}${prefix}/reference.conf ${destroot}${prefix}/etc/
	file rename ${destroot}${prefix}/make-cert.cnf ${destroot}${prefix}/etc/
	file rename ${destroot}${prefix}/make-cert.sh ${destroot}${prefix}/bin/
	reinplace "s|${destroot}${prefix}|${prefix}/etc|g" ${destroot}${prefix}/bin/make-cert.sh
}	

livecheck.type	regex
livecheck.regex	${name}-(\[0-9.\]+)-release\\.tar
