# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=py-roman
_pkgname=roman
pkgver=2.0.0
pkgrel=2
pkgdesc="Integer to Roman numerals converter"
url="https://pypi.python.org/pypi/roman"
arch="noarch"
license="Python"
depends=""
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.zip"
builddir="$srcdir/$_pkgname-$pkgver"

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

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

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

_py3() {
	_py python3
}

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

md5sums="aa71d131eec16d45c030fd06a27c9d17  roman-2.0.0.zip"
sha256sums="90e83b512b44dd7fc83d67eb45aa5eb707df623e6fc6e66e7f273abd4b2613ae  roman-2.0.0.zip"
sha512sums="d62a95e835232821dbf7a81d0c6b7df63f18c4116cfc7eee0c691a0b31d3d7b69d2dc2e4ea26e0a169a8e24bf080e8bb1e195b853be4adf1491335a5b4d5702c  roman-2.0.0.zip"
