# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Karol 'Kenji Takahashi' Woźniak <kenji.sx>
# Contributor: Tianjiao Yin <ytj000+AUR@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: TDY <tdy@gmx.com>
# Contributor: Tiago Pierezan Camargo <tcamargo@gmail.com>

pkgname=python-pyflakes
pkgver=3.2.0
pkgrel=1
pkgdesc='A lint-like tool for Python to identify common errors quickly without executing code'
arch=('any')
url='https://pypi.python.org/pypi/pyflakes'
license=('MIT')
depends=('python')
makedepends=('python-setuptools')
source=("https://pypi.io/packages/source/p/pyflakes/pyflakes-$pkgver.tar.gz")
sha512sums=('bd413b2ad80ae942bc13cef5ecb3a47b09abb0641fe468d427717b32895eb1702c9e8831867fbaa1de6fff71ab16bc3dae96f745bbc3e7d99de104a008f397ba')

build() {
  cd pyflakes-$pkgver
  python setup.py build
}

check() {
  cd pyflakes-$pkgver
  python -m unittest discover pyflakes
}

package() {
  cd pyflakes-$pkgver
  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1

  # We have python 3 as default python, and want to keep compatibility with the old pyflakes3k naming
  ln -s pyflakes "$pkgdir/usr/bin/pyflakes3k"

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
