diff --git a/sip.spec b/sip.spec index f9305dc..8bf2207 100644 --- a/sip.spec +++ b/sip.spec @@ -1,8 +1,10 @@ %if 0%{?fedora} > 12 || 0%{?rhel} > 6 -%global with_python3 1 +%bcond_without python3 +%else +%bcond_with python3 %endif -%if 0%{?with_python3} +%if %{with python3} %{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")} %endif %{!?__python2:%global __python2 /usr/bin/python2} @@ -20,7 +22,7 @@ Summary: SIP - Python/C++ Bindings Generator Name: sip Version: 4.19.8 -Release: 2%{?dist} +Release: 3%{?dist} # sipgen/parser.{c.h} is GPLv3+ with exceptions (bison) License: GPLv2 or GPLv3 and (GPLv3+ with exceptions) @@ -96,11 +98,11 @@ Obsoletes: sip-macros < 4.15.5 BuildArch: noarch %description macros This package contains RPM macros for use when working with SIP. -%if 0%{?with_python3} +%if %{with python3} It is used by both the sip-devel (python 2) and python%{python3_pkgversion}-sip-devel subpackages. %endif -%if 0%{?with_python3} +%if %{with python3} %package -n python%{python3_pkgversion}-sip Summary: SIP - Python 3/C++ Bindings Generator BuildRequires: python%{python3_pkgversion}-devel @@ -140,7 +142,7 @@ pushd %{_target_platform} %make_build popd -%if 0%{?with_python3} +%if %{with python3} patch -p1 < %{PATCH52} mkdir %{_target_platform}-python3 pushd %{_target_platform}-python3 @@ -157,7 +159,7 @@ popd %install # Perform the Python 3 installation first, to avoid stomping over the Python 2 # /usr/bin/sip: -%if 0%{?with_python3} +%if %{with python3} %make_install -C %{_target_platform}-python3 mkdir -p %{buildroot}%{_datadir}/python3-sip mv %{buildroot}%{_bindir}/sip %{buildroot}%{_bindir}/python3-sip @@ -189,7 +191,7 @@ install -D -p -m644 %{SOURCE1} %{buildroot}%{rpm_macros_dir}/macros.sip %files macros %{rpm_macros_dir}/macros.sip -%if 0%{?with_python3} +%if %{with python3} %files -n python%{python3_pkgversion}-sip %doc NEWS README %license LICENSE LICENSE-GPL2 LICENSE-GPL3 @@ -208,6 +210,9 @@ install -D -p -m644 %{SOURCE1} %{buildroot}%{rpm_macros_dir}/macros.sip %changelog +* Thu Mar 15 2018 Sérgio Basto - 4.19.8-3 +- Use bcond to handle conditional builds + * Wed Mar 07 2018 Rex Dieter - 4.19.8-2 - BR: gcc-c++, sip-api(12)=12.4