Date: Tuesday, December 7, 2010 @ 06:08:27 Author: jgc Revision: 102335
upgpkg: python-numpy 1.5.1-1 Update to 1.5.1, build with both python2 and python3 Modified: python-numpy/trunk/PKGBUILD ----------+ PKGBUILD | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 13 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2010-12-07 10:09:51 UTC (rev 102334) +++ PKGBUILD 2010-12-07 11:08:27 UTC (rev 102335) @@ -3,34 +3,59 @@ # Contributor: Douglas Soares de Andrade <[email protected]> # Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve> -pkgname=python-numpy -pkgver=1.5.0 -pkgrel=2 +pkgbase=python-numpy +pkgname=('python2-numpy' 'python3-numpy') +pkgver=1.5.1 +pkgrel=1 pkgdesc="Scientific tools for Python" arch=('i686' 'x86_64') license=('custom') url="http://numpy.scipy.org/" -depends=('lapack' 'python2') -makedepends=('python-nose' 'gcc-fortran') -optdepends=('python-nose: test suite') +makedepends=('lapack' 'python' 'python2' 'python-distribute' 'python2-distribute' 'gcc-fortran' 'python-nose') source=(http://downloads.sourceforge.net/numpy/numpy-${pkgver}.tar.gz) -md5sums=('3a8bfdc434df782d647161c48943ee09') +md5sums=('376ef150df41b5353944ab742145352d') build() { - cd "${srcdir}/numpy-${pkgver}" + cd "${srcdir}" + cp -a numpy-${pkgver} numpy-py2-${pkgver} export Atlas=None export LDFLAGS="$LDFLAGS -shared" + + echo "Building Python2" + cd "${srcdir}/numpy-py2-${pkgver}" python2 setup.py config_fc --fcompiler=gnu95 build + + echo "Building Python3" + cd "${srcdir}/numpy-${pkgver}" + python setup.py config_fc --fcompiler=gnu95 build } -package() { - cd "${srcdir}/numpy-${pkgver}" +package_python2-numpy() { + depends=('lapack' 'python2') + provides=("python-numpy=${pkgver}") + replaces=('python-numpy') + conflicts=('python-numpy') + optdepends=('python-nose: testsuite') + + cd "${srcdir}/numpy-py2-${pkgver}" python2 setup.py config_fc --fcompiler=gnu95 install --prefix=/usr --root="${pkgdir}" - install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -m755 -d "${pkgdir}/usr/share/licenses/python2-numpy" + install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python2-numpy/" sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \ - -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \ - $(find $pkgdir -name '*.py') + -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \ + -e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \ + $(find ${pkgdir} -name '*.py') } + +package_python3-numpy() { + depends=('lapack' 'python') + + cd "${srcdir}/numpy-${pkgver}" + python setup.py config_fc --fcompiler=gnu95 install --prefix=/usr --root="${pkgdir}" + + install -m755 -d "${pkgdir}/usr/share/licenses/python3-numpy" + install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python3-numpy/" +}
