%global with_python2 1 %global python2_dbus_dir %(%{__python2} -c "import dbus.mainloop; print(dbus.mainloop.__path__[0])") # enable/disable individual modules # drop power64, it's not supported yet (than) %if 0%{?fedora} > 22 %ifarch %{ix86} x86_64 %{arm} aarch64 mips mipsel mips64el %global webengine 1 %endif %endif %global webkit 1 Summary: PyQt5 is Python 2 bindings for Qt5 Name: python2-qt5 Version: 5.6 Release: 1%{?dist} # all BSD, except for GPLv2+ dbus bindings and examples License: BSD and GPLv2+ Url: http://www.riverbankcomputing.com/software/pyqt/ %if 0%{?snap:1} Source0: http://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-%{version}%{?snap:-snapshot-%{snap}}.tar.gz %else Source0: http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-%{version}/PyQt5_gpl-%{version}.tar.gz %endif # wrapper, see https://bugzilla.redhat.com/show_bug.cgi?id=1193107#c9 Source1: pyuic5.sh ## upstream patches ## upstreamable patches Patch0: python2-qt5_sipdir.patch Patch1: PyQt5_gpl-5.6-dbus_ftbfs.patch ## patches that are specific to backporting on rhel7 Patch2: python2-qt5_licensecheck.patch Patch3: python2-qt5_windowenum.patch BuildRequires: chrpath BuildRequires: findutils BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(dbus-python) BuildRequires: pkgconfig(phonon4qt5) BuildRequires: pkgconfig(Qt5Core) >= 5.5 BuildRequires: pkgconfig(Enginio) BuildRequires: pkgconfig(Qt5Bluetooth) BuildRequires: pkgconfig(Qt5DBus) pkgconfig(Qt5Declarative) BuildRequires: pkgconfig(Qt5Designer) BuildRequires: pkgconfig(Qt5Gui) pkgconfig(Qt5Multimedia) BuildRequires: pkgconfig(Qt5Location) BuildRequires: pkgconfig(Qt5Nfc) BuildRequires: pkgconfig(Qt5Network) pkgconfig(Qt5OpenGL) BuildRequires: pkgconfig(Qt5Positioning) BuildRequires: pkgconfig(Qt5Script) BuildRequires: pkgconfig(Qt5Sensors) BuildRequires: pkgconfig(Qt5SerialPort) BuildRequires: pkgconfig(Qt5Sql) pkgconfig(Qt5Svg) pkgconfig(Qt5Test) BuildRequires: pkgconfig(Qt5X11Extras) BuildRequires: pkgconfig(Qt5Xml) pkgconfig(Qt5XmlPatterns) BuildRequires: pkgconfig(Qt5WebChannel) BuildRequires: pkgconfig(Qt5WebSockets) BuildRequires: python2-devel python2 BuildRequires: sip-devel >= 4.18 # Replaces python-qt5 Obsoletes: python-qt5 Requires: dbus-python BuildRequires: qt5-qtbase-private-devel %{?_qt5:Requires: %{_qt5}%{?_isa} = %{_qt5_version}} %{?_sip_api:Requires: sip-api(%{_sip_api_major}) >= %{_sip_api}} %filter_provides_in %{python_sitearch} %{?_qt5_plugindir} %filter_setup Provides: PyQt5 = %{version}-%{release} Provides: PyQt5%{?_isa} = %{version}-%{release} Provides: python2-PyQt5 = %{version}-%{release} Provides: python2-PyQt5%{?_isa} = %{version}-%{release} Provides: python2-qt5 = %{version}-%{release} Provides: python2-qt5%{?_isa} = %{version}-%{release} %description PyQt5 is Python 2 bindings for Qt5. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: qt5-qtbase-devel Requires: sip-devel Provides: PyQt5-devel = %{version}-%{release} Provides: python2-PyQt5-devel = %{version}-%{release} %description devel Files needed to build other bindings for C++ classes that inherit from any of the Qt5 classes (e.g. KDE or your own). %package doc Summary: Developer documentation for %{name} Provides: PyQt5-doc = %{version}-%{release} BuildArch: noarch %description doc %{summary}. %if 0%{?webengine} %package webengine Summary: Python bindings for Qt5 WebEngine BuildRequires: pkgconfig(Qt5WebEngine) Obsoletes: python-qt5 < 5.5.1-10 Requires: %{name}%{?_isa} = %{version}-%{release} %description webengine %endif %if 0%{?webkit} %package webkit Summary: Python bindings for Qt5 Webkit BuildRequires: pkgconfig(Qt5WebKit) pkgconfig(Qt5WebKitWidgets) Obsoletes: python-qt5 < 5.5.1-10 Requires: %{name}%{?_isa} = %{version}-%{release} %description webkit %endif %prep %setup -q -n PyQt5_gpl-%{version}%{?snap:-snapshot-%{snap}} %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %build PATH=%{_qt5_bindir}:$PATH ; export PATH mkdir %{_target_platform} pushd %{_target_platform} %{__python2} ../configure.py \ --assume-shared \ --confirm-license \ --qmake=%{_qt5_qmake} \ --qsci-api --qsci-api-destdir=%{_qt5_datadir}/qsci \ --verbose \ QMAKE_CFLAGS_RELEASE="%{optflags}" \ QMAKE_CXXFLAGS_RELEASE="%{optflags}" \ QMAKE_LFLAGS_RELEASE="%{?__global_ldflags}" make %{?_smp_mflags} popd %install make install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot} -C %{_target_platform} # ensure .so modules are executable for proper -debuginfo extraction for i in %{buildroot}%{python2_sitearch}/PyQt5/*.so %{buildroot}%{python2_dbus_dir}/pyqt5.so ; do chmod a+rx $i done # remove Python3 code from Python2 directory, fixes FTBFS like PyQt4 (#564633) rm -rfv %{buildroot}%{python2_sitearch}/PyQt5/uic/port_v3/ %files %doc NEWS README %license LICENSE %{python2_dbus_dir}/pyqt5.so %{_qt5_plugindir}/PyQt5/ %dir %{python2_sitearch}/PyQt5/ %{python2_sitearch}/PyQt5/__init__.py* %{python2_sitearch}/PyQt5/Enginio.so %{python2_sitearch}/PyQt5/Qt.so %{python2_sitearch}/PyQt5/QtBluetooth.so %{python2_sitearch}/PyQt5/QtCore.so %{python2_sitearch}/PyQt5/QtDBus.so %{python2_sitearch}/PyQt5/QtDesigner.so %{python2_sitearch}/PyQt5/QtGui.so %{python2_sitearch}/PyQt5/QtHelp.so %{python2_sitearch}/PyQt5/QtLocation.so %{python2_sitearch}/PyQt5/QtMultimedia.so %{python2_sitearch}/PyQt5/QtMultimediaWidgets.so %{python2_sitearch}/PyQt5/QtNetwork.so %{python2_sitearch}/PyQt5/QtNfc.so %{python2_sitearch}/PyQt5/QtOpenGL.so %{python2_sitearch}/PyQt5/QtPositioning.so %{python2_sitearch}/PyQt5/QtPrintSupport.so %{python2_sitearch}/PyQt5/QtQml.so %{python2_sitearch}/PyQt5/QtQuick.so %{python2_sitearch}/PyQt5/QtQuickWidgets.so %{python2_sitearch}/PyQt5/QtSensors.so %{python2_sitearch}/PyQt5/QtSerialPort.so %{python2_sitearch}/PyQt5/QtSql.so %{python2_sitearch}/PyQt5/QtSvg.so %{python2_sitearch}/PyQt5/QtTest.so %{python2_sitearch}/PyQt5/QtWebChannel.so %{python2_sitearch}/PyQt5/QtWebSockets.so %{python2_sitearch}/PyQt5/QtWidgets.so %{python2_sitearch}/PyQt5/QtX11Extras.so %{python2_sitearch}/PyQt5/QtXml.so %{python2_sitearch}/PyQt5/QtXmlPatterns.so %{python2_sitearch}/PyQt5/_QOpenGLFunctions_2_0.so %{python2_sitearch}/PyQt5/_QOpenGLFunctions_2_1.so %{python2_sitearch}/PyQt5/_QOpenGLFunctions_4_1_Core.so %{python2_sitearch}/PyQt5/uic/ %{_qt5_plugindir}/designer/libpyqt5.so %if 0%{?webengine} %files webengine %{python2_sitearch}/PyQt5/QtWebEngineCore.* %{python2_sitearch}/PyQt5/QtWebEngineWidgets.* %endif %if 0%{?webkit} %files webkit %{python2_sitearch}/PyQt5/QtWebKit.* %{python2_sitearch}/PyQt5/QtWebKitWidgets.* %endif %files devel %{_bindir}/pylupdate5 %{_bindir}/pyrcc5 %{_bindir}/pyuic5 %{_datadir}/sip/PyQt5/ %files doc %doc doc/* %doc examples/ # avoid dep on qscintilla-python, own %%_qt5_datadir/qsci/... here for now %dir %{_qt5_datadir}/qsci/ %dir %{_qt5_datadir}/qsci/api/ %dir %{_qt5_datadir}/qsci/api/python/ %doc %{_qt5_datadir}/qsci/api/python/PyQt5.api %changelog * Wed Oct 9 2019 Martyn Gigg - 5.6-1 - Introduce python2- prefix to avoid conflicts with EPEL python-qt5 - Remove rpm-macros to avoid future conflicts