From e64f07eb0ba6b9c4c313ac1c175b0f5f1642e40c Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 21 Aug 2018 14:19:42 -0400 Subject: [PATCH] rpm-macros: always refer to binaries in their installed location Even if %_libdir and %_bindir are redefined to, for example, when building Flatpaks, /app/lib64 and /app/bin, we still want to look for qmake and qmake-qt5.sh in their installed locations. --- macros.qt5 | 4 ++-- qt5.spec | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/macros.qt5 b/macros.qt5 index cf64309..ab4a483 100644 --- a/macros.qt5 +++ b/macros.qt5 @@ -11,7 +11,7 @@ %_qt5_libexecdir %{_qt5_archdatadir}/libexec %_qt5_plugindir %{_qt5_archdatadir}/plugins %_qt5_qmldir %{_qt5_archdatadir}/qml -%_qt5_qmake %{_qt5_bindir}/qmake +%_qt5_qmake @@QMAKE@@ %_qt5_settingsdir %{_sysconfdir}/xdg %_qt5_sysconfdir %{_qt5_settingsdir} %_qt5_translationdir %{_datadir}/qt5/translations @@ -32,4 +32,4 @@ %qmake_qt5 %{_qt5_qmake} %{?_qt5_qmake_flags} -%qmake_qt5_wrapper %{_bindir}/qmake-qt5.sh +%qmake_qt5_wrapper @@QMAKE_QT5_WRAPPER@@ diff --git a/qt5.spec b/qt5.spec index 85d953e..2d755f5 100644 --- a/qt5.spec +++ b/qt5.spec @@ -1,7 +1,7 @@ Name: qt5 Version: 5.11.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Qt5 meta package License: GPLv3 URL: https://getfedora.org/ @@ -103,12 +103,17 @@ mkdir -p %{buildroot}%{_datadir}/qt5/wrappers ln -s %{_bindir}/qmake-qt5.sh %{buildroot}%{_datadir}/qt5/wrappers/qmake-qt5 ln -s %{_bindir}/qmake-qt5.sh %{buildroot}%{_datadir}/qt5/wrappers/qmake -# substitute custom flags +# substitute custom flags, and the path to binaries: binaries referenced from +# macros should not change if an application is built with a different prefix. +# %_libdir is left as /usr/%{_lib} (e.g.) so that the resulting macros are +# architecture independent, and don't hardcode /usr/lib or /usr/lib64. sed -i \ -e "s|@@QT5_CFLAGS@@|%{?qt5_cflags}|g" \ -e "s|@@QT5_CXXFLAGS@@|%{?qt5_cxxflags}|g" \ -e "s|@@QT5_RPM_LD_FLAGS@@|%{?qt5_rpm_ld_flags}|g" \ -e "s|@@QT5_RPM_OPT_FLAGS@@|%{?qt5_rpm_opt_flags}|g" \ + -e "s|@@QMAKE@@|%{_prefix}/%%{_lib}/qt5/bin/qmake|g" \ + -e "s|@@QMAKE_QT5_WRAPPER@@|%{_bindir}/qmake-qt5.sh|g" \ %{buildroot}%{_rpmconfigdir}/macros.d/macros.qt5 mkdir -p %{buildroot}%{_docdir}/qt5 @@ -132,6 +137,10 @@ echo "- Qt5 devel meta package" > %{buildroot}%{_docdir}/qt5-devel/README %changelog +* Tue Aug 21 2018 Owen Taylor - 5.11.1-4 +- rpm-macros: always refer to binaries in their installed location, even if %%_libdir + and %%_bindir are redefined. + * Sat Jul 14 2018 Fedora Release Engineering - 5.11.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild