# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=py-six
_pkgname=six
pkgver=1.11.0
pkgrel=0
pkgdesc="Python 2 and 3 compatibility library"
url="https://pypi.python.org/pypi/six"
arch="noarch"
license="MIT"
depends=""
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
source="$pkgname-$pkgver.tar.gz::https://github.com/benjaminp/$_pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

package() {
	mkdir -p "$pkgdir"
}

_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"
}

_py2() {
	replaces="$pkgname"
	_py python2
}

_py3() {
	_py python3
}

sha512sums="f301c6e3c159fc87c121a6b860e4a24fa77ca2d23c3beb29201f7ba0ef71188d683d103fd3f44f50bc774a0682183256ac119e20463d389ebe0f481e2c4711f9  py-six-1.11.0.tar.gz"
