diff --git a/sip.spec b/sip.spec index 3bbd051..4872ce0 100644 --- a/sip.spec +++ b/sip.spec @@ -7,6 +7,13 @@ %{!?python2_sitearch:%global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %{!?python2_inc:%global python2_inc %(%{__python2} -c "from distutils.sysconfig import get_python_inc; print get_python_inc(1)")} +%if %{fedora} > 30 + %global PYINCLUDE %{_includedir}/python%{python3_version} +%endif +%if %{fedora} <= 30 + %global PYINCLUDE %{_includedir}/python%{python3_version}m +%endif + %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) # trim changelog included in binary rpms @@ -24,7 +31,7 @@ Summary: SIP - Python/C++ Bindings Generator Name: sip Version: 4.19.18 -Release: 4%{?dist} +Release: 5%{?dist} # sipgen/parser.{c.h} is GPLv3+ with exceptions (bison) License: GPLv2 or GPLv3 and (GPLv3+ with exceptions) @@ -224,7 +231,7 @@ sed -i -e 's|target = siplib|target = sip|g' siplib/siplib.sbf mkdir %{_target_platform}-python3 pushd %{_target_platform}-python3 %{__python3} ../configure.py \ - -b %{_bindir} -d %{python3_sitearch} -e %{_includedir}/python%{python3_version} \ + -b %{_bindir} -d %{python3_sitearch} -e %{PYINCLUDE} \ CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" %make_build @@ -235,7 +242,7 @@ mkdir %{_target_platform}-python3-pyqt4 pushd %{_target_platform}-python3-pyqt4 %{__python3} ../configure.py \ --sip-module=PyQt4.sip \ - -b %{_bindir} -d %{python3_sitearch} -e %{_includedir}/python%{python3_version} \ + -b %{_bindir} -d %{python3_sitearch} -e %{PYINCLUDE} \ CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" %make_build @@ -245,7 +252,7 @@ mkdir %{_target_platform}-python3-pyqt5 pushd %{_target_platform}-python3-pyqt5 %{__python3} ../configure.py \ --sip-module=PyQt5.sip \ - -b %{_bindir} -d %{python3_sitearch} -e %{_includedir}/python%{python3_version} \ + -b %{_bindir} -d %{python3_sitearch} -e %{PYINCLUDE} \ CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" %make_build @@ -256,7 +263,7 @@ mkdir %{_target_platform}-python3-wx pushd %{_target_platform}-python3-wx %{__python3} ../configure.py \ --sip-module=wx.siplib \ - -b %{_bindir} -d %{python3_sitearch} -e %{_includedir}/python%{python3_version} \ + -b %{_bindir} -d %{python3_sitearch} -e %{PYINCLUDE} \ CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" %make_build @@ -355,7 +362,7 @@ install -D -p -m644 %{SOURCE1} %{buildroot}%{rpm_macros_dir}/macros.sip %if %{with python3} %files -n python%{python3_pkgversion}-sip-devel -%{_prefix}/include/python%{python3_version}/sip.h +%{PYINCLUDE}/sip.h %{python3_sitearch}/sipconfig.py* %{python3_sitearch}/sipdistutils.py* %{python3_sitearch}/__pycache__/* @@ -393,6 +400,9 @@ install -D -p -m644 %{SOURCE1} %{buildroot}%{rpm_macros_dir}/macros.sip %changelog +* Wed Aug 28 2019 Gwyn Ciesla 4.19.18-5 +- Conditionalize Python 3 include dir. + * Mon Aug 19 2019 Scott Talbert - 4.19.18-4 - Build a namespaced sip module, wx.siplib, for wxpython (#1739469)