aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-configargparse
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-08-31 18:23:19 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-08-31 18:24:15 +0200
commitbf360523a8a41d657355dd67d8268222d97f3e7e (patch)
treef9265709e1820ea745d01b790dc4a755cdffc97e /community/py-configargparse
parent055cf4cef8450bdcc13ec209761e469ef2c6d93c (diff)
downloadaports-bf360523a8a41d657355dd67d8268222d97f3e7e.tar.bz2
aports-bf360523a8a41d657355dd67d8268222d97f3e7e.tar.xz
community/py-configargparse: add py2/py3 subpackages
Diffstat (limited to 'community/py-configargparse')
-rw-r--r--community/py-configargparse/APKBUILD57
1 files changed, 33 insertions, 24 deletions
diff --git a/community/py-configargparse/APKBUILD b/community/py-configargparse/APKBUILD
index 32692daeb8..f1059d21fd 100644
--- a/community/py-configargparse/APKBUILD
+++ b/community/py-configargparse/APKBUILD
@@ -1,40 +1,49 @@
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=py-configargparse
+_pkgname=ConfigArgParse
pkgver=0.10.0
-pkgrel=0
+pkgrel=1
pkgdesc="A drop-in replacement for argparse"
url="https://github.com/zorro3/ConfigArgParse"
arch="noarch"
license="MIT"
depends=""
-depends_dev=""
-makedepends="$depends_dev py-setuptools"
-install=""
-subpackages=""
-source="ConfigArgParse-$pkgver.tar.gz::https://github.com/bw2/ConfigArgParse/archive/$pkgver.tar.gz"
-
-_builddir="$srcdir"/ConfigArgParse-$pkgver
-prepare() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
-}
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
+source="$pkgname-$pkgver.tar.gz::https://github.com/bw2/$_pkgname/archive/$pkgver.tar.gz"
+builddir="$srcdir/$_pkgname-$pkgver"
build() {
- cd "$_builddir"
- python setup.py build || return 1
+ cd "$builddir"
+ python2 setup.py build || return 1
+ python3 setup.py build || return 1
}
package() {
- cd "$_builddir"
- python setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ mkdir -p "$pkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
+}
+
+_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"
}
-md5sums="be99c22bd70b34592af69a72f9c13bab ConfigArgParse-0.10.0.tar.gz"
-sha256sums="d6e1ad877cc6234e2f911bece742967c32415d8adb1dc4f764c70df283c205cc ConfigArgParse-0.10.0.tar.gz"
-sha512sums="d68e770e07637b4ce25a1193fc0cf1bd9eed122621a832343ab3d200246341b9cc1819d5013fa32a373e279af20b0b10424e4bfdfc8ef1f81dd5139087101ff4 ConfigArgParse-0.10.0.tar.gz"
+md5sums="be99c22bd70b34592af69a72f9c13bab py-configargparse-0.10.0.tar.gz"
+sha256sums="d6e1ad877cc6234e2f911bece742967c32415d8adb1dc4f764c70df283c205cc py-configargparse-0.10.0.tar.gz"
+sha512sums="d68e770e07637b4ce25a1193fc0cf1bd9eed122621a832343ab3d200246341b9cc1819d5013fa32a373e279af20b0b10424e4bfdfc8ef1f81dd5139087101ff4 py-configargparse-0.10.0.tar.gz"