%{!?dotests: %define dotests 1} %define name python3-pbr %define srcname pbr %define version 5.4.4 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: PBR is a library that injects some useful behaviors into setuptools Name: %{name} Version: %{version} Release: %{release} Source0: http://pypi.python.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz URL: https://pypi.python.org/pypi/%{srcname} License: APLv2 Group: Development/Libraries Prefix: %{_prefix} Patch1: pbr-gpg.patch Requires: python3 >= 3.7.3 BuildRequires: git >= 2.20.1 #for running test cases BuildRequires: gnupg2 >= 2.0.30 BuildRequires: python3-coverage >= 4.5.4 BuildRequires: python3-mock >= 3.0.5 BuildRequires: python3-pytest >= 5.3.1 BuildRequires: python3-sphinx >= 2.3.0 BuildArch: noarch %description PBR is a library that injects some useful and sensible default behaviors into your setuptools run. It started off life as the chunks of code that were copied between all of the OpenStack projects. %prep %setup -q -n %{srcname}-%{version} %patch1 -p0 %build python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} if [ "%{dotests}" == 1 ] then (PYTHONPATH=%{buildroot}%{python_sitelib} python3 setup.py test || true) fi #renaming the files in bindir to avoid conflict with python-sphinx cd ${RPM_BUILD_ROOT}/%{_bindir} for file in ${RPM_BUILD_ROOT}/%{_bindir}/*; do mv $file $file-3 done cd ${RPM_BUILD_ROOT} mkdir -p usr/bin cd usr/bin ln -sf ../..%{_bindir}/* . %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc AUTHORS PKG-INFO LICENSE README.rst CONTRIBUTING.rst ChangeLog %doc doc %{python_sitelib}/* /usr/bin/* %{_bindir}/* %changelog * Sat Nov 23 2019 Baanu Tumma - 5.4.4-1 - Updated to latest version, built using python3 * Wed Aug 24 2016 Dylan McDougall - 1.10.0-1 - first version for AIX V6.1 and higher