aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-pyflakes/APKBUILD
blob: 0972cc55005b89f5732c26d5df4e656bb0c0839b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-pyflakes
_pkgname=${pkgname#py-}
pkgver=1.6.0
pkgrel=3
pkgdesc="A passive checker of Python programs"
url="https://github.com/pyflakes/pyflakes"
arch="noarch"
license="MIT"
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"
	python2 setup.py test
	python3 setup.py test
}

package() {
	cd "$builddir"

	mkdir -p "$pkgdir"/usr/bin
	ln -s pyflakes-3 "$pkgdir"/usr/bin/pyflakes
}

_py2() {
	replaces=pyflakes
	provides="pyflakes=$pkgver-r$pkgrel"
	_py python2
}

_py3() {
	_py python3
}

_py() {
	local python="$1"
	local pyver="${1:6:1}"
	pkgdesc="$pkgdesc (for $python)"
	depends="$python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py --quiet install --prefix=/usr --root="$subpkgdir"

	# Add version suffix to executable files.
	local path; for path in "$subpkgdir"/usr/bin/*; do
		mv "$path" "$path-$pyver"
	done
}

sha512sums="7e9c2aad6ebed638a1354cef51c7e1f68b25e59f8caf4694997a9afecd7cd8baa629a9363297ac0d961430f007fd22dcae7dae1bcbd7838a3b5d4285063bc7c5  pyflakes-1.6.0.tar.gz"