# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=py-blinker
_pkgname=blinker
pkgver=1.4
pkgrel=2
pkgdesc="Fast, simple object-to-object and broadcast signalling"
url="http://pypi.python.org/pypi/blinker"
arch="noarch"
license="MIT"
makedepends="python2-dev py-setuptools python3-dev"
subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

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

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

_py() {
	local python=$1
	pkgdesc="$pkgdesc - $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

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

_py3() {
	_py python3
}

md5sums="8b3722381f83c2813c52de3016b68d33  blinker-1.4.tar.gz"
sha256sums="471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6  blinker-1.4.tar.gz"
sha512sums="2f5f71b05c7cc27f5761ba698b05c78c8a491f5285c120e532d24be0c8256daa14e075f3f30e15fb18e7c3f16579af9378a155d058f170e3af9ffdb89e49f56e  blinker-1.4.tar.gz"
