# $Id: Portfile 30232 2007-10-22 23:05:56Z jmpp@macports.org $
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	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 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.cppflags-append "-L${prefix}/lib"
configure.cflags-append "-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/
}	
