aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-jwt/APKBUILD
blob: e4199cba380f245162f17750035ab54a724d0708 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Eivind Uggedal <eivind@uggedal.com>
pkgname=py-jwt
_pkgname=PyJWT
pkgver=1.4.2
pkgrel=0
pkgdesc="Python JSON Web Token implementation"
url="https://github.com/progrium/pyjwt"
arch="noarch"
license="MIT"
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"

build() {
	cd "$builddir"
	python2 setup.py build || return 1
	python3 setup.py build || return 1
}

package() {
	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"