# $Id: Portfile,v 1.3 2005/08/11 21:33:18 rshaw Exp $
PortSystem		1.0

name			boost-build
version			2.0-m10
categories		devel
maintainers		darwinports@opendarwin.org
description		Build system for large project software construction
long_description 	Boost.Build is a system for large project software \
					construction, which is simple to use and powerfull. \
					Boost.Build V2 is an onging project to rewrite \
					Boost.Build, improving design and making it more \
					extensible.
homepage		http://www.boost.org
master_sites	sourceforge:boost
use_bzip2		yes
checksums		md5 ebbe60121ad9aedbbec7ab3066c75424
platforms		darwin

depends_run		bin:bjam:boost-jam

worksrcdir		${name}

configure {
	cd ${worksrcpath}
	file delete -force debian jam_src/debian
	reinplace "s|/usr/local|${prefix}|" \
		doc/html/bbv2/faq.html \
		doc/src/faq.xml \
		jam_src/RELNOTES \
		jam_src/Jamfile.html \
		jam_src/Jambase \
		jam_src/jam.h \
		jam_src/jambase.c
	reinplace "s|+= /usr/include|+= ${prefix}/include|" \
		jam_src/Jambase \
		jam_src/jambase.c
	reinplace "s|/usr/ccs/bin/ar|/usr/bin/ar|" \
		jam_src/RELNOTES \
		jam_src/Jambase \
		jam_src/jambase.c
	reinplace "s|/usr/share/boost-build|${prefix}/share/${name}|" \
		jam_src/Jambase \
		jam_src/jambase.c
	reinplace "s|/usr/.*/qt|${prefix}/share/qt3|" \
		example/qt/project-root.jam \
		user-config.jam
	if {[catch {set python [binaryInPath python]} result] == 0} {
		foreach dir {test example/customization jam_src} {
			foreach script [glob $dir/*.py] {
				reinplace "s|^#!.*python|#!${python}|" ${script}
			}
		}
	}
}

build {}

destroot {
	system "cp -R ${worksrcpath} ${destroot}${prefix}/share/${name}"
}

