diff --git a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt index 2aa3f1788d..04ea8c3d9d 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt @@ -206,6 +206,10 @@ set ( CPACK_PACKAGE_CONTACT "Advanced Micro Devices Inc." ) 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" ) +## Process the install scripts to update the CPACK variables +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/post_install ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/pre_remove ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/prerm @ONLY) + # Debian package specific variables set ( CPACK_DEBIAN_PACKAGE_DEPENDS "hsakmt-roct" ) set ( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/RadeonOpenCompute/ROCR-Runtime" ) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/postinst b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/post_install similarity index 52% rename from projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/postinst rename to projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/post_install index 4a28ba94f3..295922dcfc 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/postinst +++ b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/post_install @@ -3,14 +3,13 @@ set -e do_ldconfig() { - echo /opt/rocm/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig + echo @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig } case "$1" in configure) do_ldconfig - mkdir -p /opt/rocm/include - ln -s ../hsa/include/hsa /opt/rocm/include/hsa + ln -sf ../hsa/include/hsa @CPACK_PACKAGING_INSTALL_PREFIX@/include/hsa ;; abort-upgrade|abort-remove|abort-deconfigure) echo "$1" diff --git a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/prerm b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/pre_remove similarity index 76% rename from projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/prerm rename to projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/pre_remove index 23c416a055..2dd27fdc36 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/prerm +++ b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/pre_remove @@ -9,7 +9,7 @@ rm_ldconfig() { case "$1" in remove) rm_ldconfig - rm /opt/rocm/include/hsa + rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/include/hsa ;; purge) ;;