# Contributor: Bradley J Chambers <brad.chambers@gmail.com>
# Maintainer: Bradley J Chambers <brad.chambers@gmail.com>
pkgname=py-pdal
pkgver=1.6.0
pkgrel=0
pkgdesc="PDAL Python bindings"
url="https://github.com/pdal/pdal"
arch="x86 x86_64"
license="BSD"
makedepends="cython-dev python2-dev py-setuptools py-packaging pdal-dev pdal py-numpy-dev libxml2-dev"
install=""
subpackages="py2-${pkgname#py-}:_py2"
source="pdal-$pkgver.tar.gz::http://download.osgeo.org/${pkgname#py-}/PDAL-$pkgver-src.tar.gz"
builddir="$srcdir/PDAL-$pkgver-src/python"

build() {
        cd "$builddir"
        python2 setup.py build
}

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

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

_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="2e3bb90033d2248277bae241e4c9387f175e31abfeb3951d9ccaddca8d8f4cf58606d9a6c1730c69a5a0814f708366a271a38f80359d1f0db4572f45e102bc32  pdal-1.6.0.tar.gz"
