# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=py-rarfile _pkgname=rarfile pkgver=2.8 pkgrel=0 pkgdesc="A RAR archive reader" url="https://github.com/markokr/rarfile" arch="noarch" license="ISC" makedepends="python2-dev python3-dev py-setuptools" subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" 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 || return 1 python3 setup.py build || return 1 } package() { mkdir -p "$pkgdir" } _py2() { replaces="$pkgname" _py python2 } _py3() { _py python3 } _py() { local python="$1" pkgdesc="$pkgdesc (for $python)" depends="$depends $python" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py install --prefix=/usr --root="$subpkgdir" } md5sums="98942f9c51468ca044738fe2e96fdd2d rarfile-2.8.tar.gz" sha256sums="2a27e401daa6d8ff0df1112a274a3661ca3e4afaac626217506fb1391069ca61 rarfile-2.8.tar.gz" sha512sums="6d249b1be9f286185d37fc5eaeae01c4b7153bf6248e66285099f7b9f920419986c27b006fd5511ffe4ae6e3b5214956ccb37ce5be5fc2673880cd7b2af0f98a rarfile-2.8.tar.gz"