# Contributor: Stuart Cardall # Maintainer: Stuart Cardall pkgname=py-lz4 pkgver=0.17.0 _pkgname=${pkgname#py-} pkgrel=0 pkgdesc="LZ4 Bindings for Python" url="https://pypi.python.org/pypi/lz4" arch="all" license="BSD" makedepends="python2-dev python3-dev py-setuptools lz4-dev" checkdepends="py-nose" # FIXME: check fails on s390x if [ "$CARCH" = "s390x" ]; then options="!check" fi subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2 $pkgname-tests:_tests:noarch" source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" builddir="$srcdir/$_pkgname-$pkgver" build() { cd "$builddir" python2 setup.py build python3 setup.py build } check() { cd "$builddir" python2 setup.py test } package() { mkdir -p "$pkgdir" } _py() { local python=$1 pkgdesc="$pkgdesc ${python#python}" depends="$python" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py install --prefix=/usr --root="$subpkgdir" } _py2() { replaces="$pkgname" _py python2 } _py3() { _py python3 } _tests() { pkgdesc="$pkgdesc (tests)" mkdir -p "$subpkgdir"/usr/share/$pkgname mv "$builddir"/tests "$subpkgdir"/usr/share/$pkgname } sha512sums="29af6839733cd57ee607e7e608a1aa2ab8c99aeb494b415af35ecad4efe26b1809a56a35dce045f1425043ebc9313fd99dcc81a1ac6d572b52d6debd14451207 lz4-0.17.0.tar.gz"