aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-simplejson
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-02 00:05:14 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-02 00:05:59 +0200
commit5314c420e5718537c636a685315194639c835d68 (patch)
tree3c1495c2a312316a28417aa2b3f4d68b246f2d67 /main/py-simplejson
parent5ce0ba3d31b7caf4baf92973cb199acc08ee9512 (diff)
downloadaports-5314c420e5718537c636a685315194639c835d68.tar.bz2
aports-5314c420e5718537c636a685315194639c835d68.tar.xz
main/py-simplejson: add py2/py3 subpackages
Diffstat (limited to 'main/py-simplejson')
-rw-r--r--main/py-simplejson/APKBUILD54
1 files changed, 33 insertions, 21 deletions
diff --git a/main/py-simplejson/APKBUILD b/main/py-simplejson/APKBUILD
index a3d878051f..3a8b94b380 100644
--- a/main/py-simplejson/APKBUILD
+++ b/main/py-simplejson/APKBUILD
@@ -3,37 +3,49 @@
pkgname=py-simplejson
_pkgname=simplejson
pkgver=3.8.2
-pkgrel=0
+pkgrel=1
pkgdesc="Simple, fast, extensible JSON encoder/decoder for Python"
url="http://pypi.python.org/pypi/simplejson/"
-arch="all"
+arch="noarch"
license="MIT"
depends=""
-depends_dev=""
-makedepends="python-dev py-setuptools"
-install=""
-subpackages=""
+makedepends="python2-dev python3-dev py-setuptools"
+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
-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
-}
+builddir="$srcdir/$_pkgname-$pkgver"
build() {
- cd "$_builddir"
- python setup.py build || return 1
+ cd "$builddir"
+
+ python2 setup.py build || return 1
+ python2 setup.py test || return 1
+
+ python3 setup.py build || return 1
+ python3 setup.py test || 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)"
+ arch="all"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+ cd "$builddir"
+ $python setup.py install --prefix=/usr --root="$subpkgdir" || return 1
+ rm -Rf "$subpkgdir"/usr/lib/python*/site-packages/simplejson/tests/
}
md5sums="53b1371bbf883b129a12d594a97e9a18 simplejson-3.8.2.tar.gz"