# $Id: Portfile 107916 2013-07-09 06:16:51Z jmr@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           select 1.0

name                py-zc-buildout
set real_name       zc.buildout
version             2.2.0
python.versions     24 25 26 27
categories-append   devel
platforms           darwin
supported_archs     noarch
license             ZPL-2.1
maintainers         nomaintainer
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        https://pypi.python.org/packages/source/z/${real_name}
distname            ${real_name}-${version}
checksums           md5    771dd9807da7d5ef5bb998991c5fdae1 \
                    rmd160 8eba16e08c634d1455cef9b91953422e2ef3c8cd \
                    sha256 1dceaf912ed2219f133d8a956fc61c5973bf4d887d6eda268b0f825120c7ce23

if {$name != $subport} {
    depends_lib-append      port:py${python.version}-setuptools
    depends_run             port:buildout_select

    # https://github.com/koodaamo/cns.recipe.symlink/wiki/zc.buildout-bug-%23144228
    patchfiles          fix-symlink-removal.patch

    select.group            buildout
    select.file             ${filespath}/buildout${python.version}

    post-destroot {
        set docdir ${destroot}${prefix}/share/doc/${subport}
        xinstall -d ${docdir}
        xinstall -m 644 -W ${worksrcpath} \
            CHANGES.rst COPYRIGHT.txt DEVELOPERS.txt LICENSE.txt README.rst todo.txt \
            ${docdir}
        eval xinstall -m 644 [glob -directory ${worksrcpath}/src/zc/buildout *.txt] ${docdir}
        foreach file [glob -directory ${destroot}${python.pkgd}/zc/buildout *.txt] {
            delete $file
        }
    }
}
