diff --git a/DEBIAN/control b/DEBIAN/control new file mode 100644 index 0000000000..9b5ef4e5d6 --- /dev/null +++ b/DEBIAN/control @@ -0,0 +1,9 @@ +Package: rocm_smi_lib +Architecture: amd64 +Maintainer: Advanced Micro Devices Inc. +Priority: optional +Version: MODULE_VERSION +Depends: +Homepage: https://github.com/RadeonOpenCompute/rocm_smi_lib +Description: System Management Interface Library for ROCm + diff --git a/DEBIAN/postinst b/DEBIAN/postinst new file mode 100755 index 0000000000..530d0f5d79 --- /dev/null +++ b/DEBIAN/postinst @@ -0,0 +1,19 @@ +#/bin/bash + +set -e + +do_ldconfig() { + echo /opt/rocm/lib > /etc/ld.so.conf.d/x86_64-librocm_smi_lib.conf && ldconfig +} + +case "$1" in + configure) + do_ldconfig + ;; + abort-upgrade|abort-remove|abort-deconfigure) + echo "$1" + ;; + *) + exit 0 + ;; +esac diff --git a/DEBIAN/prerm b/DEBIAN/prerm new file mode 100755 index 0000000000..9b38307ae0 --- /dev/null +++ b/DEBIAN/prerm @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +rm_ldconfig() { + rm -f /etc/ld.so.conf.d/x86_64-librocm_smi_lib.conf && ldconfig +} + +case "$1" in + remove) + rm_ldconfig + ;; + purge) + ;; + *) + exit 0 + ;; +esac + diff --git a/DEBIAN/x86_64-librocm_smi_lib.conf b/DEBIAN/x86_64-librocm_smi_lib.conf new file mode 100644 index 0000000000..a4551d4820 --- /dev/null +++ b/DEBIAN/x86_64-librocm_smi_lib.conf @@ -0,0 +1 @@ +/opt/rocm/lib diff --git a/RPM/rpm_post b/RPM/rpm_post new file mode 100755 index 0000000000..e98d87941f --- /dev/null +++ b/RPM/rpm_post @@ -0,0 +1 @@ +echo -e "/opt/rocm/lib\n/opt/rocm/lib64" > /etc/ld.so.conf.d/x86_64-librocm_smi_lib.conf && ldconfig diff --git a/RPM/rpm_postun b/RPM/rpm_postun new file mode 100755 index 0000000000..80a0da7b5d --- /dev/null +++ b/RPM/rpm_postun @@ -0,0 +1,3 @@ +if [ $1 -eq 0 ]; then + rm -f /etc/ld.so.conf.d/x86_64-librocm_smi_lib.conf && ldconfig +fi