%{!?dotests: %define dotests 1} %define name python3-jaraco.collections %define srcname jaraco.collections %define version 3.0.0 %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 && 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: Models and classes to supplement the stdlib ‘collections’ module. Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz Url: https://github.com/jaraco/jaraco.collections License: MIT Group: Development/Libraries Prefix: %{_prefix} BuildArch: noarch BuildRequires: python3 >= 3.7.3 BuildRequires: python3-devel >= 3.7.3 BuildRequires: python3-pytest-timeout >= 1.3.3 BuildRequires: python3-pytest >= 5.3.1, python3-py >= 1.8.0, python3-pluggy >= 0.13.0 BuildRequires: python3-jaraco.classes >= 3.1.0 BuildRequires: python3-jaraco.text >= 3.2.0 BuildRequires: python3-jaraco.functools >= 3.0.0 Requires: python3 >= 3.7.3 Requires: python3-six >= 1.13.0 Requires: python3-jaraco.classes >= 3.1.0 Requires: python3-jaraco.text >= 3.2.0 #To run test cases pip install pytest-flake8, pytest-black, pytest-cov %description A dictionary-like object that maps a range of values to a given value. %prep %setup -q -n %{srcname}-%{version} %build python3 setup.py build if [ "%{dotests}" == 1 ] then python3 -m pytest fi %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc README.rst LICENSE %{python_sitelib}/* %changelog * Thu Dec 12 2019 Baanu Tumma - 3.0.0-1 - Initial build for AIX Toolbox, built using python3