%global pypi_name funcsigs %if 0%{?fedora} || 0%{?rhel} > 7 %global with_python3 1 %endif Name: python-%{pypi_name} Version: 1.0.2 Release: 3%{?dist} Summary: Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+ License: ASL 2.0 URL: https://github.com/testing-cabal/funcsigs? Source0: https://pypi.io/packages/source/f/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %description funcsigs is a backport of the PEP 362 function signature features from Python 3.3's inspect module. The backport is compatible with Python 2.6, 2.7 as well as 3.2 and up. %package -n python2-%{pypi_name} Summary: Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+ Provides: python-%{pypi_name} = %{version}-%{release} Obsoletes: python-%{pypi_name} < %{version}-%{release} BuildRequires: python2-devel BuildRequires: python2-setuptools #BuildRequires: python2-sphinx BuildRequires: python2-unittest2 Summary: Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+ %description -n python2-%{pypi_name} funcsigs is a backport of the PEP 362 function signature features from Python 3.3's inspect module. The backport is compatible with Python 2.6, 2.7 as well as 3.2 and up. %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+ %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-setuptools #BuildRequires: python3-sphinx BuildRequires: python3-unittest2 %description -n python3-%{pypi_name} funcsigs is a backport of the PEP 362 function signature features from Python 3.3's inspect module. The backport is compatible with Python 2.6, 2.7 as well as 3.2 and up. %endif #%package -n python-%{pypi_name}-doc #Summary: funcsigs documentation #%description -n python-%{pypi_name}-doc #Documentation for funcsigs %prep export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %if 0%{?rhel} && 0%{?rhel} == 7 sed -i '/extras_require/,+3d' setup.py %endif %build export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s" %if 0%{?with_python3} %py3_build %endif # generate html docs #sphinx-build docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install. %if 0%{?with_python3} %py3_install %endif CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %check export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 %{__python2} setup.py test %if 0%{?with_python3} %{__python3} setup.py test %endif %files -n python2-%{pypi_name} %doc README.rst %license LICENSE %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.rst %license LICENSE %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif #%files -n python-%{pypi_name}-doc #%doc html #%license LICENSE %changelog * Fri Dec 14 2018 Lon Hohberger - 1.0.2-3 - Add RHEL8-isms - Be consistent with python2 naming - Drop tests * Sat Jun 11 2016 Haïkel Guémar - 1.0.2-1 - Upstream 1.0.2 (RHBZ#1341262) * Thu Feb 04 2016 Fedora Release Engineering - 0.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Fri Dec 4 2015 Haïkel Guémar - 0.4-2 - Add license file in doc subpackage * Wed Dec 02 2015 Haïkel Guémar - 0.4-1 - Initial package.