%define name python3-singledispatch %define srcname singledispatch %define version 3.4.0.3 %define release 1 # Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define is_python3_32 %(test -e /opt/freeware/bin/python3_32 && echo 1 || echo 0) %if %{is_python3_32} %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_python3 %(test -e /opt/freeware/bin/python3 && echo 1 || echo 0) %if %{is_python3} %define python_sitelib64 %(/opt/freeware/bin/python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Name: %{name} Version: %{version} Release: %{release} Summary: This library brings functools.singledispatch from Python 3.7 to Python 2.6-3.6 License: MIT Group: Development/Languages URL: https://pypi.python.org/pypi/singledispatch/ BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} Source0: https://pypi.python.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz Source10: %{name}-%{version}-%{release}.build.log %description PEP 443 proposed to expose a mechanism in the functools standard library module in Python 3.7 that provides a simple form of generic programming known as single-dispatch generic functions. Python 3 version. This library is a backport of this functionality to Python 2.6 - 3.6. Online documentation is at http://docs.python.org/3/library/functools.html#functools.single dispatch Provides: python3-%{srcname} = %{version}-%{release} BuildRequires: python3-devel >= 3.7.4 BuildRequires: python3-six >= 1.13.0 requires: python3-six >= 1.13.0 %prep %setup -q -n %{srcname}-%{version} echo "dotests=%{dotests}" # remove /usr/bin/env python from scripts sed -i '1d' singledispatch.py sed -i '1d' singledispatch_helpers.py %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 %{buildroot} %check if [ "%{dotests}" == 1 ] then (/opt/freeware/bin/python3 setup.py test || true) fi %files -n python3-%{srcname} %doc README.rst %{python_sitelib}/%{srcname}-%{version}-py?.?.egg-info %{python_sitelib}/%{srcname}.py* %{python_sitelib}/%{srcname}_helpers.py* %{python_sitelib}/__pycache__/* %changelog * Fri Dec 20 2019 Ashwini Chandrappa -3.4.0.3-1 - Build with Python3 * Wed Sep 20 2017 Ravi Hirekurabar -3.4.0.3-1 - Initial Port * Tue May 02 2017 Michael Wilson - 3.4.0.3-1 - Initial version for AIX