# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=pbr
pkgbase=python-${_realname}
pkgname=(python-${_realname})
pkgver=5.5.1
pkgrel=2
pkgdesc="Python Build Reasonableness"
arch=('any')
url='https://pypi.python.org/pypi/pbr'
license=('Apache')
depends=('python-setuptools')
provides=("python3-${_realname}")
conflicts=("python3-${_realname}")
replaces=("python3-${_realname}")
source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/openstack-dev/pbr/archive/${pkgver}.tar.gz")
sha512sums=('412a2d459869714b870ef11c3f98eff9647a0d0b91b1e7632a7cbbffe071a39e47a0d5e7698857202ae6ae0aa4d7b952491318f0891bb9c5fd8bb2806c81a689')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
  export PBR_VERSION=${pkgver}
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}"

  /usr/bin/python setup.py build
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"

  /usr/bin/python setup.py install -O1 --root="${pkgdir}" --skip-build
  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
