Date: Wednesday, July 18, 2018 @ 03:35:41 Author: foutrelis Revision: 361597
archrelease: copy trunk to community-staging-any Added: python-hacking/repos/community-staging-any/ python-hacking/repos/community-staging-any/PKGBUILD (from rev 361596, python-hacking/trunk/PKGBUILD) ----------+ PKGBUILD | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) Copied: python-hacking/repos/community-staging-any/PKGBUILD (from rev 361596, python-hacking/trunk/PKGBUILD) =================================================================== --- community-staging-any/PKGBUILD (rev 0) +++ community-staging-any/PKGBUILD 2018-07-18 03:35:41 UTC (rev 361597) @@ -0,0 +1,54 @@ +# $Id$ +# Maintainer: Felix Yan <felixonm...@archlinux.org> + +pkgbase=python-hacking +pkgname=('python-hacking' 'python2-hacking') +pkgver=1.1.0 +pkgrel=2 +arch=('any') +pkgdesc='OpenStack Hacking Guideline Enforcement' +url='http://docs.openstack.org/developer/hacking' +license=('Apache') +makedepends=('python-setuptools' 'python2-setuptools' 'python-pbr' 'python2-pbr' + 'flake8' 'python2-flake8' 'python-mccabe' 'python2-mccabe') +checkdepends=('python-oslotest' 'python2-oslotest' 'python-testrepository' + 'python2-testrepository') +source=("$pkgbase-$pkgver.tar.gz::https://github.com/openstack-dev/hacking/archive/$pkgver.tar.gz") +sha512sums=('25e8fc8585b0de2c9f746a31539d2ee0b6b18685f17cac149bf8cf372d9c31d1f10ac93087d6bcc69b4d1a15b4b3c99cecbe15fe95e903c3de72aba21af32827') + +prepare() { + sed -e 's/flake8<2.7.0,/flake8/' -e 's/==/>=/' -i hacking-$pkgver/requirements.txt + cp -a hacking-$pkgver{,-py2} + + export PBR_VERSION=$pkgver +} + +build() { + cd "$srcdir"/hacking-$pkgver + python setup.py build + + cd "$srcdir"/hacking-$pkgver-py2 + python2 setup.py build +} + +check() { + cd "$srcdir"/hacking-$pkgver + python setup.py testr || warning "Tests failed" + + cd "$srcdir"/hacking-$pkgver-py2 + PYTHON=python2 python2 setup.py testr || warning "Tests failed" +} + +package_python-hacking() { + depends=('python-six' 'python-pbr' 'flake8' 'python-mccabe') + + cd hacking-$pkgver + python setup.py install --root "$pkgdir" --optimize=1 +} + +package_python2-hacking() { + depends=('python2-six' 'python2-pbr' 'python2-flake8' 'python2-mccabe') + + cd hacking-$pkgver-py2 + python2 setup.py install --root "$pkgdir" --optimize=1 +}