PortSystem      1.0

name            boost-build
version         2.0-m12
revision        2
categories      devel
maintainers     nomaintainer
license         Boost-1

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:project/boost/boost-build/${version}
use_bzip2       yes
checksums       md5 38a40f1c0c2d6eb4f14aa4cf52e9236a \
                sha1 cd3c06b7b0bcb12ccc9d5e374966ddff5984412a \
                rmd160 de52a80c55d3ba8e38e199bfbb7c512642471e4e
platforms       any
supported_archs noarch

patchfiles      patch-tools-darwin.jam.diff

depends_run     port:boost-jam

worksrcdir      ${name}

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

build {}

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