# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 84550 2011-09-27 21:05:11Z snc@macports.org $

PortSystem          1.0
PortGroup           python27 1.0

name                scons
version             2.0.1
revision            1
categories          devel python
license             MIT
maintainers         landonf openmaintainer

description         Software construction tool
long_description \
    SCons is an Open Source software construction tool--that is, a \
    next-generation build tool. Think of SCons as an improved, \
    cross-platform substitute for the classic Make utility with integrated \
    functionality similar to autoconf/automake and compiler caches such as \
    ccache.

platforms           darwin
supported_archs     noarch

homepage            http://www.scons.org/
master_sites        sourceforge

checksums           md5     beca648b894cdbf85383fffc79516d18 \
                    sha1    f9183f1b29cb94b48bb3175608831276e60b8fc5

patchfiles          patch-setup.py patch-scons patch-sconsign patch-scons-time
post-patch {
    reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/script/scons \
        ${worksrcpath}/script/sconsign ${worksrcpath}/script/scons-time
}

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/man/man1 \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} CHANGES.txt LICENSE.txt README.txt \
        RELEASE.txt ${destroot}${prefix}/share/doc/${name}
    foreach binfile [glob -tails -directory ${destroot}${python.prefix}/bin *] {
        ln -s ${python.prefix}/bin/${binfile} \
            ${destroot}${prefix}/bin/${binfile}
    }
    foreach manfile [glob -tails -directory ${destroot}${python.prefix}/share/man/man1 *] {
        ln -s ${python.prefix}/share/man/man1/${manfile} \
            ${destroot}${prefix}/share/man/man1/${manfile}
    }
}

livecheck.type  regex
livecheck.regex {Stable \((\d+(?:\.\d+)*)\)}
