CMakeLists.txt: add ENABLE_LDCONFIG to support multi-version install

Depends-On: I58fdf1d0b4e864b5a61ffe8e335d430d424811ab
Change-Id: Ibf4d6446e00eb119d1ea88d81da144e63194f615
Signed-off-by: Cole Nelson <cole.nelson@amd.com>


[ROCm/rocprofiler commit: 35c1b8bff2]
Tento commit je obsažen v:
Cole Nelson
2021-03-24 14:56:52 -07:00
rodič 0282e30855
revize cd0100f98e
9 změnil soubory, kde provedl 65 přidání a 42 odebrání
+11 -3
Zobrazit soubor
@@ -179,6 +179,7 @@ install ( FILES ${PROJECT_BINARY_DIR}/rocprof-link DESTINATION bin
## Packaging directives
set ( CPACK_GENERATOR "DEB" "RPM" "TGZ" )
set ( ENABLE_LDCONFIG ON CACHE BOOL "Set library links and caches using ldconfig.")
set ( CPACK_PACKAGE_NAME "${ROCPROFILER_NAME}-dev" )
set ( CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc." )
set ( CPACK_PACKAGE_VERSION_MAJOR ${BUILD_VERSION_MAJOR} )
@@ -203,7 +204,10 @@ endif()
message ( "Using CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_DEBIAN_PACKAGE_RELEASE}" )
set ( CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT" )
set ( CPACK_DEBIAN_PACKAGE_DEPENDS "hsa-rocr-dev" )
set ( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst;${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/prerm" )
## Process the Debian install/remove scripts to update the CPACK variables
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst.in DEBIAN/postinst @ONLY )
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/prerm.in DEBIAN/prerm @ONLY )
set ( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "DEBIAN/postinst;DEBIAN/prerm" )
## RPM package specific variables
if ( DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE} )
@@ -225,7 +229,11 @@ if ( PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "" )
endif()
set ( CPACK_RPM_FILE_NAME "RPM-DEFAULT" )
set ( CPACK_RPM_PACKAGE_DEPENDS "hsa-rocr-dev" )
set ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/RPM/rpm_post" )
set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/RPM/rpm_postun" )
## Process the Rpm install/remove scripts to update the CPACK variables
configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/RPM/post.in" RPM/post @ONLY )
configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/RPM/postun.in" RPM/postun @ONLY )
set ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/RPM/post" )
set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/RPM/postun" )
include ( CPack )
-19
Zobrazit soubor
@@ -1,19 +0,0 @@
#/bin/bash
set -e
do_ldconfig() {
echo /opt/rocm/rocprofiler/lib > /etc/ld.so.conf.d/librocprofiler64.conf && ldconfig
}
case "$1" in
configure)
do_ldconfig
;;
abort-upgrade|abort-remove|abort-deconfigure)
echo "$1"
;;
*)
exit 0
;;
esac
+23
Zobrazit soubor
@@ -0,0 +1,23 @@
#!/bin/bash
set -e
do_ldconfig() {
# left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
echo @CPACK_PACKAGING_INSTALL_PREFIX@/rocprofiler/lib > /etc/ld.so.conf.d/librocprofiler64.conf
ldconfig
fi
}
case "$1" in
( configure )
do_ldconfig
;;
( abort-upgrade | abort-remove | abort-deconfigure )
echo "$1"
;;
( * )
exit 0
;;
esac
-18
Zobrazit soubor
@@ -1,18 +0,0 @@
#!/bin/bash
set -e
rm_ldconfig() {
rm -f /etc/ld.so.conf.d/librocprofiler64.conf && ldconfig
}
case "$1" in
remove)
rm_ldconfig
;;
purge)
;;
*)
exit 0
;;
esac
+22
Zobrazit soubor
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
rm_ldconfig() {
# left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
rm -f /etc/ld.so.conf.d/librocprofiler64.conf
ldconfig
fi
}
case "$1" in
( remove )
rm_ldconfig
;;
( purge )
;;
( * )
exit 0
;;
esac
+5
Zobrazit soubor
@@ -0,0 +1,5 @@
# left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
echo @CPACK_PACKAGING_INSTALL_PREFIX@/rocprofiler/lib > /etc/ld.so.conf.d/librocprofiler64.conf
ldconfig
fi
+4
Zobrazit soubor
@@ -0,0 +1,4 @@
# left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
rm -f /etc/ld.so.conf.d/librocprofiler64.conf && ldconfig
fi
-1
Zobrazit soubor
@@ -1 +0,0 @@
echo /opt/rocm/rocprofiler/lib > /etc/ld.so.conf.d/librocprofiler64.conf && ldconfig
-1
Zobrazit soubor
@@ -1 +0,0 @@
rm -f /etc/ld.so.conf.d/librocprofiler64.conf && ldconfig