python3-qt5 support

f41
Rex Dieter 11 years ago
parent 1963c0cce5
commit 12d0d5b57c

@ -1,8 +1,13 @@
%if 0%{?fedora}
%global with_python3 1
%endif
%global with_python2 1
Summary: Python bindings for Qt5
Name: python-qt5
Version: 5.2
Release: 3%{?dist}
Release: 4%{?dist}
# all BSD, except for GPLv2+ dbus bindings and examples
License: BSD and GPLv2+
@ -30,12 +35,19 @@ BuildRequires: pkgconfig(Qt5Xml) pkgconfig(Qt5XmlPatterns)
BuildRequires: pkgconfig(Qt5WebKit) pkgconfig(Qt5WebKitWidgets)
BuildRequires: python2-devel
BuildRequires: sip-devel >= 4.15.4
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-sip-devel >= 4.15.0
%endif # with_python3
Requires: dbus-python
%{?_qt5_version:Requires: qt5-qtbase%{?_isa} >= %{_qt5_version}}
%{?_sip_api:Requires: sip-api(%{_sip_api_major}) >= %{_sip_api}}
%filter_provides_in %{python_sitearch} %{?_qt5_plugindir}
%if 0%{?with_python3}
%filter_provides_in %{python3_sitearch} %{?_qt5_plugindir}
%endif
%filter_setup
Provides: PyQt5 = %{version}-%{release}
@ -54,6 +66,22 @@ Provides: PyQt5-devel = %{version}-%{release}
Files needed to build other bindings for C++ classes that inherit from any
of the Qt5 classes (e.g. KDE or your own).
%package -n python3-qt5
Summary: Python 3 bindings for Qt5
%{?_sip_api:Requires: python3-sip-api(%{_sip_api_major}) >= %{_sip_api}}
Provides: python3-PyQt5 = %{version}-%{release}
%description -n python3-qt5
%{summary}.
%package -n python3-qt5-devel
Summary: Python 3 bindings for Qt5
Requires: python3-qt5%{?_isa} = %{version}-%{release}
Requires: python3-sip-devel
Provides: python3-PyQt5-devel = %{version}-%{release}
%description -n python3-qt5-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}
@ -67,10 +95,17 @@ BuildArch: noarch
%patch50 -p1 -b .qreal_arm
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build
PATH=%{_qt5_bindir}:$PATH ; export PATH
# Python 2 build:
%if 0%{?with_python2}
%{__python2} configure.py \
--assume-shared \
--confirm-license \
@ -79,10 +114,34 @@ PATH=%{_qt5_bindir}:$PATH ; export PATH
--verbose
make %{?_smp_mflags}
%endif # with_python2
# Python 3 build:
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} configure.py \
--assume-shared \
--confirm-license \
--no-timestamp \
--qmake=%{_qt5_qmake} \
--verbose
make %{?_smp_mflags}
popd
%endif # with_python3
%install
# Python 3 build:
%if 0%{?with_python3}
make install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot} -C %{py3dir}
%endif # with_python3
# Python 2 build:
%if 0%{?with_python2}
make install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot}
%endif # with_python2
# remove Python3 code from Python2 directory, fixes FTBFS like PyQt4 (#564633)
rm -rfv %{buildroot}%{python_sitearch}/PyQt5/uic/port_v3/
@ -90,6 +149,7 @@ rm -rfv %{buildroot}%{python_sitearch}/PyQt5/uic/port_v3/
rm -rfv %{buildroot}%{python3_sitearch}/PyQt5/uic/port_v2/
%if 0%{?with_python2}
%files
%doc NEWS README
%doc LICENSE
@ -127,6 +187,42 @@ rm -rfv %{buildroot}%{python3_sitearch}/PyQt5/uic/port_v2/
%{_bindir}/pyrcc5
%{_bindir}/pyuic5
%{_datadir}/sip/PyQt5/
%endif
%if 0%{?with_python3}
%files -n python3-qt5
%doc NEWS README
%doc LICENSE
%dir %{python3_sitearch}/PyQt5/
%{python3_sitearch}/PyQt5/__pycache__/
%{python3_sitearch}/PyQt5/__init__.py*
%{python3_sitearch}/PyQt5/Qt.so
%{python3_sitearch}/PyQt5/QtCore.so
%{python3_sitearch}/PyQt5/QtDBus.so
%{python3_sitearch}/PyQt5/QtDesigner.so
%{python3_sitearch}/PyQt5/QtGui.so
%{python3_sitearch}/PyQt5/QtHelp.so
%{python3_sitearch}/PyQt5/QtMultimedia.so
%{python3_sitearch}/PyQt5/QtMultimediaWidgets.so
%{python3_sitearch}/PyQt5/QtNetwork.so
%{python3_sitearch}/PyQt5/QtOpenGL.so
%{python3_sitearch}/PyQt5/QtPrintSupport.so
%{python3_sitearch}/PyQt5/QtQml.so
%{python3_sitearch}/PyQt5/QtQuick.so
%{python3_sitearch}/PyQt5/QtSql.so
%{python3_sitearch}/PyQt5/QtSvg.so
%{python3_sitearch}/PyQt5/QtTest.so
%{python3_sitearch}/PyQt5/QtWebKit.so
%{python3_sitearch}/PyQt5/QtWebKitWidgets.so
%{python3_sitearch}/PyQt5/QtWidgets.so
%{python3_sitearch}/PyQt5/QtX11Extras.so
%{python3_sitearch}/PyQt5/QtXmlPatterns.so
%{python3_sitearch}/PyQt5/_QOpenGLFunctions_2_0.so
%{python3_sitearch}/PyQt5/uic/
# FIXME/TODO
#files -n python3-qt5-devel
%endif # with_python3
%files doc
%doc doc/*
@ -134,6 +230,9 @@ rm -rfv %{buildroot}%{python3_sitearch}/PyQt5/uic/port_v2/
%changelog
* Sat Feb 15 2014 Rex Dieter <rdieter@fedoraproject.org> 5.2-4
- python3-qt5 support
* Thu Feb 13 2014 Rex Dieter <rdieter@fedoraproject.org> 5.2-3
- Provides: PyQt5

Loading…
Cancel
Save