# Contributor: Fabian Affolter # Contributor: Jakub Jirutka # Maintainer: Fabian Affolter pkgname=py-yaml _pkgname=PyYAML pkgver=5.1 pkgrel=0 pkgdesc="Python bindings for YAML" url="http://pyyaml.org" arch="all" license="MIT" depends="" makedepends="python2-dev python3-dev yaml-dev" subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" source="$_pkgname-$pkgver.tar.gz::https://github.com/yaml/pyyaml/archive/$pkgver.tar.gz" builddir="$srcdir/pyyaml-$pkgver" build() { cd "$builddir" python2 setup.py build python3 setup.py build } check() { cd "$builddir" python2 setup.py test python3 setup.py test } package() { mkdir -p "$pkgdir" } _py2() { replaces="$pkgname" _py python2 } _py3() { _py python3 } _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="e49f593b9f60018efa19629b902ad1e56f79537106a4cd019baa324a74a8af7563d294db012280261fc7fa9d686dd5af656e22fb4bf6a6ccfd0084515b9591d5 PyYAML-5.1.tar.gz"