From 2c938e4b57749261e8fcd740dd229a02be5e54d9 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sun, 1 Jan 2017 21:29:17 +0100 Subject: [PATCH] use %bcond for python3 It's much easier to switch than changing variables and will be easier in future to switch. Signed-off-by: Igor Gnatenko --- python-distro.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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