# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 85603 2011-10-15 05:56:46Z jmr@macports.org $

PortSystem      1.0
PortGroup       python26 1.0

name            py26-scientific-devel
version         2.9.0
categories      python science
platforms       darwin
maintainers     gmail.com:danmichaelo+macports openmaintainer
description     Scientific Python

long_description \
    ScientificPython is a collection of Python modules that \
    are useful for scientific computing.

homepage        http://dirac.cnrs-orleans.fr/ScientificPython/
master_sites    http://sourcesup.cru.fr/frs/download.php/2372/
distname        ScientificPython-${version}

checksums       md5 babbbb708d235094d75478bdeb8d4c7f \
                sha1 60fb1ec7c31c86b7e7a068ccda780197e1e95ad8 \
                rmd160 2533879b64fcb17027b11784fc0cff4351284c98

depends_lib     port:netcdf \
                port:py26-numpy

conflicts       py26-scientific

build.args		--numpy

build.env    	CPPFLAGS="-I${python.include} \
	            -I${worksrcpath}/Include" \
                NETCDF_PREFIX=${prefix}

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

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

variant mpi description {Enable lammpi support} {
    depends_lib-append  port:lammpi
    patchfiles-append patch-Src-MPI-compile.py.diff
    post-build {
        reinplace "s|@prefix@|${prefix}|g" ${worksrcpath}/Src/MPI/compile.py
        reinplace "s|@worksrcpath@|${worksrcpath}|g" ${worksrcpath}/Src/MPI/compile.py
        system "cd ${worksrcpath}/Src/MPI && ${prefix}/bin/python${python.branch} compile.py"
    }
    post-destroot {
        xinstall ${worksrcpath}/Src/MPI/mpipython ${destroot}${python.prefix}/bin
        ln -s ${python.prefix}/bin/mpipython ${destroot}${prefix}/bin/mpipython-${python.branch}
    }
}


livecheck.type  regex
livecheck.url   http://sourcesup.cru.fr/projects/scientific-py/
livecheck.regex {<strong>Development Releases</strong></td><td>(\d+(?:\.\d+)*)}
