aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-flake8
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2017-12-21 13:52:55 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-12-23 12:06:08 +0000
commit5d7e79610d9197186196afe75bbf7bb64af72d05 (patch)
treebed2e3c0b3cc02177b620222f6f4e7c6c0758d7d /main/py-flake8
parent7245e402548649c2089463d8421c1d9fa55be84e (diff)
downloadaports-5d7e79610d9197186196afe75bbf7bb64af72d05.tar.bz2
aports-5d7e79610d9197186196afe75bbf7bb64af72d05.tar.xz
main/py-flake8: renamed from flake8, add support for python3
Diffstat (limited to 'main/py-flake8')
-rw-r--r--main/py-flake8/APKBUILD58
1 files changed, 58 insertions, 0 deletions
diff --git a/main/py-flake8/APKBUILD b/main/py-flake8/APKBUILD
new file mode 100644
index 0000000000..57450d4fc7
--- /dev/null
+++ b/main/py-flake8/APKBUILD
@@ -0,0 +1,58 @@
+# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
+# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
+pkgname=py-flake8
+_pkgname=${pkgname#py-}
+pkgver=3.4.1
+pkgrel=0
+pkgdesc="A modular source code checker"
+url="https://gitlab.com/pycqa/flake8"
+arch="noarch"
+license="MIT"
+depends="py-mccabe py-pep8 py-pyflakes"
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
+options="!check" #no testsuite
+source="https://pypi.io/packages/source/f/$_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
+}
+
+_py2() {
+ replaces=flake8
+ provides="flake8-$pkgver-r$pkgrel"
+ depends="${depends//py-/py2-}"
+ _py python2
+}
+
+_py3() {
+ depends="${depends//py-/py3-}"
+ _py python3
+}
+
+_py() {
+ local python="$1"
+ local pyver="${1:6:1}"
+ pkgdesc="$pkgdesc (for $python)"
+ depends="$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 -f "$path" "${path%%}"
+ mv -f "${path%%}" "${path%%}-$pyver"
+ done
+}
+
+
+sha512sums="42df8fa0cf6f4bb4f3e52143028dee14d51a645aef19a0bab05000fef577e5bea3cc29f961acb0c98d92b76e635fdd2f0d689e23663a6c14d435d0410be94c87 flake8-3.4.1.tar.gz"