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

pkgname=python-pyasn1-modules
pkgver=0.4.2
pkgrel=1
pkgdesc="A collection of ASN.1-based protocols modules"
arch=('any')
license=('BSD-2-Clause')
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=('7c4feab23a8c5ab72549387586894d1d53a3ad8b9d12cc5774b1d1f5192873f87da2e3525059fdda5b5884a52908ce79df274e3b75ee1f42af32e83ceb3f9167')

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 "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
