# Contributor: Isaac Dunham <ibid.ag@gmail.com>
# Maintainer: Isaac Dunham <ibid.ag@gmail.com>
pkgname=py-scipy
pkgver=0.19.1
pkgrel=1
pkgdesc="Python library for scientific computing"
url="http://www.scipy.org"
arch="all !s390x"
license="BSD"
depends="py-numpy-f2py"
makedepends="python2-dev python3-dev py-setuptools gfortran py-numpy-dev openblas-dev cython-dev"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="$pkgname-$pkgver.tar.gz::https://github.com/${pkgname#py-}/${pkgname#py-}/archive/v$pkgver.tar.gz"
builddir="$srcdir"/${pkgname#py-}-$pkgver

build() {
	cd "$builddir"
	export LDFLAGS="$LDFLAGS -shared"
	python2 setup.py config_fc --fcompiler=gnu95 build 
	python3 setup.py config_fc --fcompiler=gnu95 build 
}

package() {
	mkdir -p "$pkgdir"
}

_py2() {
	replaces="$pkgname"
	depends="${depends//^py-/py2-}" 
	_py python2
}

_py3() {
	depends="${depends//^py-/py3-}" 
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}


sha512sums="a9717bc42d5812f6929ceb330717be612c85d436d0134a0a6f5a9f802accb78090ace36e8b90759023a56e665dc95c439a1e0b51e4965bb51139ee0c9da1b695  py-scipy-0.19.1.tar.gz"
