# -*- 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 92561 2012-05-01 11:49:33Z stromnov@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           select 1.0

name                py-cython
version             0.16
revision            0
categories-append   devel
license             Apache-2
platforms           darwin

maintainers         akitada openmaintainer

description         A language for writing C extension modules for Python.

long_description    Cython is a language that makes writing C extensions for \
                    the Python language as easy as Python itself. Cython is  \
                    based on the well-known Pyrex, but supports more cutting \
                    edge functionality and optimizations

homepage            http://www.cython.org/
master_sites        ${homepage}release/ \
                    http://pypi.python.org/packages/source/C/Cython/

distname            Cython-${version}

checksums           rmd160  168ef4138945a867ad19a4f05c924f9ce97008c0 \
                    sha256  971651fc5d3c943b0ecf7bc4df86a977bf62623d94542bf2aaa5f7223697e6fb

python.versions     24 25 26 27 32

if {$subport != $name} {

    post-destroot {
        if {$subport == "py24-cython" || $subport == "py25-cython"} {
            xinstall -m 644 -W ${worksrcpath}/Doc About.html FAQ.html \
                extension_types.html index.html overview.html primes.c sharing.html \
                special_methods.html ${destroot}${prefix}/share/doc/${subport}
            xinstall -m 644 -W ${worksrcpath} INSTALL.txt README.txt \
                ToDo.txt USAGE.txt ${destroot}${prefix}/share/doc/${subport}
            move ${destroot}${prefix}/bin/cython \
                ${destroot}${prefix}/bin/cython-${python.branch}
        } else {
            xinstall -m 755 -d ${destroot}${python.prefix}/share/doc/cython
            xinstall -m 644 -W ${worksrcpath}/Doc About.html FAQ.html \
                extension_types.html index.html overview.html primes.c sharing.html \
                special_methods.html ${destroot}${python.prefix}/share/doc/cython
            xinstall -m 644 -W ${worksrcpath} INSTALL.txt README.txt\
                ToDo.txt USAGE.txt ${destroot}${python.prefix}/share/doc/cython
        }
    }

    depends_run             port:cython_select
    test.run                no

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

    notes "
To make the Python ${python.branch} version of Cython the one that is run\
when you execute the commands without a version suffix, e.g. 'cython', run:

port select --set ${select.group} [file tail ${select.file}]
"
}

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     "Cython-(\\d+(?:\\.\\d+)*)${extract.suffix}"
