desktop/python-elasticsearch/PKGBUILD

53 lines
1.6 KiB
Bash

# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
pkgbase=python-elasticsearch
pkgname=('python-elasticsearch' 'python2-elasticsearch')
pkgver=6.1.1
pkgrel=1
arch=('any')
pkgdesc='Python client for Elasticsearch'
url='https://github.com/elastic/elasticsearch-py'
license=('Apache')
makedepends=('python-setuptools' 'python2-setuptools' 'python-urllib3' 'python2-urllib3')
checkdepends=('python-nose' 'python2-nose' 'python-requests' 'python2-requests' 'python-coverage'
'python2-coverage' 'python-mock' 'python2-mock' 'python-pyaml' 'python2-pyaml'
'python-nosexcover' 'python2-nosexcover')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/elastic/elasticsearch-py/archive/$pkgver.tar.gz")
sha512sums=('f593865de8879ac42cbbd35dd6bcc1da9513124556dcd3f1d8240e9d2818682136bfac09387c50797f4daada33699a7f5c1591172a7d89c3bd865595a5706c18')
prepare() {
sed -i 's/urllib3<.*,>/urllib3>/' elasticsearch-py-$pkgver/setup.py
cp -a elasticsearch-py-$pkgver{,-py2}
}
build() {
cd "$srcdir"/elasticsearch-py-$pkgver
python setup.py build
cd "$srcdir"/elasticsearch-py-$pkgver-py2
python2 setup.py build
}
check() {
cd "$srcdir"/elasticsearch-py-$pkgver
python setup.py nosetests
cd "$srcdir"/elasticsearch-py-$pkgver-py2
python2 setup.py nosetests
}
package_python-elasticsearch() {
depends=('python-urllib3')
cd elasticsearch-py-$pkgver
python setup.py install --root "$pkgdir" --optimize=1
}
package_python2-elasticsearch() {
depends=('python2-urllib3')
cd elasticsearch-py-$pkgver-py2
python2 setup.py install --root "$pkgdir" --optimize=1
}