%define name python3-backports_abc %define srcname backports_abc %define version 0.5 %define release 1 # Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} # Needs care because default command python may be linked to 32 or 64 bit python # and compiler/loader options are not the same, e.g. -maix32/-maix64 # Also, although # /usr/bin/python_64 eventually links to /opt/freeware/bin/python2.7_64 # /usr/bin/python_32 links to inexistant /opt/freeware/bin/python2_32 # So, use /opt/freeware/bin/python2.7 and /opt/freeware/bin/python2.7_64 %define is_python %(test -e /opt/freeware/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(/opt/freeware/bin/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 /opt/freeware/bin/python3_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(/opt/freeware/bin/python3 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %endif %global with_python3 0 Name: %{name} Version: %{version} Release: %{release} Summary: A backport of recent additions to the collections.abc module Group: Development/Languages License: Python URL: https://pypi.python.org/pypi/backports_abc Source0: https://files.pythonhosted.org/packages/source/b/%{srcname}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} %description A backport of recent additions to the collections.abc module. %prep %setup -n %{srcname}-%{version} echo "dotests=%{dotests}" %build /opt/freeware/bin/python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT /opt/freeware/bin/python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} if [ "%{dotests}" == 1 ] then (/opt/freeware/bin/python3 tests.py || true) fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files -n python3-backports_abc %license LICENSE %doc CHANGES.rst README.rst %{python_sitelib}/%{srcname}.py %{python_sitelib}/%{srcname}*.egg-info/ %{python_sitelib}/__pycache__/* %changelog * Sat Nov 23 2019 Baanu Tumma - 0.5-1 - Built using python3 * Wed Sep 20 2017 Ravi Hirekurabar - 0.5-1 - Initial Port * Thu Apr 20 2017 Michael Wilson - 0.5-1 - Initial version