[Rpm-maint] [rpm-software-management/rpm] fix install rpmrc, platform and macros files with off-source-tree build (PR #2651)

Tomasz Kłoczko notifications at github.com
Fri Sep 8 12:07:10 UTC 2023


In my case cmake source definition of rpm macros looks like below:
```spec
#
# Macros for cmake
#
%_cmake_skip_rpath      -D CMAKE_SKIP_RPATH=ON
%__cmake                /usr/bin/cmake
%__ctest                /usr/bin/ctest
%_vpath_srcdir          .

# - Set default compile flags
# - CMAKE_*_FLAGS_RELEASE are added *after* the *FLAGS environment variables
# and default to -O3 -DNDEBUG.  Strip the -O3 so we can override with *FLAGS
# - Turn on verbose makefiles so we can see and verify compile flags
# - Set default install prefixes and library install directories
# - Turn on shared libraries by default
%cmake %{set_build_flags} \
        %__cmake \\\
        -B %{_vpath_builddir} \\\
        -D BUILD_SHARED_LIBS=ON \\\
        -D CMAKE_AR="$AR" \\\
        -D CMAKE_BUILD_TYPE=RelWithDebInfo \\\
        -D CMAKE_C_FLAGS_RELEASE="-DNDEBUG" \\\
        -D CMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \\\
        -D CMAKE_Fortran_FLAGS_RELEASE="-DNDEBUG" \\\
        -D CMAKE_INSTALL_PREFIX=%{_prefix} \\\
        -D CMAKE_NM="$NM" \\\
        -D CMAKE_RANLIB="$RANLIB" \\\
        -D CMAKE_VERBOSE_MAKEFILE=ON \\\
        -D INCLUDE_INSTALL_DIR=%{_includedir} \\\
        -D LIB_INSTALL_DIR=%{_libdir} \\\
%if "%{?_lib}" == "lib64" \
        -D LIB_SUFFIX=64 \\\
%endif \
        -D SHARE_INSTALL_PREFIX=%{_datadir} \\\
        -D SYSCONF_INSTALL_DIR=%{_sysconfdir} \\\
        -S %{_vpath_srcdir}

%cmake_build \
        %__cmake --build %{_vpath_builddir} %{?_smp_mflags} --verbose

%cmake_install \
        DESTDIR=%{buildroot} %__cmake --install %{_vpath_builddir}

%ctest  %__ctest --test-dir %{_vpath_builddir} --output-on-failure --force-new-ctest-process %{?_smp_mflags} \\\
```
So as you se I'm passing -S and -B paths explicit ..

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2651#issuecomment-1711566891
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2651/c1711566891 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230908/e6c82f30/attachment-0001.html>


More information about the Rpm-maint mailing list