aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-pep8/APKBUILD
blob: e877f422d2786a48487d71dc79c666f5ba34bb2f (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
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-pep8
_pkgname=pep8
pkgver=1.7.1
pkgrel=0
pkgdesc="A Python style guide checker"
url="https://pypi.python.org/pypi/pep8/"
arch="noarch"
license="MIT"
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
options="!check"  # no testsuite
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
}

package() {
	cd "$builddir"

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

_py2() {
	replaces=$pkgname
	provides="$pkgname=$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"
	local path; for path in "$subpkgdir"/usr/bin/*; do
		mv "$path" "$path-$pyver"
	done
}

sha512sums="d20d6a6f91bc865580e3d39c50e26f9c6be81fd8e80a1b9a029d7ea9c906748e46080b841dc5507004089e5ee0d0cb3f70a74bb35131c58113ff5571153af4da  pep8-1.7.1.tar.gz"