From ca0e14bb2509b6f06dfb7d2ae4f6f8519dae667b Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Apr 21 2019 21:46:52 +0000 Subject: Build for python3 for EPEL --- diff --git a/python-qt5.spec b/python-qt5.spec index b4d75dd..81a3515 100644 --- a/python-qt5.spec +++ b/python-qt5.spec @@ -2,8 +2,11 @@ %global with_python3 1 %global python3_dbus_dir %(%{__python3} -c "import dbus.mainloop; print(dbus.mainloop.__path__[0])" 2>/dev/null || echo "%{python3_sitearch}/dbus/mainloop") %endif +# sip too old for python2 in EPEL +%if 0%{?fedora} %global with_python2 1 %global python2_dbus_dir %(%{__python2} -c "import dbus.mainloop; print(dbus.mainloop.__path__[0])" 2>/dev/null || echo "%{python2_sitearch}/dbus/mainloop") +%endif # enable/disable individual modules # drop power64, it's not supported yet (than) @@ -22,6 +25,10 @@ #global py3_sipdir %{_datadir}/python3-sip/PyQt5 #endif +%if 0%{?rhel} == 7 +%global py3_sip %{_bindir}/python3-sip +%endif + # see also https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/JQQ66XJSIT2FGTK2YQY7AXMEH5IXMPUX/ %undefine _strict_symbol_defs_build @@ -30,7 +37,7 @@ Summary: PyQt5 is Python bindings for Qt5 Name: python-qt5 Version: 5.12.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3 Url: http://www.riverbankcomputing.com/software/pyqt/ @@ -74,6 +81,7 @@ BuildRequires: pkgconfig(Qt5X11Extras) BuildRequires: pkgconfig(Qt5Xml) pkgconfig(Qt5XmlPatterns) BuildRequires: pkgconfig(Qt5WebChannel) BuildRequires: pkgconfig(Qt5WebSockets) +%if 0%{?with_python2} BuildRequires: python2-devel python2 BuildRequires: python2-enum34 %if 0%{?fedora} > 27 @@ -85,6 +93,7 @@ BuildRequires: %{python2_dbus} %global sip_ver 4.19.15 BuildRequires: python2-pyqt5-sip >= %{sip_ver} BuildRequires: python2-sip-devel >= %{sip_ver} +%endif # with_python2 %if 0%{?with_python3} BuildRequires: python%{python3_pkgversion}-devel python%{python3_pkgversion} BuildRequires: python%{python3_pkgversion}-dbus @@ -102,6 +111,7 @@ Obsoletes: python-qt5 < 5.5.1-10 %global __provides_exclude_from ^(%{_qt5_plugindir}/.*\\.so)$ +%if 0%{?with_python2} %package -n python2-qt5 Summary: Python 2 bindings for Qt5 Requires: python2-qt5-base%{?_isa} = %{version}-%{release} @@ -140,6 +150,7 @@ Provides: python2-PyQt5-devel = %{version}-%{release} %description -n python2-qt5-devel Files needed to build other bindings for C++ classes that inherit from any of the Qt5 classes. +%endif %package rpm-macros Summary: RPM macros %{name} @@ -166,7 +177,11 @@ Requires: python%{python3_pkgversion}-qt5-base%{?_isa} = %{version}-%{release} %package -n python%{python3_pkgversion}-qt5-base Summary: Python 3 bindings for Qt5 base %{?_qt5:Requires: %{_qt5}%{?_isa} = %{_qt5_version}} +%if 0%{?_python3_sip_api_major} +%{?_python3_sip_api:Requires: python%{python3_pkgversion}-pyqt5-sip-api(%{_python3_sip_api_major}) >= %{_python3_sip_api}} +%else %{?_sip_api:Requires: python%{python3_pkgversion}-pyqt5-sip-api(%{_sip_api_major}) >= %{_sip_api}} +%endif Provides: python%{python3_pkgversion}-PyQt5-base = %{version}-%{release} Provides: python%{python3_pkgversion}-PyQt5-base%{?_isa} = %{version}-%{release} Requires: %{name}-rpm-macros = %{version}-%{release} @@ -194,6 +209,7 @@ BuildArch: noarch %{summary}. %if 0%{?webengine} +%if 0%{?with_python2} %package -n python2-qt5-webengine Summary: Python bindings for Qt5 WebEngine BuildRequires: pkgconfig(Qt5WebEngine) @@ -202,9 +218,11 @@ Requires: python2-qt5%{?_isa} = %{version}-%{release} %{?python_provide:%python_provide python2-qt5-webengine} %description -n python2-qt5-webengine %{summary}. +%endif %package -n python%{python3_pkgversion}-qt5-webengine Summary: Python3 bindings for Qt5 WebEngine +BuildRequires: pkgconfig(Qt5WebEngine) Obsoletes: python3-webengine < 5.5.1-13 Obsoletes: python3-qt5 < 5.5.1-10 Requires: python%{python3_pkgversion}-qt5%{?_isa} = %{version}-%{release} @@ -214,6 +232,7 @@ Requires: python%{python3_pkgversion}-qt5%{?_isa} = %{version}-%{release} %endif %if 0%{?webkit} +%if 0%{?with_python2} %package -n python2-qt5-webkit Summary: Python bindings for Qt5 Webkit BuildRequires: pkgconfig(Qt5WebKit) @@ -224,9 +243,12 @@ Requires: python2-qt5%{?_isa} = %{version}-%{release} %{?python_provide:%python_provide python2-qt5-webkit} %description -n python2-qt5-webkit %{summary}. +%endif %package -n python%{python3_pkgversion}-qt5-webkit Summary: Python3 bindings for Qt5 Webkit +BuildRequires: pkgconfig(Qt5WebKit) +BuildRequires: pkgconfig(Qt5WebKitWidgets) Obsoletes: python3-qt5 < 5.5.1-10 Requires: python%{python3_pkgversion}-qt5%{?_isa} = %{version}-%{release} %{?python_provide:%python_provide python%{python3_pkgversion}-qt5-webkit} @@ -277,6 +299,7 @@ pushd %{_target_platform}-python3 --confirm-license \ --qmake=%{_qt5_qmake} \ %{?with_python2:--no-qsci-api}%{!?with_python2:--qsci-api --qsci-api-destdir=%{_qt5_datadir}/qsci} \ + %{?py3_sip:--sip=%{_bindir}/python3-sip} \ %{?py3_sipdir:--sipdir=%{py3_sipdir}} \ --verbose \ QMAKE_CFLAGS_RELEASE="%{optflags}" \ @@ -345,7 +368,6 @@ sed -i \ %if 0%{?with_python2} %files -n python2-qt5 -%{_qt5_plugindir}/PyQt5/ %{python2_sitearch}/PyQt5/Enginio.so %{python2_sitearch}/PyQt5/QtBluetooth.so %{python2_sitearch}/PyQt5/QtDesigner.so @@ -366,7 +388,6 @@ sed -i \ %{python2_sitearch}/PyQt5/QtX11Extras.so %{python2_sitearch}/PyQt5/QtXmlPatterns.so %{python2_sitearch}/PyQt5/uic/ -%{_qt5_plugindir}/designer/libpyqt5.so # *was* in -devel %{_bindir}/pylupdate5 %{_bindir}/pyrcc5 @@ -420,6 +441,7 @@ sed -i \ %if 0%{?with_python3} %files -n python%{python3_pkgversion}-qt5 +%{_qt5_plugindir}/PyQt5/ %{python3_sitearch}/PyQt5/Enginio.* %{python3_sitearch}/PyQt5/QtBluetooth.* %{python3_sitearch}/PyQt5/QtDesigner.* @@ -440,6 +462,7 @@ sed -i \ %{python3_sitearch}/PyQt5/QtX11Extras.* %{python3_sitearch}/PyQt5/QtXmlPatterns.* %{python3_sitearch}/PyQt5/uic/ +%{_qt5_plugindir}/designer/libpyqt5.so # *was* in python3-qt5-devel %{_bindir}/pylupdate5 %{_bindir}/pyrcc5 @@ -505,6 +528,9 @@ sed -i \ %changelog +* Sun Apr 21 2019 Orion Poplawski - 5.12.1-2 +- Build for python3 for EPEL + * Thu Mar 21 2019 Rex Dieter - 5.12.1-1 - 5.12.1 - omit webengine (now packaged separately)