aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2017-12-21 13:45:45 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-12-23 12:05:08 +0000
commit7245e402548649c2089463d8421c1d9fa55be84e (patch)
tree79079589fbd268e96545c29a37ecfc7ad723b560
parenta1af7eb340661980221e7f578fe3d0510d8c4569 (diff)
downloadaports-7245e402548649c2089463d8421c1d9fa55be84e.tar.bz2
aports-7245e402548649c2089463d8421c1d9fa55be84e.tar.xz
main/py-pyflakes: renamed from pyflakes, python3 support added
-rw-r--r--main/py-pyflakes/APKBUILD55
-rw-r--r--main/pyflakes/APKBUILD25
2 files changed, 55 insertions, 25 deletions
diff --git a/main/py-pyflakes/APKBUILD b/main/py-pyflakes/APKBUILD
new file mode 100644
index 0000000000..2bc9ecb177
--- /dev/null
+++ b/main/py-pyflakes/APKBUILD
@@ -0,0 +1,55 @@
+# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
+# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
+pkgname=py-pyflakes
+_pkgname=${pkgname#py-}
+pkgver=1.6.0
+pkgrel=1
+pkgdesc="A passive checker of Python programs"
+url="https://github.com/pyflakes/pyflakes"
+arch="noarch"
+license="MIT"
+depends=""
+makedepends="python2-dev python3-dev py-setuptools"
+options="!check" #no testsuite
+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
+}
+
+package() {
+ cd "$builddir"
+ mkdir -p "$pkgdir"/usr/bin
+}
+
+_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="$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="7e9c2aad6ebed638a1354cef51c7e1f68b25e59f8caf4694997a9afecd7cd8baa629a9363297ac0d961430f007fd22dcae7dae1bcbd7838a3b5d4285063bc7c5 pyflakes-1.6.0.tar.gz"
diff --git a/main/pyflakes/APKBUILD b/main/pyflakes/APKBUILD
deleted file mode 100644
index 9ed672ec3e..0000000000
--- a/main/pyflakes/APKBUILD
+++ /dev/null
@@ -1,25 +0,0 @@
-# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
-# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
-pkgname=pyflakes
-pkgver=1.6.0
-pkgrel=0
-pkgdesc="A passive checker of Python programs"
-url="https://github.com/pyflakes/pyflakes"
-arch="noarch"
-license="MIT"
-depends="python2"
-makedepends="python2-dev"
-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 || return 1
-}
-
-package() {
- cd "$builddir"
- python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
-}
-
-sha512sums="7e9c2aad6ebed638a1354cef51c7e1f68b25e59f8caf4694997a9afecd7cd8baa629a9363297ac0d961430f007fd22dcae7dae1bcbd7838a3b5d4285063bc7c5 pyflakes-1.6.0.tar.gz"