[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 09:37:08 UTC 2023
> CMake sets the current working directory to the respective build directory automatically
Yes default directory is current directory however I see why it was working in case fedora build
```spec
%build
%set_build_flags
mkdir _build
cd _build
cmake \
-DCMAKE_INSTALL_PREFIX=%{_usr} \
-DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=%{_var}/lib \
%{?with_bdb_ro:-DENABLE_BDB_RO=ON} \
%{!?with_ndb:-DENABLE_NDB=OFF} \
%{!?with_sqlite:-DENABLE_SQLITE=OFF} \
%{!?with_plugins:-DENABLE_PLUGINS=OFF} \
%{?with_fsverity:-DWITH_FSVERITY=ON} \
%{?with_libimaevm:-DWITH_IMAEVM=ON} \
%{!?with_libarchive:-DWITH_ARCHIVE=OFF} \
%{!?with_check:-DENABLE_TESTSUITE=OFF} \
%{!?with_sequoia:-DWITH_INTERNAL_OPENPGP=ON} \
%{!?with_sequoia:-DWITH_OPENSSL=ON } \
-DRPM_VENDOR=redhat \
..
```
So in this case current direcrtry is changed before cmake execution and indeed CMAKE_BINARY_DIR"." however CMAKE_SOURCE_DIR="..".
I'm using %cmake macro so it uses `-B <build_dir>` and ${CMAKE_BINARY_DIR} is no longer current direcrory.
With my patch it will be working in both cases.
It is clearly possible to see that those three files are generated and land in ${CMAKE_BINARY_DIR}.
```console
[tkloczko at pers-jacek rpm-4.18.99]$ ls -la x86_64-redhat-linux-gnu/
total 984
drwxr-xr-x 1 tkloczko tkloczko 828 Sep 8 09:23 .
drwxr-xr-x 1 tkloczko tkloczko 966 Sep 8 09:23 ..
-rw-r--r-- 1 tkloczko tkloczko 53053 Sep 8 09:23 CMakeCache.txt
-rw-r--r-- 1 tkloczko tkloczko 15038 Sep 8 09:23 CMakeDoxyfile.in
-rw-r--r-- 1 tkloczko tkloczko 20955 Sep 8 09:23 CMakeDoxygenDefaults.cmake
drwxr-xr-x 1 tkloczko tkloczko 914 Sep 8 09:23 CMakeFiles
-rw-r--r-- 1 tkloczko tkloczko 39153 Sep 8 09:23 Makefile
drwxr-xr-x 1 tkloczko tkloczko 18 Sep 8 09:23 Testing
drwxr-xr-x 1 tkloczko tkloczko 178 Sep 8 09:23 build
-rw-r--r-- 1 tkloczko tkloczko 26756 Sep 8 09:23 cmake_install.cmake
-rw-r--r-- 1 tkloczko tkloczko 3147 Sep 8 09:23 config.h
drwxr-xr-x 1 tkloczko tkloczko 142 Sep 8 09:23 docs
-rwxr-xr-x 1 tkloczko tkloczko 49160 Sep 8 09:23 elfdeps
drwxr-xr-x 1 tkloczko tkloczko 74 Sep 8 09:23 fileattrs
drwxr-xr-x 1 tkloczko tkloczko 6 Sep 8 09:23 include
-rw-r--r-- 1 tkloczko tkloczko 6151 Sep 8 09:23 install_manifest.txt
drwxr-xr-x 1 tkloczko tkloczko 164 Sep 8 09:23 lib
-rw-r--r-- 1 tkloczko tkloczko 45607 Sep 8 09:23 macros <<<=== HERE
drwxr-xr-x 1 tkloczko tkloczko 74 Sep 8 09:23 misc
-rw-r--r-- 1 tkloczko tkloczko 2948 Sep 8 09:23 platform <<<=== HERE
drwxr-xr-x 1 tkloczko tkloczko 278 Sep 8 09:23 plugins
drwxr-xr-x 1 tkloczko tkloczko 1040 Sep 8 09:23 po
drwxr-xr-x 1 tkloczko tkloczko 140 Sep 8 09:23 python
-rwxr-xr-x 1 tkloczko tkloczko 59704 Sep 8 09:23 rpm
-rw-r--r-- 1 tkloczko tkloczko 3681 Sep 8 09:23 rpm-config-version.cmake
-rw-r--r-- 1 tkloczko tkloczko 1329 Sep 8 09:23 rpm-config.cmake
-rw-r--r-- 1 tkloczko tkloczko 4374 Sep 8 09:23 rpm-targets.cmake
-rw-r--r-- 1 tkloczko tkloczko 284 Sep 8 09:23 rpm.pc
-rwxr-xr-x 1 tkloczko tkloczko 55864 Sep 8 09:23 rpm2archive
-rwxr-xr-x 1 tkloczko tkloczko 43384 Sep 8 09:23 rpm2cpio
-rwxr-xr-x 1 tkloczko tkloczko 80584 Sep 8 09:23 rpmbuild
-rwxr-xr-x 1 tkloczko tkloczko 49336 Sep 8 09:23 rpmdb
-rwxr-xr-x 1 tkloczko tkloczko 41048 Sep 8 09:23 rpmdeps
-rwxr-xr-x 1 tkloczko tkloczko 47976 Sep 8 09:23 rpmgraph
drwxr-xr-x 1 tkloczko tkloczko 160 Sep 8 09:23 rpmio
-rwxr-xr-x 1 tkloczko tkloczko 42616 Sep 8 09:23 rpmkeys
-rwxr-xr-x 1 tkloczko tkloczko 32608 Sep 8 09:23 rpmlua
-rw-r--r-- 1 tkloczko tkloczko 11817 Sep 8 09:23 rpmpopt-4.18.99
lrwxrwxrwx 1 tkloczko tkloczko 3 Sep 8 09:23 rpmquery -> rpm
-rw-r--r-- 1 tkloczko tkloczko 18607 Sep 8 09:23 rpmrc <<<=== HERE
-rwxr-xr-x 1 tkloczko tkloczko 51784 Sep 8 09:23 rpmsign
-rwxr-xr-x 1 tkloczko tkloczko 38200 Sep 8 09:23 rpmsort
-rwxr-xr-x 1 tkloczko tkloczko 50448 Sep 8 09:23 rpmspec
-rwxr-xr-x 1 tkloczko tkloczko 40968 Sep 8 09:23 rpmuncompress
lrwxrwxrwx 1 tkloczko tkloczko 3 Sep 8 09:23 rpmverify -> rpm
drwxr-xr-x 1 tkloczko tkloczko 74 Sep 8 09:23 scripts
drwxr-xr-x 1 tkloczko tkloczko 172 Sep 8 09:23 sign
drwxr-xr-x 1 tkloczko tkloczko 74 Sep 8 09:23 tests
```
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2651#issuecomment-1711374792
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/2651/c1711374792 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230908/36e08590/attachment-0001.html>
More information about the Rpm-maint
mailing list