# Maintainer: Andrzej Giniewicz <gginiu@gmail.com>

pkgname=python-uritemplate
pkgver=4.1.1
pkgrel=3
pkgdesc="a Python implementation of RFC6570"
arch=('any')
url="https://uritemplate.readthedocs.io/"
license=('Apache' 'BSD')
depends=('python')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/sigmavirus24/uritemplate/archive/${pkgver}.tar.gz")
sha256sums=('64cae94edd83bbb0c2c49b15f2cb8192c3f8492af6bc468211d1e8b8496f5791')

build() {
  cd "$srcdir"/uritemplate-${pkgver}
  python -m build --wheel --no-isolation
}

package() {
  cd "$srcdir"/uritemplate-${pkgver}

  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
  install -Dm644 LICENSE.APACHE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.APACHE
  install -Dm644 LICENSE.BSD "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.BSD
}
