# $Id: Portfile 91373 2012-03-31 00:08:55Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-zc-buildout
set real_name       zc.buildout
version             1.5.2
revision            2
python.versions     24 25 26 27
categories-append   devel
platforms           darwin
license             ZPL
maintainers         singingwolfboy openmaintainer
description         System for managing development buildouts
long_description  \
    The Buildout project provides support for creating applications, especially \
    Python applications. It provides tools for assembling applications from \
    multiple parts, Python or otherwise. An application may actually contain \
    multiple programs, processes, and configuration settings.

homepage            http://www.buildout.org
master_sites        http://pypi.python.org/packages/source/z/${real_name}
distname            ${real_name}-${version}
checksums           rmd160  4335f747986d05919e62627f2c8aeed5b23af9cb \
                    sha256  0ac5a325d3ffbc5a988fb3ba87f4159d4769cc73e3331cb5234edc8839b6506b
# https://github.com/koodaamo/cns.recipe.symlink/wiki/zc.buildout-bug-%23144228
patchfiles          fix-symlink-removal.patch

if {$name != $subport} {
    depends_lib-append      port:py${python.version}-distribute
post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${subport}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        CHANGES.txt DEVELOPERS.txt README.txt SYSTEM_PYTHON_HELP.txt \
        ${docdir}
    eval xinstall -m 644 [glob ${worksrcpath}/src/zc/buildout/*.txt] ${docdir}
    foreach file [glob ${destroot}${python.pkgd}/zc/buildout/*.txt] {
        delete $file
    }
    if {[file exists ${destroot}${prefix}/README.txt]} {
        delete ${destroot}${prefix}/README.txt 
    }
    if {[file exists ${destroot}${python.prefix}/README.txt]} {
        delete ${destroot}${python.prefix}/README.txt 
    }
    system "chmod -R 755 ${destroot}${python.pkgd}"
}
}
