From 067bf458dc541f33e33e3ed53e22041997f6122f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 15 Sep 2017 21:38:32 +0200 Subject: [PATCH] Automatic lookup of python for .spec file (RPM) --- scripts/rpm-data/klayout.spec | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/scripts/rpm-data/klayout.spec b/scripts/rpm-data/klayout.spec index 3670b6583..7d4417a8e 100644 --- a/scripts/rpm-data/klayout.spec +++ b/scripts/rpm-data/klayout.spec @@ -36,6 +36,7 @@ AutoReqProv: no Requires: ruby >= 2.0.0 Requires: python >= 2.7.5 Requires: qt >= 4.8.5 +Requires: qt-x11 >= 4.8.5 %endif %if "%{target_system}" == "centos6" @@ -71,13 +72,29 @@ For details see README.md TARGET="linux-release" -QMAKE=qmake-does-not-exist -if which qmake; then - QMAKE=qmake +QMAKE=qmake +if which qmake-qt5; then + QMAKE=qmake-qt5 elif which qmake-qt4; then QMAKE=qmake-qt4 -elif which qmake-qt5; then - QMAKE=qmake-qt5 +elif which qmake; then + QMAKE=qmake +fi + +PYTHON=python +if which python3; then + PYTHON=python3 +elif which python2; then + PYTHON=python2 +elif which python; then + PYTHON=python +fi + +RUBY=ruby +if which ruby2; then + RUBY=ruby2 +elif which ruby; then + RUBY=ruby fi # TODO: remove -without-qtbinding @@ -92,6 +109,8 @@ cd %{_sourcedir} -build %{_builddir}/build.$TARGET \ -j4 \ -qmake $QMAKE \ + -ruby $RUBY \ + -python $PYTHON \ -without-qtbinding cp -p LICENSE Changelog CONTRIB %{_builddir}