# -*- 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-numeric
version         24.2
revision        3
categories-append   devel math
license         PSF
maintainers     {jmr @jmroot} openmaintainer
description     fast numerical array language for python

long_description \
    Numerical Python adds a fast, compact, \
    multidimensional array language facility to Python.

homepage        http://numpy.scipy.org/
master_sites    sourceforge:project/numpy/Old%20Numeric/${version}/ \
                freebsd
distname        Numeric-${version}

checksums       md5 2ae672656e06716a149acb048cca3093 \
                sha1 72869ef80c12630a9a125ba10c96093b6ae16aff \
                rmd160 c9502db28663558c535e236392c9beddec9743bb

python.versions 26 27

if {$subport ne $name} {
    patchfiles      patch-ranf.c.diff \
                    patch-Src-arrayobject.c.diff \
                    patch-Packages-dotblas-_dotblas.c.diff \
                    patch-changes.txt.diff
    
    build.env       CC=${configure.cc}

    platform macosx {
        post-patch {
            copy -force ${filespath}/customize.py-macosx ${worksrcpath}/customize.py
        }
    }

    platform puredarwin {
        post-patch {
            copy -force ${filespath}/customize.py-puredarwin ${worksrcpath}/customize.py
        }
    }

    pre-test {
        test.env    PYTHONPATH=[glob -nocomplain ${worksrcpath}/build/lib*]
    }

    python.test_framework
    test.run        yes
    test.cmd        ${python.bin} Test/test.py
    test.target

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
    
        xinstall -d \
            ${destroot}${docdir}/dotblas \
            ${destroot}${docdir}/MA \
            ${destroot}${docdir}/RNG
    
        xinstall -W ${worksrcpath} README changes.txt \
            ${destroot}${docdir}
    
        xinstall -m 0644 ${worksrcpath}/Packages/dotblas/doc/README.html \
            ${destroot}${docdir}/dotblas
    
        xinstall -m 0644 -W ${worksrcpath}/Packages/MA Legal.htm changes.txt \
            ${destroot}${docdir}/MA
    
        xinstall -m 0644 ${worksrcpath}/Packages/RNG/Legal.htm \
            ${destroot}${docdir}/RNG
    
        copy ${worksrcpath}/Demo ${destroot}${docdir}
        copy ${worksrcpath}/Packages/MA/Demo ${destroot}${docdir}/MA
    }
}

livecheck.type   none
