hsa-runtime: add ENABLE_LDCONFIG to support multi-version install
Depends-On: I58fdf1d0b4e864b5a61ffe8e335d430d424811ab Change-Id: I0cb6f8711ea5033e84b7e45ce20e7e23d84005c3 Signed-off-by: Cole Nelson <cole.nelson@amd.com>
This commit is contained in:
1 förälder
d5855c1658
incheckning
72fa4a17fa
5 files changed
+34
-16
No files matched your search
@@ -386,6 +386,7 @@ endif()
|
|||||||
|
|
||||||
## Packaging directives
|
## Packaging directives
|
||||||
set ( CPACK_GENERATOR "DEB;RPM" CACHE STRING "Package types to build")
|
set ( CPACK_GENERATOR "DEB;RPM" CACHE STRING "Package types to build")
|
||||||
|
set ( ENABLE_LDCONFIG ON CACHE BOOL "Set library links and caches using ldconfig.")
|
||||||
|
|
||||||
## Only pack the "binary" and "dev" components, post install script will add the directory link.
|
## Only pack the "binary" and "dev" components, post install script will add the directory link.
|
||||||
set (CPACK_DEB_COMPONENT_INSTALL ON)
|
set (CPACK_DEB_COMPONENT_INSTALL ON)
|
||||||
@@ -399,9 +400,9 @@ set ( CPACK_PACKAGE_CONTACT "TODO Advanced Micro Devices, Inc." )
|
|||||||
set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "AMD Heterogeneous System Architecture HSA - Linux HSA Runtime for Boltzmann (ROCm) platforms" )
|
set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "AMD Heterogeneous System Architecture HSA - Linux HSA Runtime for Boltzmann (ROCm) platforms" )
|
||||||
set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md" )
|
set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md" )
|
||||||
|
|
||||||
## Process the install scripts to update the CPACK variables
|
## Process the Debian install/remove scripts to update the CPACK variables
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/post_install DEBIAN/postinst @ONLY)
|
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst.in DEBIAN/postinst @ONLY )
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/pre_remove DEBIAN/prerm @ONLY)
|
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/prerm.in DEBIAN/prerm @ONLY )
|
||||||
|
|
||||||
if ( DEFINED ENV{ROCM_LIBPATCH_VERSION} )
|
if ( DEFINED ENV{ROCM_LIBPATCH_VERSION} )
|
||||||
set ( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.$ENV{ROCM_LIBPATCH_VERSION}" )
|
set ( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.$ENV{ROCM_LIBPATCH_VERSION}" )
|
||||||
@@ -452,8 +453,12 @@ set ( CPACK_RPM_PACKAGE_PROVIDES "hsa-ext-rocr-dev" )
|
|||||||
set ( CPACK_RPM_PACKAGE_OBSOLETES "hsa-ext-rocr-dev" )
|
set ( CPACK_RPM_PACKAGE_OBSOLETES "hsa-ext-rocr-dev" )
|
||||||
set ( CPACK_RPM_PACKAGE_CONFLICTS "hsa-ext-rocr-dev" )
|
set ( CPACK_RPM_PACKAGE_CONFLICTS "hsa-ext-rocr-dev" )
|
||||||
|
|
||||||
set ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/RPM/rpm_post" )
|
## Process the Rpm install/remove scripts to update the CPACK variables
|
||||||
set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/RPM/rpm_postun" )
|
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 packaging
|
## Include packaging
|
||||||
include ( CPack )
|
include ( CPack )
|
||||||
@@ -44,12 +44,16 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# left-hand term originates from @ENABLE_LDCONFIG@ = ON/OFF at package build
|
||||||
do_ldconfig() {
|
do_ldconfig() {
|
||||||
echo @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig
|
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
|
||||||
|
echo @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf
|
||||||
|
ldconfig
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
( configure )
|
||||||
do_ldconfig
|
do_ldconfig
|
||||||
# Workaround for CPACK directory symlink handling error.
|
# Workaround for CPACK directory symlink handling error.
|
||||||
mkdir -p @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/include
|
mkdir -p @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/include
|
||||||
@@ -58,7 +62,7 @@ case "$1" in
|
|||||||
abort-upgrade|abort-remove|abort-deconfigure)
|
abort-upgrade|abort-remove|abort-deconfigure)
|
||||||
echo "$1"
|
echo "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
( * )
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -44,20 +44,23 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# left-hand term originates from @ENABLE_LDCONFIG@ = ON/OFF at package build
|
||||||
rm_ldconfig() {
|
rm_ldconfig() {
|
||||||
rm -f /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig
|
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
|
||||||
|
rm -f /etc/ld.so.conf.d/hsa-rocr-dev.conf
|
||||||
|
ldconfig
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
remove)
|
( remove )
|
||||||
rm_ldconfig
|
rm_ldconfig
|
||||||
# Workaround for CPACK directory symlink handling error.
|
# Workaround for CPACK directory symlink handling error.
|
||||||
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/hsa
|
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/hsa
|
||||||
;;
|
;;
|
||||||
purge)
|
( purge )
|
||||||
;;
|
;;
|
||||||
*)
|
( * )
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -40,4 +40,8 @@
|
|||||||
##
|
##
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
echo /opt/rocm/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig
|
# left-hand term originates from @ENABLE_LDCONFIG@ = ON/OFF at package build
|
||||||
|
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
|
||||||
|
echo @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf
|
||||||
|
ldconfig
|
||||||
|
fi
|
||||||
@@ -40,6 +40,8 @@
|
|||||||
##
|
##
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
if [ $1 -eq 0 ]; then
|
# left-hand term originates from @ENABLE_LDCONFIG@ = ON/OFF at package build
|
||||||
rm -f /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig
|
if [ $1 -eq 0 ] && [ "@ENABLE_LDCONFIG@" == "ON" ]; then
|
||||||
|
rm -f /etc/ld.so.conf.d/hsa-rocr-dev.conf
|
||||||
|
ldconfig
|
||||||
fi
|
fi
|
||||||
Reference in new issue
Block a user