# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: SpepS <dreamspepser@yahoo.it>
# Contributor: James Bulmer <nekinie@gmail.com>

pkgname=python-routes
pkgver=2.5.1
pkgrel=7
pkgdesc="Routing recognition and generation tools"
arch=(any)
url="https://pypi.python.org/pypi/Routes"
license=("custom:BSD")
depends=("python-repoze.lru" 'python-six')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-webob' 'python-webtest')
source=("https://pypi.io/packages/source/R/Routes/Routes-$pkgver.tar.gz"
	"replace-nose-with-pytest.patch")
sha512sums=('06ec9a8426ced86524096703de47e3da2fa08bd0ed8c962d451b4338966804245b5074077021fb58a5afcb63acd6dcffa05a89703b8b54841a69a4cdff12b755'
            '266818b7720b68d6ae1bbd2d6692f10eeb49fd1d94ae2ebc4e5270c52fcab6b68c2f60fd21ba32c4fd61cdd1555f0a4ac0d6952c434a94417d9168fab2bd83df')

prepare() {
  cd Routes-$pkgver
  patch -Np1 -i ${srcdir}/replace-nose-with-pytest.patch
}

build() {
  cd Routes-$pkgver
  python setup.py build
}

check() {
  cd Routes-$pkgver
  PYTHONPATH=. pytest
}

package() {
  cd Routes-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
}
