# -*- 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 105279 2013-04-15 23:53:55Z dh@macports.org $

PortSystem          1.0
PortGroup           python27 1.0

name                scons
version             2.3.0
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:project/scons/scons/${version}

checksums           rmd160  255f3022306bfb704296e3f15102bb6da517f73e \
                    sha256  9442069999cf4b2caa94a5886ab4c2c71de1718ed5e9176c18e2b6dbca463b4b

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.regex     /${name}-(\[0-9.\]+)${extract.suffix}
