desktop/python-jsonschema/PKGBUILD
2016-04-23 14:45:43 +01:00

33 lines
1.1 KiB
Bash

pkgbase=python-jsonschema
_pkgname=jsonschema
pkgname=('python3-jsonschema' 'python2-jsonschema')
pkgver=2.5.1
pkgrel=4
pkgdesc="An implementation of JSON Schema validation for Python"
arch=('any')
url="http://pypi.python.org/pypi/jsonschema"
license=('MIT')
makedepends=('python3-setuptools' 'python2-setuptools')
source=("http://pypi.python.org/packages/source/j/jsonschema/${pkgname:8}-$pkgver.tar.gz")
sha256sums=('36673ac378feed3daa5956276a829699056523d7961027911f064b52255ead41')
prepare(){
cp -a $_pkgname-$pkgver $_pkgname-$pkgver-2
find $_pkgname-$pkgver-2 -name \*.py -exec sed -i '1s/python$/&2/' {} +
}
package_python3-jsonschema() {
depends=('python3')
cd "$srcdir/$_pkgname-$pkgver"
python3 setup.py install --root="$pkgdir/" --optimize=1
install -D -m644 json/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}
package_python2-jsonschema() {
depends=('python2-singledispatch')
cd "$srcdir/$_pkgname-$pkgver-2"
python2 setup.py install --root="$pkgdir/" --optimize=1
install -D -m644 json/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
mv $pkgdir/usr/bin/jsonschema{,2}
}