From 3124e3a806f4b5df7a8f00cf281f8ac05191ee44 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 27 Jan 2017 07:34:22 -0600 Subject: [PATCH] add wrappers for pyrcc5, pylupdate5 --- pylupdate5.sh | 8 ++++++++ pyrcc5.sh | 7 +++++++ python-qt5.spec | 16 ++++++++++------ pyuic5.sh | 2 +- 4 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 pylupdate5.sh create mode 100644 pyrcc5.sh diff --git a/pylupdate5.sh b/pylupdate5.sh new file mode 100644 index 0000000..0d00e79 --- /dev/null +++ b/pylupdate5.sh @@ -0,0 +1,8 @@ +#!/bin/sh +@PYTHON3@ -c "import PyQt5.pylupdate_main" &> /dev/null +if [ $? -eq 0 ]; then + exec @PYTHON3@ -m PyQt5.pylupdate_main ${1+"$@"} +else + exec @PYTHON2@ -m PyQt5.pylupdate_main ${1+"$@"} + +fi diff --git a/pyrcc5.sh b/pyrcc5.sh new file mode 100644 index 0000000..56437ea --- /dev/null +++ b/pyrcc5.sh @@ -0,0 +1,7 @@ +#!/bin/sh +@PYTHON3@ -c "import PyQt5.PyQt5.pyrcc_main" &> /dev/null +if [ $? -eq 0 ]; then + exec @PYTHON3@ -m PyQt5.pyrcc_main ${1+"$@"} +else + exec @PYTHON2@ -m PyQt5.pyrcc_main ${1+"$@"} +fi diff --git a/python-qt5.spec b/python-qt5.spec index f2b99aa..c17fd65 100644 --- a/python-qt5.spec +++ b/python-qt5.spec @@ -32,7 +32,9 @@ Source0: http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-%{version}/PyQ %endif Source1: macros.pyqt5 # wrapper, see https://bugzilla.redhat.com/show_bug.cgi?id=1193107#c9 -Source2: pyuic5.sh +Source2: pylupdate5.sh +Source3: pyrcc5.sh +Source4: pyuic5.sh ## upstream patches @@ -265,14 +267,16 @@ sed -i \ %{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 +# install wrappers to handle both/either python2/python3 +# TODO: consider alternatives? -- rex +rm -fv %{buildroot}%{_bindir}/{pyrcc5,pylupdate5,pyuic5} +install -p -m755 -D %{SOURCE2} %{buildroot}%{_bindir}/pylupdate5 +install -p -m755 -D %{SOURCE3} %{buildroot}%{_bindir}/pyrcc5 +install -p -m755 -D %{SOURCE4} %{buildroot}%{_bindir}/pyuic5 sed -i \ -e "s|@PYTHON3@|%{__python3}|g" \ -e "s|@PYTHON2@|%{__python2}|g" \ - %{buildroot}%{_bindir}/pyuic5 + %{buildroot}%{_bindir}/{pyrcc5,pylupdate5,pyuic5} %endif diff --git a/pyuic5.sh b/pyuic5.sh index 75263a1..9d2958e 100644 --- a/pyuic5.sh +++ b/pyuic5.sh @@ -1,5 +1,5 @@ #!/bin/sh -@PYTHON3@ -c "import PyQt5" &> /dev/null +@PYTHON3@ -c "import PyQt5.uic.pyuic" &> /dev/null if [ $? -eq 0 ]; then exec @PYTHON3@ -m PyQt5.uic.pyuic ${1+"$@"} else