diff --git a/python-Automat.spec b/python-Automat.spec index f697229..51f219d 100644 --- a/python-Automat.spec +++ b/python-Automat.spec @@ -11,7 +11,8 @@ Automat is a library for concise, idiomatic Python expression of finite-state automata (particularly deterministic finite-state transducers).} -%bcond_without tests +%bcond_without tests +%bcond_without python2 Name: python-%{pkgname} Version: 0.7.0 @@ -28,6 +29,7 @@ BuildArch: noarch %description %{common_description} +%if %{with python2} %package -n python2-%{pkgname} Summary: %{summary} %{?python_provide:%python_provide python2-%{pkgname}} @@ -44,6 +46,7 @@ BuildRequires: python2dist(twisted) >= 16.1.1 %endif %description -n python2-%{pkgname} %{common_description} +%endif %package -n python3-%{pkgname} @@ -71,30 +74,38 @@ rm -rf %{eggname}.egg-info %build +%if %{with python2} %py2_build +%endif %py3_build %install # Must do the default python version install last because # the scripts in /usr/bin are overwritten with every setup.py install. +%if %{with python2} %py2_install rm -rf %{buildroot}%{_bindir}/* +%endif %py3_install %check %if %{with tests} +%if %{with python2} %{__python2} setup.py test +%endif %{__python3} setup.py test %endif +%if %{with python2} %files -n python2-%{pkgname} %license LICENSE %doc README.md %{python2_sitelib}/%{libname} %{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info +%endif %files -n python3-%{pkgname}