diff --git a/opencl/packaging/rocm-opencl.postinst b/opencl/packaging/rocm-opencl.postinst index 634a4968eb..337ceaa9de 100644 --- a/opencl/packaging/rocm-opencl.postinst +++ b/opencl/packaging/rocm-opencl.postinst @@ -2,8 +2,11 @@ set -e +INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@ do_ldconfig() { + echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig + mkdir -p /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors && (echo libamdocl64.so > /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@) } diff --git a/opencl/packaging/rocm-opencl.prerm b/opencl/packaging/rocm-opencl.prerm index 5e5313f2d8..4843048571 100644 --- a/opencl/packaging/rocm-opencl.prerm +++ b/opencl/packaging/rocm-opencl.prerm @@ -3,6 +3,7 @@ set -e rm_ldconfig() { + rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@ } diff --git a/opencl/packaging/rocm-opencl.rpm_post b/opencl/packaging/rocm-opencl.rpm_post index 1aff10f165..b467f63ba8 100644 --- a/opencl/packaging/rocm-opencl.rpm_post +++ b/opencl/packaging/rocm-opencl.rpm_post @@ -1 +1,4 @@ +INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@ + +echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig mkdir -p /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors && (echo libamdocl64.so > /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@) diff --git a/opencl/packaging/rocm-opencl.rpm_postun b/opencl/packaging/rocm-opencl.rpm_postun index 4560615305..f3655dfe90 100644 --- a/opencl/packaging/rocm-opencl.rpm_postun +++ b/opencl/packaging/rocm-opencl.rpm_postun @@ -1,3 +1,7 @@ +if [ $1 -eq 0 ]; then + # Remove rocm-opencl.conf during remove/uninstall operation + rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig +fi # Remove icd file for uninstall and upgrade operation rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@