# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=py-cookies
pkgver=2.2.1
pkgrel=0
pkgdesc="generate and validate cookies check digits"
url="https://pypi.python.org/pypi/cookies/"
arch="noarch"
license="BSD"
depends="py-amqp"
makedepends="python2-dev python3-dev py-setuptools"
install=""
subpackages="py2-cookies:py2 py3-cookies:py3"
source="https://files.pythonhosted.org/packages/source/c/cookies/cookies-$pkgver.tar.gz"
builddir="$srcdir/cookies-$pkgver"

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

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

_py() {
        local python="$1"
        pkgdesc="$pkgdesc ${python#python}"
        depends="$depends $python"
        install_if="$pkgname=$pkgver-r$pkgrel $python"

        cd "$builddir"
        $python setup.py install --prefix=/usr --root="$subpkgdir"
}

py2() {
	cd "$builddir"
	_py python2
}

py3() {
	cd "$builddir"
	_py python3
}

sha512sums="76f362a9a1d74b87c90c5b91ad806d872612d31f487e4067a627409316f6099602c9e5a429f85ce20adcb0a7b63dd131b9e1ecc5c0c6444d1569367432a719de  cookies-2.2.1.tar.gz"
