summaryrefslogtreecommitdiffstats
path: root/abs/core
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core')
-rw-r--r--abs/core/python_modules/python-josepy/PKGBUILD58
1 files changed, 58 insertions, 0 deletions
diff --git a/abs/core/python_modules/python-josepy/PKGBUILD b/abs/core/python_modules/python-josepy/PKGBUILD
new file mode 100644
index 0000000..7e56bda
--- /dev/null
+++ b/abs/core/python_modules/python-josepy/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Felix Yan <felixonmars@archlinux.org>
+
+pkgbase=python-josepy
+pkgname=(python-josepy python2-josepy)
+pkgver=1.1.0
+pkgrel=2
+pkgdesc="JOSE protocol implementation in Python"
+url="https://github.com/certbot/josepy"
+license=('PerlArtistic')
+arch=('any')
+makedepends=('python-cryptography' 'python2-cryptography' 'python-pyopenssl' 'python2-pyopenssl'
+ 'python-setuptools' 'python2-setuptools')
+checkdepends=('python-pytest-runner' 'python2-pytest-runner' 'python-coverage' 'python2-coverage'
+ 'python-pytest-isort' 'python2-pytest-isort' 'python-pytest-cache'
+ 'python2-pytest-cache' 'python-pytest-cov' 'python2-pytest-cov' 'flake8'
+ 'python2-flake8' 'python-pytest-flake8' 'python2-pytest-flake8' 'python-mock'
+ 'python2-mock')
+source=("https://pypi.io/packages/source/j/josepy/josepy-$pkgver.tar.gz")
+sha512sums=('eee886565b1cb92e6d7a42f1e3666a158c162fb891f90de844118ac32b24f6deccf2eee5990ba100827109203f7da99c2b55735fb7bda05fd7a447dca39d6362')
+
+prepare() {
+ # https://github.com/certbot/josepy/issues/24
+ sed -i 's/flake8-ignore = E501/flake8-ignore = E501 W504/' josepy-$pkgver/pytest.ini\
+
+ cp -a josepy-$pkgver{,-py2}
+}
+
+build() {
+ cd "$srcdir"/josepy-$pkgver
+ python setup.py build
+
+ cd "$srcdir"/josepy-$pkgver-py2
+ python2 setup.py build
+}
+
+check() {
+ cd "$srcdir"/josepy-$pkgver
+ python setup.py pytest
+
+ cd "$srcdir"/josepy-$pkgver-py2
+ python2 setup.py pytest
+}
+
+package_python-josepy() {
+ depends=('python-cryptography' 'python-pyopenssl' 'python-setuptools')
+
+ cd josepy-$pkgver
+ python setup.py install --root="$pkgdir" --optimize=1
+}
+
+package_python2-josepy() {
+ depends=('python2-cryptography' 'python2-pyopenssl' 'python2-setuptools')
+
+ cd josepy-$pkgver-py2
+ python2 setup.py install --root="$pkgdir" --optimize=1
+
+ mv "$pkgdir"/usr/bin/jws{,2}
+}