2021-03-24 15:25:00 -07:00
|
|
|
#!/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/x86_64-librocm_smi_lib.conf
|
|
|
|
|
ldconfig
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-23 10:28:48 -04:00
|
|
|
rm_pyc() {
|
|
|
|
|
# remove pyc file generated by python
|
2022-06-03 12:03:27 -07:00
|
|
|
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/rocm_smi/__pycache__
|
2022-03-23 10:28:48 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-24 15:25:00 -07:00
|
|
|
case "$1" in
|
2022-02-24 09:59:02 -05:00
|
|
|
( remove | upgrade)
|
2021-03-24 15:25:00 -07:00
|
|
|
rm_ldconfig
|
2022-03-23 10:28:48 -04:00
|
|
|
rm_pyc
|
2021-03-24 15:25:00 -07:00
|
|
|
;;
|
|
|
|
|
( purge )
|
|
|
|
|
;;
|
|
|
|
|
( * )
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
esac
|