# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=pytest pkgver=3.2.0 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="5ecf826aec47b585f30ef277b66330da51c841cad7967206171f6d94afd5f97179ff25f08113d65a33f6ca12ed61224d65b6b093336ef77b59836589d85259af pytest-3.2.0.tar.gz"