# $Id: Portfile,v 1.2 2005/07/27 16:50:19 ben Exp $

PortSystem 1.0
PortGroup python24 1.0
name             py-scientific
version          2.4.9
categories       python science
maintainers      ben@opendarwin.org
description      Scientific Python
long_description ScientificPython is a collection of Python modules that \
		 are useful for scientific computing.
homepage         http://starship.python.net/~hinsen/ScientificPython/
master_sites	 ${homepage}
distname         ScientificPython-${version}
checksums        md5 a88602846bdb8a1e2c9f21dc3cf81341

depends_lib      port:netcdf \
		 port:py-numeric

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

variant mpi      {
depends_lib-append port:lammpi

post-build	 {
		 reinplace "s|%s %s -o mpipython|${prefix}/bin/%s -o mpipython -I${prefix}/include/python2.4 -I${worksrcpath}/Include|g" \
			${worksrcpath}/Src/MPI/compile.py
		 reinplace "s|-L%s -lpython%s|-L/Library/Frameworks/Python.framework/Versions/2.4/lib -L%s -lpython.%s|g" \
			${worksrcpath}/Src/MPI/compile.py
		 reinplace "s|cfgDict\\\[\'LINK|#cfgDict\\\[\'LINK|g" \
			${worksrcpath}/Src/MPI/compile.py
		 system "cd ${worksrcpath}/Src/MPI && python2.4 compile.py"
}

post-destroot    {
		 cd ${worksrcpath}/Src/MPI
		 xinstall -m 0755 mpipython ${destroot}${prefix}/bin
}
}
