# $Id: Portfile 65698 2010-03-30 11:02:55Z ryandesign@macports.org $
PortSystem 1.0
name		bahamut
conflicts	whois
version		1.8.6
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     a814a4e0ff1fabcf026ea8574b4a1e20 \
		sha1    b08dfcf1e36e26029ab3254e274ce67fa02f81b2 \
		rmd160  ef1524485f3f50f78a80516577a2ac10a0ded2b5

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 mkdir ${destroot}${prefix}/etc
	file mkdir ${destroot}${prefix}/bin
	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/
}	

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