diff --git a/python-qt5.spec b/python-qt5.spec index 851780d..a492e91 100644 --- a/python-qt5.spec +++ b/python-qt5.spec @@ -24,6 +24,8 @@ Source0: http://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt-gpl-%{ver Source0: http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-%{version}/PyQt-gpl-%{version}.tar.gz %endif Source1: macros.pyqt5 +# wrapper, see https://bugzilla.redhat.com/show_bug.cgi?id=1193107#c9 +Source2: pyuic5.sh ## upstream patches @@ -99,8 +101,6 @@ Summary: Python 3 bindings for Qt5 Requires: python3-qt5%{?_isa} = %{version}-%{release} Requires: qt5-qtbase-devel Requires: python3-sip-devel -# FIXME: -devel scripts require base/python(2) runtime, https://bugzilla.redhat.com/1193107 -Requires: %{name}%{?_isa} = %{version}-%{release} Provides: python3-PyQt5-devel = %{version}-%{release} %description -n python3-qt5-devel Files needed to build other bindings for C++ classes that inherit from any @@ -191,6 +191,17 @@ sed -i \ -e "s|@@EVR@@|%{?epoch:%{epoch:}}%{version}-%{release}|g" \ %{buildroot}%{rpm_macros_dir}/macros.pyqt5 +%if 0%{?_with_python3} +# install pyuic5 wrapper to handle both/either python2/python3 +rm -fv %{buildroot}%{_bindir}/pyuic5 +install -p -m755 -D %{SOURCE2} \ + %{buildroot}%{_bindir}/pyuic5 +sed -i \ + -e "s|@PYTHON3@|%{__python3}|g" \ + -e "s|@PYTHON2@|%{__python2}|g" \ + %{buildroot}%{_bindir}/pyuic5 +%endif + %if 0%{?with_python2} %files @@ -305,7 +316,7 @@ sed -i \ %changelog * Fri Jun 05 2015 Rex Dieter - 5.4.1-5 -- -devel: Requires: python-qt5 (#1193107) +- wrong python release used in pyuic5 launch script (#1193107) - -doc: add qsci doc QyQt5.api content - enable Qt5WebChannel/Qt5WebSockets support diff --git a/pyuic5.sh b/pyuic5.sh new file mode 100644 index 0000000..75263a1 --- /dev/null +++ b/pyuic5.sh @@ -0,0 +1,7 @@ +#!/bin/sh +@PYTHON3@ -c "import PyQt5" &> /dev/null +if [ $? -eq 0 ]; then + exec @PYTHON3@ -m PyQt5.uic.pyuic ${1+"$@"} +else + exec @PYTHON2@ -m PyQt5.uic.pyuic ${1+"$@"} +fi