# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=pytest pkgver=3.1.1 pkgrel=0 pkgdesc="A python test library" url="http://pytest.org" arch="noarch" license="MIT" depends="py3-$pkgname" makedepends="python2-dev py-setuptools python3-dev" subpackages="py3-$pkgname:_py3 py2-$pkgname:_py2" 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"/usr/bin local name; for name in py.test pytest; do ln -s $name-3 "$pkgdir"/usr/bin/$name || return 1 done } _py2() { replaces="$pkgname" depends="py2-py" _py python2 } _py3() { depends="py3-py" _py python3 } _py() { local python="$1" local pyver="${1:6: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" # Add version suffix to executable files. local path; for path in "$subpkgdir"/usr/bin/*; do mv "$path" "$path-$pyver" || return 1 done } sha512sums="b990cdbcd9ed3da816d44b9de37cac9a27db50bfd426f5d1abf4247862f69124968f5aed684487f8076f0e7157ac532003380b45f3dfdfe06ffa1d4d97aad888 pytest-3.1.1.tar.gz"