2016-02-26 13:40:30 +00:00
|
|
|
# $Id$
|
|
|
|
# Maintainer: Felix Yan <felixonmars@archlinux.org>
|
|
|
|
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
|
|
|
|
# Contributor: Limao Luo <luolimao+AUR@gmail.com>
|
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - drop python{,2}-pypandoc makedepends
|
|
|
|
|
|
|
|
pkgbase=python-jsonpatch
|
|
|
|
pkgname=(python-jsonpatch python2-jsonpatch)
|
2018-04-02 18:01:32 +00:00
|
|
|
pkgver=1.23
|
2018-08-06 13:12:17 +00:00
|
|
|
pkgrel=2
|
2016-02-26 13:40:30 +00:00
|
|
|
pkgdesc="An implementation of the JSON Patch format"
|
|
|
|
arch=("any")
|
|
|
|
url="https://github.com/stefankoegl/python-json-patch"
|
|
|
|
license=("BSD")
|
2017-06-19 18:54:05 +00:00
|
|
|
makedepends=("python-setuptools" "python2-setuptools" "python-jsonpointer" "python2-jsonpointer")
|
2016-02-26 13:40:30 +00:00
|
|
|
checkdepends=('python-coverage' 'python2-coverage')
|
2017-06-19 18:54:05 +00:00
|
|
|
source=("$pkgbase-$pkgver.tar.gz::https://github.com/stefankoegl/python-json-patch/archive/v$pkgver.tar.gz")
|
2018-04-02 18:01:32 +00:00
|
|
|
sha512sums=('87b12037174af6ebff81b2e544985460bd33d417845c146436bc49bd7b964b2f4cc5f9f810d817e048e69846c8f97a38fce7512168902602c94469b0bcd4fa3c')
|
2016-02-26 13:40:30 +00:00
|
|
|
|
|
|
|
prepare(){
|
2017-06-19 18:54:05 +00:00
|
|
|
cp -a python-json-patch-$pkgver{,-py2}
|
|
|
|
find python-json-patch-$pkgver-py2 -name \*.py -exec sed -i '1s/python$/&2/' {} +
|
2016-02-26 13:40:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2017-06-19 18:54:05 +00:00
|
|
|
cd "$srcdir"/python-json-patch-$pkgver
|
2016-02-26 13:40:30 +00:00
|
|
|
python setup.py build
|
|
|
|
|
2017-06-19 18:54:05 +00:00
|
|
|
cd "$srcdir"/python-json-patch-$pkgver-py2
|
2016-02-26 13:40:30 +00:00
|
|
|
python2 setup.py build
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2017-06-19 18:54:05 +00:00
|
|
|
cd "$srcdir"/python-json-patch-$pkgver
|
2016-02-26 13:40:30 +00:00
|
|
|
coverage run --source=jsonpatch tests.py
|
|
|
|
|
2017-06-19 18:54:05 +00:00
|
|
|
cd "$srcdir"/python-json-patch-$pkgver-py2
|
2016-02-26 13:40:30 +00:00
|
|
|
coverage2 run --source=jsonpatch tests.py
|
|
|
|
}
|
|
|
|
|
|
|
|
package_python-jsonpatch() {
|
|
|
|
depends=("python-jsonpointer")
|
|
|
|
|
2017-06-19 18:54:05 +00:00
|
|
|
cd "$srcdir"/python-json-patch-$pkgver
|
2016-02-26 13:40:30 +00:00
|
|
|
|
|
|
|
install -Dm644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
|
|
|
|
python setup.py install --prefix=/usr --root="$pkgdir"
|
|
|
|
}
|
|
|
|
package_python2-jsonpatch() {
|
|
|
|
depends=("python2-jsonpointer")
|
|
|
|
|
2017-06-19 18:54:05 +00:00
|
|
|
cd "$srcdir"/python-json-patch-$pkgver-py2
|
2016-02-26 13:40:30 +00:00
|
|
|
|
|
|
|
install -Dm644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
|
|
|
|
python2 setup.py install --prefix=/usr --root="$pkgdir"
|
|
|
|
for _bin in "$pkgdir"/usr/bin/*; do
|
|
|
|
mv "$_bin"{,2}
|
|
|
|
done
|
|
|
|
}
|