SHA256
3
0
forked from pool/cmake

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
This commit is contained in:
Dirk Mueller 2023-04-13 11:28:17 +00:00 committed by Git OBS Bridge
parent 8fe9dae4df
commit 04ff4295d9
2 changed files with 23 additions and 6 deletions

View File

@ -4,6 +4,16 @@ Wed Apr 5 16:34:32 UTC 2023 - Andreas Stieger <andreas.stieger@gmx.de>
- update to 3.26.3:
* Fixes for VS (Intel Fortran) and Xcode (Swift)
-------------------------------------------------------------------
Sat Apr 1 14:14:02 UTC 2023 - Callum Farmer <gmbr3@opensuse.org>
- 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 <info@paolostivanin.com>

View File

@ -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}" \\\