From e00f462610c8d0b1798a79ebbab7bc7561b42d2b Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Tue, 31 Oct 2023 09:45:58 +0100
Subject: [PATCH] The installed cmake files are now generated and contain
architecture dependent information. Installing them in datadir (/usr/share)
now results in conflicts if packages for more than one architecture is
installed in parallel. Move the installed cmake files to libdir
(/usr/lib(64)?, /usr/lib/<architecture>).
Found by Debian's MultiArch hinter.
---
CMakeLists.txt | 4 ++--
packaging/debian/libxrootd-dev.install | 2 +-
packaging/rhel/xrootd.spec.in | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 36a7f62b5..438ff5666 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,7 +68,7 @@ configure_package_config_file(cmake/${PROJECT_NAME}Config.cmake.in cmake/${PROJE
INSTALL_PREFIX
${CMAKE_INSTALL_PREFIX}
INSTALL_DESTINATION
- ${CMAKE_INSTALL_DATADIR}/xrootd/cmake
+ ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
PATH_VARS
CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_LIBDIR
@@ -76,7 +76,7 @@ configure_package_config_file(cmake/${PROJECT_NAME}Config.cmake.in cmake/${PROJE
)
install(DIRECTORY ${PROJECT_BINARY_DIR}/cmake/
- DESTINATION ${CMAKE_INSTALL_DATADIR}/xrootd/cmake)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
#-------------------------------------------------------------------------------
# Configure an 'uninstall' target
diff --git a/packaging/debian/libxrootd-dev.install b/packaging/debian/libxrootd-dev.install
index c92412235..e6ffeaa6b 100644
--- a/packaging/debian/libxrootd-dev.install
+++ b/packaging/debian/libxrootd-dev.install
@@ -13,4 +13,4 @@ usr/lib/*/libXrdCrypto.so
usr/lib/*/libXrdCryptoLite.so
usr/lib/*/libXrdUtils.so
usr/lib/*/libXrdXml.so
-usr/share/xrootd/cmake/XRootDConfig.cmake
+usr/lib/*/cmake/XRootD
diff --git a/packaging/rhel/xrootd.spec.in b/packaging/rhel/xrootd.spec.in
index 449de06a3..4a6af8f18 100644
--- a/packaging/rhel/xrootd.spec.in
+++ b/packaging/rhel/xrootd.spec.in
@@ -919,7 +919,7 @@ fi
%{_libdir}/libXrdUtils.so
%{_libdir}/libXrdXml.so
%{_includedir}/xrootd/XrdXml/XrdXmlReader.hh
-%{_datadir}/xrootd/cmake
+%{_libdir}/cmake/XRootD
%files client-libs
%defattr(-,root,root,-)
--
2.41.0