Files
MSYS2-packages/python-pbr/PKGBUILD
2019-08-12 09:25:54 +03:00

74 lines
2.3 KiB
Bash

# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=pbr
pkgbase=python-${_realname}
pkgname=(python3-${_realname} python2-${_realname})
pkgver=5.4.2
pkgrel=1
pkgdesc="Python Build Reasonableness"
arch=('any')
url='https://pypi.python.org/pypi/pbr'
license=('Apache')
makedepends=('python2-setuptools' 'python3-setuptools' 'git')
#checkdepends=('python-stestr' 'python2-stestr' 'python-testscenarios' 'python2-testscenarios'
# 'python-testresources' 'python2-testresources' 'python-testrepository'
# 'python2-testrepository' 'python-mock' 'python2-mock'
# 'python-virtualenv' 'python2-virtualenv' 'python-wheel' 'python2-wheel'
# 'python-sphinx' 'python2-sphinx')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/openstack-dev/pbr/archive/$pkgver.tar.gz")
sha512sums=('d4c769d5ddcdcaf685cc870887347dfabae8ce5878eabb6a33efca9f307629709c4bf41991135a80d877d99647c428a314c522707f630ce92c99f285a8c8bd02')
prepare() {
# Fix for new wheel
sed -e 's/wheel.install/wheel.wheelfile/' \
-e 's/wheel_file.zipfile/wheel_file/' \
-i pbr-$pkgver/pbr/tests/test_packaging.py
cd "${srcdir}"
for builddir in python{2,3}-build-${CARCH}; do
rm -rf ${builddir} | true
cp -r "${_realname}-${pkgver}" "${builddir}"
done
find python2-build-${CARCH} -name \*.py -exec sed -i '1s/python$/&2/' {} +
export PBR_VERSION=$pkgver
}
build() {
for pver in {2,3}; do
msg "Python ${pver} build for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
python${pver} setup.py build
done
}
#We have to wait to reenable this until a number of other packages are available
#check() {
# msg "Python 2 test for ${CARCH}"
# cd "${srcdir}/python2-build-${CARCH}"
# PYTHON=python2 stestr2 run
# msg "Python 3 test for ${CARCH}"
# cd "${srcdir}/python3-build-${CARCH}"
# stestr run
#}
package_python3-pbr() {
depends=('python3-setuptools')
cd "${srcdir}/python3-build-${CARCH}"
python setup.py install -O1 --root="$pkgdir" --skip-build
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_python2-pbr() {
depends=('python2-setuptools')
cd "${srcdir}/python2-build-${CARCH}"
python2 setup.py install -O1 --root="$pkgdir" --skip-build
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
mv "$pkgdir"/usr/bin/pbr{,2}
}