From 04ff4295d9bb5f8f8a2e81d271d4e3e105303d2bba393b55f8bb1c9f3fafdf2c Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 13 Apr 2023 11:28:17 +0000 Subject: [PATCH] Accepting request 1079125 from home:gmbr3:Active - macros: Convert to GNUInstallDirs * some of the old values such as SYSCONF_INSTALL_PATH aren't used anymore * RUNSTATEDIR and SHAREDSTATEDIR weren't set and the defaults are different to us * SHAREDSTATEDIR isn't under /usr so isn't relative OBS-URL: https://build.opensuse.org/request/show/1079125 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=526 --- cmake.changes | 10 ++++++++++ cmake.macros | 19 +++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/cmake.changes b/cmake.changes index 186f5ce..1ef7f4c 100644 --- a/cmake.changes +++ b/cmake.changes @@ -4,6 +4,16 @@ Wed Apr 5 16:34:32 UTC 2023 - Andreas Stieger - update to 3.26.3: * Fixes for VS (Intel Fortran) and Xcode (Swift) +------------------------------------------------------------------- +Sat Apr 1 14:14:02 UTC 2023 - Callum Farmer + +- macros: Convert to GNUInstallDirs + * some of the old values such as SYSCONF_INSTALL_PATH aren't + used anymore + * RUNSTATEDIR and SHAREDSTATEDIR weren't set and the defaults + are different to us + * SHAREDSTATEDIR isn't under /usr so isn't relative + ------------------------------------------------------------------- Thu Mar 30 14:02:27 UTC 2023 - Paolo Stivanin diff --git a/cmake.macros b/cmake.macros index 3bf4da2..377d701 100644 --- a/cmake.macros +++ b/cmake.macros @@ -7,6 +7,9 @@ %__builder %__make %__sourcedir . +%__cmake_make_prefix_relative() %{lua:print((string.gsub((rpm.expand("%1")), ((rpm.expand("%{_prefix}")) .. "/"), "")))} +%__cmake_make_root_relative() %{lua:print((string.gsub((rpm.expand("%1")), "/", "")))} + %cmake \ find %__sourcedir -type f -name CMakeLists.txt \\\ -exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\\\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\\\)/{s/^/#IGNORE /}' {} + \ @@ -19,12 +22,16 @@ -GNinja \\\ %endif \ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ - -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ - -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ - -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ - -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \\\ - -DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \\\ + -DCMAKE_INSTALL_BINDIR:PATH=%{__cmake_make_prefix_relative %{_bindir}} \\\ + -DCMAKE_INSTALL_SBINDIR:PATH=%{__cmake_make_prefix_relative %{_sbindir}} \\\ + -DCMAKE_INSTALL_LIBEXECDIR:PATH=%{__cmake_make_prefix_relative %{_libexecdir}} \\\ + -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{__cmake_make_root_relative %{_sysconfdir}} \\\ + -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=%{_sharedstatedir} \\\ + -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{__cmake_make_root_relative %{_localstatedir}} \\\ + -DCMAKE_INSTALL_RUNSTATEDIR:PATH=%{__cmake_make_root_relative %{_rundir}} \\\ + -DCMAKE_INSTALL_LIBDIR:PATH=%{__cmake_make_prefix_relative %{_libdir}} \\\ + -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{__cmake_make_prefix_relative %{_includedir}} \\\ + -DCMAKE_INSTALL_DATAROOTDIR:PATH=%{__cmake_make_prefix_relative %{_datadir}} \\\ -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\ -DCMAKE_C_FLAGS="${CFLAGS:-%optflags}" \\\ -DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags}" \\\