aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2017-11-26 01:43:24 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2017-11-26 01:43:29 +0000
commit0772fe3f2adcf1e2158f5c5efc16c255be00f814 (patch)
treefb0f1e889c264fa40fa8611689d0bfd9b5be9a02
parent27c1d2211361315222fc3f7f1bd7d7a39b9ed6f1 (diff)
downloadaports-0772fe3f2adcf1e2158f5c5efc16c255be00f814.tar.gz
aports-0772fe3f2adcf1e2158f5c5efc16c255be00f814.tar.bz2
aports-0772fe3f2adcf1e2158f5c5efc16c255be00f814.tar.xz
main/py-mccabe: added py2/py3 subpackages, improved APKBUILD
-rw-r--r--main/py-mccabe/APKBUILD53
1 files changed, 32 insertions, 21 deletions
diff --git a/main/py-mccabe/APKBUILD b/main/py-mccabe/APKBUILD
index 7dc133287a..ff0de1bc2f 100644
--- a/main/py-mccabe/APKBUILD
+++ b/main/py-mccabe/APKBUILD
@@ -3,39 +3,50 @@
pkgname=py-mccabe
_pkgname=mccabe
pkgver=0.6.1
-pkgrel=0
+pkgrel=1
pkgdesc="A McCabe complexity checker plugin for Flake8"
url="https://github.com/flintwork/mccabe"
arch="noarch"
license="MIT"
-depends="python2"
-depends_dev=""
-makedepends="python2-dev py-setuptools"
-install=""
-subpackages=""
+makedepends="python2-dev py-setuptools python3-dev"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
+builddir="$srcdir"/$_pkgname-$pkgver
-_builddir="$srcdir"/$_pkgname-$pkgver
-prepare() {
- local i
+build() {
cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
+ python2 setup.py build
+ python3 setup.py build
}
-build() {
- cd "$_builddir"
- python2 setup.py build || return 1
+check() {
+ cd "$builddir"
+ python2 setup.py test
+ python3 setup.py test
}
package() {
- cd "$_builddir"
- python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ mkdir -p "$pkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
}
-md5sums="723df2f7b1737b8887475bac4c763e1e mccabe-0.6.1.tar.gz"
-sha256sums="dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f mccabe-0.6.1.tar.gz"
+_py3() {
+ _py python3
+}
+
+_py() {
+ local python="$1"
+ pkgdesc="$pkgdesc (for $python)"
+ depends="$depends $python"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+ cd "$builddir"
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+
sha512sums="d8fc251a29790887c14c5932c5172b4cd578cd37ccf14cb96e80f0b97f27023427ea032d14e1e2a99d72627b055eb285f60db69e679ecd79d90a34b0255703d8 mccabe-0.6.1.tar.gz"