# Contributor: Peter Bui # Maintainer: Fabian Affolter pkgname=py-httplib2 _pkgname=httplib2 pkgver=0.12.1 pkgrel=1 pkgdesc="Python HTTP client library" url="https://github.com/httplib2/httplib2" arch="noarch" license="MIT" makedepends="python2-dev python3-dev py-setuptools" subpackages="py2-${_pkgname}:_py2 py3-${_pkgname}:_py3" source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" builddir="$srcdir/$_pkgname-$pkgver" prepare() { default_prepare local python; for python in python2 python3; do cp -r "$builddir" "$builddir-$python" done } build() { local python; for python in python2 python3; do cd "$builddir"-$python $python setup.py build done } 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 $python setup.py install --prefix=/usr --root="$subpkgdir" } sha512sums="b083f0f5e22b384fd61eac428c1c60209702cf595762eadf6734afcf3cef6c3df8c7f2bedc5d782a4a6120a1dec51f910298f678c634c6b5e5d31348d9e10d25 httplib2-0.12.1.tar.gz"