# -*- 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

PortSystem          1.0
PortGroup           python 1.0

name                py-setuptools
version             40.8.0
categories-append   devel
# License status is murky. The current maintainer decided to relicense as
# MIT, but he doesn't appear to have obtained the permission of previous
# contributors to do so. Thus it has to be assumed that portions are still
# under the previous license. The vendored copy of the 'packaging' module is
# dual licensed under Apache-2 or BSD.
license             MIT {PSF ZPL} {Apache-2 BSD}
maintainers         {jmr @jmroot} openmaintainer
description         distutils enhancement for build and distribution
long_description \
    setuptools is a collection of enhancements to the Python distutils that \
    allow you to more easily build and distribute Python packages, \
    especially ones that have dependencies on other packages.

platforms           darwin
supported_archs     noarch

homepage            https://pypi.org/project/setuptools/
master_sites        pypi:s/setuptools/
use_zip             yes

checksums           rmd160 1ad540c706903ce62d098a54ba81c58a4ce221a2 \
                    sha256 6e4eec90337e849ade7103723b9a99631c1f0d19990d6e8412dc42f5ae8b304d

python.versions     26 27 33 34 35 36 37
python.link_binaries no

if {$subport ne $name} {
    if {${python.version} == 26} {
        version     36.8.0
        revision    0
        checksums   md5    3ecaa938a4c95a74dfbcd6340a47c7c5 \
                    rmd160 457c838b9fb09cf0bf9ba519a098e1c009710aa3 \
                    sha256 b2aa5a00e9e4fd20f3c3dd412d490921746efe14bda34d53973c4a59ab05b35d
    } elseif {${python.version} == 33} {
        version     39.2.0
        revision    0
        checksums   rmd160 6070de164cf74412fe7c9a9d04031112b06cfc2a \
                    sha256 f7cddbb5f5c640311eb00eab6e849f7701fa70bf6a183fc8a2c33dd1d1672fb2
    }
    distname        setuptools-${version}

    build.env-append    SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
    destroot.env-append SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
    post-destroot {
       xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}
       xinstall -m 644 -W ${worksrcpath} CHANGES.rst README.rst \
          ${destroot}${prefix}/share/doc/${subport}
       ln -s ${python.prefix}/bin/easy_install-${python.branch} ${destroot}${prefix}/bin
    }
    livecheck.type      none
}
