# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python2-scandir
pkgver=1.10.0
pkgrel=3
pkgdesc="A better directory iterator and faster os.walk()"
arch=(x86_64 powerpc64le)
url="https://github.com/benhoyt/scandir"
license=('BSD')
depends=('python2')
makedepends=('python2-setuptools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/benhoyt/scandir/archive/v$pkgver.tar.gz")
sha512sums=('1641ee5060331fe35a5f97c26a14423cf94fe462cdf875746e29ce095d00b9fc34291efd50ee67f1613d19312a8ed737f29a5092a38afdb1dc817fadc52a508f')

build() {
  cd scandir-$pkgver
  python2 setup.py build
}

check() {
  cd scandir-$pkgver
  LC_CTYPE=en_US.UTF-8 python2 test/run_tests.py
}

package() {
  cd scandir-$pkgver  
  python2 setup.py install --root="$pkgdir" --optimize=1
  install -D -m644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
}
