# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>

pkgname=python-oslo-concurrency
pkgver=6.0.0
_commit=53709baa928baad9845bf9f7a20f36284bebe091
pkgrel=2
pkgdesc="OpenStack library for all concurrency-related code"
arch=(any)
url="https://pypi.python.org/pypi/oslo.concurrency/$pkgver"
license=('Apache')
depends=('python-pbr' 'python-oslo-config' 'python-oslo-i18n' 'python-oslo-utils'
         'python-fasteners')
makedepends=('git' 'python-setuptools')
checkdepends=('python-oslotest' 'python-stestr' 'python-eventlet')
source=("git+https://github.com/openstack/oslo.concurrency.git#commit=$_commit")
sha512sums=('dcd4cf42293255b08c2d3011155756fe3f9d55d3734b7e4ea63e737a83acf202ea5fbded0342b7cfc179445f0c08c9c4428f98ad30b43434aca8bea5c4913338')

build() {
  cd oslo.concurrency
  python setup.py build
}

check() {
  cd oslo.concurrency
  python setup.py install --root="tmp_install" --optimize=1
  local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
  PYTHONPATH="$PWD/tmp_install/usr/lib/python${python_version}/site-packages" PATH="$PWD/tmp_install/usr/bin:$PATH" \
    TEST_EVENTLET=0 lockutils-wrapper stestr run --exclude-regex oslo_concurrency.tests.unit.test_processutils.PrlimitTestCase.test_core_size
  PYTHONPATH="$PWD/tmp_install/usr/lib/python${python_version}/site-packages" PATH="$PWD/tmp_install/usr/bin:$PATH" \
    TEST_EVENTLET=1 lockutils-wrapper stestr run --exclude-regex oslo_concurrency.tests.unit.test_processutils.PrlimitTestCase.test_core_size
}

package() {
  cd oslo.concurrency
  python setup.py install --root="$pkgdir" --optimize=1
}

# vim:set ts=2 sw=2 et:
