# -*- 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 118350 2014-03-31 18:30:04Z g5pw@macports.org $

PortSystem          1.0
PortGroup           python 1.0

set _name           future
set _n              [string index ${_name} 0]

name                py-${_name}
version             0.11.4
categories-append   devel
platforms           darwin
supported_archs     noarch
license             MIT

maintainers         bo.ingv.it:Peter.Danecek openmaintainer

description         Provides clean single-source support for Python 3 and 2

long_description    \
    The Python package future is the missing compatibility layer between \
    Python 3 and Python 2. It allows you to use a single, clean Python \
    3.x-compatible codebase to support both Python 3 and Python 2 with \
    minimal overhead. The futurize script aids in converting code from \
    either Python 2 or Python 3 to code compatible with both platforms.

homepage            http://python-future.org/

distname            ${_name}-${version}
master_sites        https://pypi.python.org/packages/source/${_n}/${_name}/

checksums           md5     883e971706d7c4553ac2053c14e9a46f \
                    rmd160  0948b15fb366eb9e99283a3f8daf8e5ef6862345 \
                    sha256  e9ba55f1ebfb0d99fdf8545df77a60ffe6a04f699f3525d2a5911462b6e2a531

python.versions     26 27 33 34

if {${name} ne ${subport}} {
    depends_build-append    port:py${python.version}-setuptools

    # Add libs/features included in the standard lib with 2.7+
    if { ${python.version} == 26 } {
        depends_lib-append  port:py${python.version}-argparse \
                            port:py${python.version}-importlib \
                            port:py${python.version}-unittest2
    }

    # Adding documentation
    post-destroot {
        set dest_doc ${destroot}${prefix}/share/doc/${subport}
        xinstall -d  ${dest_doc}
        xinstall -m 755 -W ${worksrcpath} \
            README.rst \
            LICENSE.txt \
                ${dest_doc}
        eval copy [ glob ${worksrcpath}/docs/*.py  ] ${dest_doc}
        eval copy [ glob ${worksrcpath}/docs/*.rst ] ${dest_doc}
    }

    livecheck.type  none
} else {
    livecheck.type  regex
    livecheck.url   [lindex ${master_sites} 0]
    livecheck.regex ">${_name}-(\\d+(\\.\\d+)+)\\${extract.suffix}<"
}
