# Contributor: Carlo Landmeter # Maintainer: Carlo Landmeter pkgname=py-zope-deferredimport _pkgname=zope.deferredimport pkgver=4.3.1 pkgrel=0 pkgdesc="Defer imports until used by code" url="https://github.com/zopefoundation/$_pkgname" arch="noarch" license="ZPL-2.1" depends="py-setuptools py-zope-proxy" makedepends="python2-dev python3-dev" subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" source="$_pkgname-$pkgver.tar.gz::https://github.com/zopefoundation/$_pkgname/archive/$pkgver.tar.gz" builddir="$srcdir"/$_pkgname-$pkgver build() { python2 setup.py build python3 setup.py build } check() { python2 setup.py test python3 setup.py test } package() { mkdir -p "$pkgdir" } _py2() { replaces="$pkgname" depends="${depends//py-/py2-}" _py python2 } _py3() { depends="${depends//py-/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" } sha512sums="1c367def232ec79ad10a9d8f1e068598d2fdb49b067c2c3f44c9ad25c198afbbf2d52659c3795aad76f8c82d212e49086b81ab1c1dcc6aac2e3ce66c35ff5750 zope.deferredimport-4.3.1.tar.gz"