# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=py-diskcache
pkgver=2.8.3
pkgrel=0
pkgdesc="disk caching implementation"
url="http://pypi.python.org/pypi/diskcache/"
arch="noarch"
license="MIT"
depends=""
depends_dev=""
makedepends="python2-dev python3-dev py-setuptools"
install=""
subpackages="py2-diskcache:py2 py3-diskcache:py3"
source="https://files.pythonhosted.org/packages/source/d/diskcache/diskcache-$pkgver.tar.gz"

builddir="$srcdir"/diskcache-$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="d96ac76dfb68cb817febd3f4ed8927a8409c02b13b4112a739528cade40f9a588c732dfc3148392dd12676380c3a2b006ee63b86f30ad70f5d205273003bf23d  diskcache-2.8.3.tar.gz"