aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-jwt
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-02 01:18:20 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-02 01:36:54 +0200
commite6804f9d0c14439ff2f208f68d7ba819b8c1a260 (patch)
tree103878219317564ad807e31516ab3d5c4e2b3bdd /main/py-jwt
parenta361d62e8d4cce748a0f3e6bac98cbe8131d3774 (diff)
downloadaports-e6804f9d0c14439ff2f208f68d7ba819b8c1a260.tar.bz2
aports-e6804f9d0c14439ff2f208f68d7ba819b8c1a260.tar.xz
main/py-jwt: add py2/py3 and cli subpackages
Diffstat (limited to 'main/py-jwt')
-rw-r--r--main/py-jwt/APKBUILD59
1 files changed, 39 insertions, 20 deletions
diff --git a/main/py-jwt/APKBUILD b/main/py-jwt/APKBUILD
index f32963e570..e4199cba38 100644
--- a/main/py-jwt/APKBUILD
+++ b/main/py-jwt/APKBUILD
@@ -7,33 +7,52 @@ pkgdesc="Python JSON Web Token implementation"
url="https://github.com/progrium/pyjwt"
arch="noarch"
license="MIT"
-depends="python"
-depends_dev=""
-makedepends="python-dev py-setuptools"
-install=""
-subpackages=""
+depends=""
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="$pkgname-cli 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
+ python3 setup.py build || return 1
}
package() {
- cd "$_builddir"
- python setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ cd "$builddir"
+ python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ python3 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+}
+
+cli() {
+ pkgdesc="$pkgdesc (CLI utility)"
+ depends="py3-jwt"
+
+ mkdir -p "$subpkgdir"/usr/
+ mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
+}
+
+_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"
+ local libpath="$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))')"
+
+ mkdir -p "$subpkgdir"${libpath%/*}
+ mv "$pkgdir"$libpath "$subpkgdir"${libpath%/*}
+}
+
md5sums="e08aa1ecc99269248bb02f888c166af1 PyJWT-1.4.2.tar.gz"
sha256sums="87a831b7a3bfa8351511961469ed0462a769724d4da48a501cb8c96d1e17f570 PyJWT-1.4.2.tar.gz"
sha512sums="b0387d49fd1d06a8a846c2083160f6fd458c927ffac291fa9b4edbb1ce93d6bcc23e0d5528010aa919d67e1a78b0ce830b711802d6af1d20a1ce4e511bf6b007 PyJWT-1.4.2.tar.gz"