# Maintainer: Spaxe <182298766+spaxe-dev@users.noreply.github.com>
pkgname=zipcheck
pkgver=0.2.0
pkgrel=1
pkgdesc="Static archive-bomb scanner that never extracts anything"
arch=('any')
url="https://github.com/spaxe-dev/zipcheck"
license=('MIT')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-hypothesis' 'python-pytest')
source=("$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/z/zipcheck/zipcheck-$pkgver.tar.gz")
sha256sums=('7aa5e0a41c046d0a6ab259e53f5fc2f0b7b8afb0b710ecc8bc5ffd2db7b84e89')

build() {
  cd "$pkgname-$pkgver"
  python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname-$pkgver"
  python -m pytest -q
}

package() {
  cd "$pkgname-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
