# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pyasn1-modules
pkgver=0.3.0
pkgrel=1
pkgdesc="A collection of ASN.1-based protocols modules"
arch=('any')
license=('BSD')
url="https://github.com/pyasn1/pyasn1-modules"
depends=('python-pyasn1')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=("https://github.com/pyasn1/pyasn1-modules/archive/v$pkgver/pyasn1-modules-$pkgver.tar.gz")
sha512sums=('74628ae1df081f92f9029fc5357fe6f6c3ef91c3ee3f7dcf3e6a2cb53724db5b95632bbe0339612cd0627680147f93ded2e24a43d549c5e528f9acf53339954e')

build() {
  cd pyasn1-modules-$pkgver
  python -m build -nw
}

check() {
  cd pyasn1-modules-$pkgver
  PYTHONPATH=. python tests/__main__.py
}

package() {
  cd pyasn1-modules-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl
  install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}
