diff --git a/python-distro.spec b/python-distro.spec index cdb5ce6..2dbe01b 100644 --- a/python-distro.spec +++ b/python-distro.spec @@ -1,9 +1,9 @@ %global pypi_name distro %if 0%{?rhel} && 0%{?rhel} <= 7 -%global with_python3 0 +%bcond_with python3 %else -%global with_python3 1 +%bcond_without python3 %endif Name: python-%{pypi_name} @@ -47,7 +47,7 @@ Requires: /usr/bin/lsb_release Python 2 version. -%if 0%{with_python3} +%if %{with python3} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} @@ -67,13 +67,13 @@ rm -rf %{pypi_name}.egg-info %build %py2_build -%if 0%{with_python3} +%if %{with python3} %py3_build %endif %install %py2_install -%if 0%{with_python3} +%if %{with python3} %py3_install %endif @@ -85,7 +85,7 @@ rm -rf %{pypi_name}.egg-info %{python2_sitelib}/%{pypi_name}-*.egg-info/ %{python2_sitelib}/%{pypi_name}.py* -%if 0%{with_python3} +%if %{with python3} %files -n python3-%{pypi_name} %doc README.rst #%%license LICENSE