# $Id: Portfile,v 1.3 2005/09/13 06:57:48 olegb Exp $
PortSystem 1.0
name		bahamut
version		1.8.3
description	Bahamut is an Internet Relay Chat Daemon (IRCd) designed for DALnet.
long_description	${description}
maintainers	darwinports@opendarwin.org
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 2e782fe99656433ca24f6a9832d9aad5
patchfiles	patch-support.c
#depends_lib	lib:libsoup-2:libsoup port:evolution-data-server
worksrcdir	${name}-${version}
configure.args	--mandir=${prefix}/share/man 
configure.env   CPPFLAGS="-I${prefix}/include -L${prefix}/lib" \
                CFLAGS="-no-cpp-precomp -flat_namespace -undefined suppress" 
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/
}	
