# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor:  Chris Severance aur.severach aATt spamgourmet dott com

pkgname=python-pathspec
_name=${pkgname#python-}
pkgver=1.0.4
pkgrel=1
pkgdesc='Utility library for gitignore style pattern matching of file paths'
arch=('any')
url=https://github.com/cpburnz/python-pathspec
license=('MPL-2.0')
depends=('python')
makedepends=(
  'git'
  'python-build'
  'python-flit-core'
  'python-installer'
  'python-wheel'
)
optdepends=(
  'python-google-re2: re2 backend'
)
source=("git+$url.git#tag=v$pkgver")
b2sums=('05860cfda3bdd182dbe6667f3c08138f56a92b8867c9b69ed7359da995afee7b6bdc4509cd45fedb469d02f17ed4a791adbd890286525f022a44bbc0956bff6d')

build() {
  cd $pkgname
  python -m build --wheel --skip-dependency-check --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
}
