# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: Limao Luo <luolimao+AUR@gmail.com>

pkgname=python-jsonpointer
pkgver=3.0.0
pkgrel=2
pkgdesc='Identify specific nodes in a JSON document (RFC 6901)'
arch=('any')
url='https://python-json-pointer.readthedocs.org/'
license=('BSD-3-Clause')
depends=('python')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
source=("$pkgname::git+https://github.com/stefankoegl/python-json-pointer#tag=v$pkgver")
sha512sums=('2331d3113c1d9283a4a0e2b4361db97c17ea25ac7f25d4d765b2a717d604b98696725414375883ff98efbafeb8ba3b11dff23fad26fe114d153b5afb2ec3d933')
b2sums=('7b2c19bbc6d1872378b8a9a49b7b8e03ce3fc3c76e4ee3bc4fb6813f2b50c860c6973eea899aac6629321709f0bb097d52de324b37a4ea6c5b641bb578f032db')

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname"

  python -m unittest
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE.txt
}
