# Conditional build: %bcond_without tests # do not perform "make test" %bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module %define module fasteners %define egg_name fasteners %define pypi_name fasteners Summary: Provides useful locks Name: python-%{pypi_name} Version: 0.14.1 Release: 5 License: Apache v2.0 Group: Libraries/Python Source0: https://pypi.python.org/packages/f4/6f/41b835c9bf69b03615630f8a6f6d45dafbec95eb4e2bb816638f043552b2/fasteners-%{version}.tar.gz # Source0-md5: fcb13261c9b0039d9b1c4feb9bc75e04 URL: https://pypi.python.org/pypi/fasteners BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.714 %if %{with python2} BuildRequires: python-modules BuildRequires: python-setuptools %if %{with tests} BuildRequires: python-monotonic BuildRequires: python-testtools %endif %endif %if %{with python3} BuildRequires: python3-modules BuildRequires: python3-setuptools %if %{with tests} BuildRequires: python3-monotonic BuildRequires: python3-testtools %endif %endif Requires: python-modules BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description Provides useful locks. %package -n python3-%{module} Summary: Provides useful locks Group: Libraries/Python Requires: python3-modules %description -n python3-%{module} Provides useful locks %prep %setup -q -n %{pypi_name}-%{version} %build %if %{with python2} %py_build %{?with_tests:test} %endif %if %{with python3} %py3_build %{?with_tests:test} %endif %install rm -rf $RPM_BUILD_ROOT %if %{with python2} %py_install %py_postclean %endif %if %{with python3} %py3_install %endif %clean rm -rf $RPM_BUILD_ROOT %if %{with python2} %files %defattr(644,root,root,755) %doc ChangeLog README.rst %{py_sitescriptdir}/%{module} %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info %endif %if %{with python3} %files -n python3-%{module} %defattr(644,root,root,755) %doc ChangeLog README.rst %{py3_sitescriptdir}/%{module} %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info %endif