From 0ace0b2f0dd03ca5e0798491dd5b9624f34b0633 Mon Sep 17 00:00:00 2001 From: Ranjith Ramakrishnan Date: Wed, 1 Jun 2022 10:28:47 -0700 Subject: [PATCH] : Use GNUInstallDirs Use GNUInstallDirs variables in post install scripts License file installed in CMAKE_INSTALL_DOCDIR Change-Id: I182ca292e03787a6c189e8de31d32244b65b5687 [ROCm/ROCR-Runtime commit: 707200e26e0af1ad9f7b9102e77d8d9b066f4d0a] --- projects/rocr-runtime/CMakeLists.txt | 2 +- projects/rocr-runtime/DEBIAN/postinst.in | 2 +- projects/rocr-runtime/DEBIAN/prerm.in | 2 +- projects/rocr-runtime/RPM/post.in | 2 +- projects/rocr-runtime/RPM/postun.in | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/rocr-runtime/CMakeLists.txt b/projects/rocr-runtime/CMakeLists.txt index 195266b2ff..113b83c720 100644 --- a/projects/rocr-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/CMakeLists.txt @@ -290,7 +290,7 @@ set(CPACK_COMPONENT_DESCRIPTION "HSAKMT development package.\n This package incl set ( ENABLE_LDCONFIG ON CACHE BOOL "Set library links and caches using ldconfig.") # Install License file -install ( FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}/${CPACK_PACKAGE_NAME} COMPONENT devel) +install ( FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT devel) # Make proper version for appending # Default Value is 99999, setting it first diff --git a/projects/rocr-runtime/DEBIAN/postinst.in b/projects/rocr-runtime/DEBIAN/postinst.in index 04198dc7bb..e8a7917d40 100755 --- a/projects/rocr-runtime/DEBIAN/postinst.in +++ b/projects/rocr-runtime/DEBIAN/postinst.in @@ -5,7 +5,7 @@ set -e # left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build do_ldconfig() { if [ "@ENABLE_LDCONFIG@" == "ON" ]; then - echo @CPACK_PACKAGING_INSTALL_PREFIX@/lib > /etc/ld.so.conf.d/x86_64-libhsakmt.conf + echo @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/x86_64-libhsakmt.conf ldconfig fi } diff --git a/projects/rocr-runtime/DEBIAN/prerm.in b/projects/rocr-runtime/DEBIAN/prerm.in index f16a1ab3b7..329420ca88 100755 --- a/projects/rocr-runtime/DEBIAN/prerm.in +++ b/projects/rocr-runtime/DEBIAN/prerm.in @@ -5,7 +5,7 @@ set -e # left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build rm_ldconfig() { if [ "@ENABLE_LDCONFIG@" == "ON" ]; then - rm -f /etc/ld.so.conf.d/x86_64-libhsakmt.conf && ldconfig + rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/x86_64-libhsakmt.conf && ldconfig fi } diff --git a/projects/rocr-runtime/RPM/post.in b/projects/rocr-runtime/RPM/post.in index 5fc16b48a2..4a723b3761 100644 --- a/projects/rocr-runtime/RPM/post.in +++ b/projects/rocr-runtime/RPM/post.in @@ -1,5 +1,5 @@ # left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build if [ "@ENABLE_LDCONFIG@" == "ON" ]; then - echo -e "@CPACK_PACKAGING_INSTALL_PREFIX@/lib\n@CPACK_PACKAGING_INSTALL_PREFIX@/lib64" > /etc/ld.so.conf.d/x86_64-libhsakmt.conf + echo -e "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@" > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/x86_64-libhsakmt.conf ldconfig fi diff --git a/projects/rocr-runtime/RPM/postun.in b/projects/rocr-runtime/RPM/postun.in index 0691ac8617..b321d76fa4 100644 --- a/projects/rocr-runtime/RPM/postun.in +++ b/projects/rocr-runtime/RPM/postun.in @@ -1,6 +1,6 @@ # second term originates from ENABLE_LDCONFIG = ON/OFF at package build if [ $1 -le 1 ] && [ "@ENABLE_LDCONFIG@" == "ON" ]; then # perform the below actions for rpm remove($1=0) or upgrade($1=1) operations - rm -f /etc/ld.so.conf.d/x86_64-libhsakmt.conf + rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/x86_64-libhsakmt.conf ldconfig fi