desktop/python-mccabe/PKGBUILD

55 lines
1.3 KiB
Bash

# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Karol "Kenji Takahashi" Woźniak <kenji.sx>
pkgbase=python-mccabe
pkgname=(python3-mccabe python2-mccabe)
pkgver=0.6.1
pkgrel=1
pkgdesc="McCabe complexity checker for Python"
arch=('any')
url="https://github.com/flintwork/mccabe"
license=('custom:Expat')
makedepends=('python3-pytest-runner' 'python2-pytest-runner')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/flintwork/mccabe/archive/$pkgver.tar.gz")
md5sums=('0360af86f0bce7a839bd3cba517edf9c')
prepare() {
cp -a mccabe-$pkgver{,-py2}
}
build() {
cd "$srcdir"/mccabe-$pkgver
python3 setup.py build
cd "$srcdir"/mccabe-$pkgver-py2
python2 setup.py build
}
check() {
cd "$srcdir"/mccabe-$pkgver
python3 setup.py test
cd "$srcdir"/mccabe-$pkgver-py2
python2 setup.py test
}
package_python3-mccabe() {
depends=('python3')
cd mccabe-$pkgver
python3 setup.py install --root="$pkgdir" --prefix=/usr --skip-build --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_python2-mccabe() {
depends=('python2')
cd mccabe-$pkgver-py2
python2 setup.py install --root="$pkgdir" --prefix=/usr --skip-build --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
# vim:set ts=2 sw=2 et: