# Contributor: Fabian Affolter # Contributor: Jakub Jirutka # Maintainer: Fabian Affolter pkgname=py-yaml _pkgname=PyYAML pkgver=5.1.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="5c89f432b370990702db74b1e54fa185c38d2666377d3325aebcbb4841897aa2039b10a2c8196ce7ed4bb1300a854312335d3475821d785016190d70195f1480 PyYAML-5.1.1.tar.gz"