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

pkgname=python-xattr
pkgver=0.10.1
pkgrel=5
pkgdesc='Python wrapper for extended filesystem attributes'
arch=('x86_64' 'aarch64')
license=('MIT')
url='https://github.com/xattr/xattr'
depends=('python-cffi')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
source=("$pkgname-$pkgver.tar.gz::https://github.com/xattr/xattr/archive/v$pkgver.tar.gz")
sha512sums=('85151e5dda925193d17dcc892d46e22c6a288776df24e3e14a5a6d26a05e4a818685dfc656576a1c96c0954aec7e1e1c1f5d6b94f7102d995cf8bfccdea98bc2')

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

check() {
  # Build env doesn't have permission for those xattrs
  cd xattr-$pkgver
  python -m unittest xattr.tests.all_tests_suite -v
}

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

# vim:set ts=2 sw=2 et:
