diff --git a/cmake/CPackOptions.cmake.in b/cmake/CPackOptions.cmake.in index 7654ae58..1d24ed67 100644 --- a/cmake/CPackOptions.cmake.in +++ b/cmake/CPackOptions.cmake.in @@ -24,13 +24,16 @@ set (CPACK_SET_DESTDIR "OFF") set (CPACK_PACKAGE_RELOCATABLE "true") if (${CPACK_GENERATOR} STREQUAL "RPM") - set(CPACK_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") - set(CPACK_PACKAGING_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") + set (CPACK_RPM_PACKAGE_REQUIRES "root >= 6.14.08") + set (CPACK_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") + set (CPACK_PACKAGING_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") set (CPACK_RPM_FILE_NAME "RPM-DEFAULT") set (CPACK_RPM_PACKAGE_RELEASE "1") set (CPACK_RPM_PACKAGE_LICENSE "GPLv2") set (CPACK_RPM_PACKAGE_VENDOR "Paul Scherrer Institute - LMU - LEM") set (CPACK_RPM_CHANGELOG_FILE "@PROJECT_SOURCE_DIR@/cmake/ChangeLogRPM") + set (CPACK_RPM_POST_INSTALL_SCRIPT_FILE "@PROJECT_SOURCE_DIR@/cmake/post_install.sh") + set (CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "@PROJECT_SOURCE_DIR@/cmake/post_uninstall.sh") endif () if (${CPACK_GENERATOR} STREQUAL "DEB") diff --git a/cmake/post_install.sh b/cmake/post_install.sh new file mode 100644 index 00000000..3763661a --- /dev/null +++ b/cmake/post_install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +echo ">> musrfit post install script started ..." + +# test if nemu-x86_64.conf does not exist +if [ ! -f "/etc/ld.so.conf.d/nemu-x86_64.conf" ] +then + echo "/usr/local/lib" >> /etc/ld.so.conf.d/nemu-x86_64.conf + echo "/usr/local/lib64" >> /etc/ld.so.conf.d/nemu-x86_64.conf +fi +/sbin/ldconfig + +echo ">> musrfit post install script done." + diff --git a/cmake/post_uninstall.sh b/cmake/post_uninstall.sh new file mode 100644 index 00000000..51390702 --- /dev/null +++ b/cmake/post_uninstall.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +echo ">> musrfit post uninstall script started ..." + +# test if nemu-x86_64.conf does not exist +if [ -f "/etc/ld.so.conf.d/nemu-x86_64.conf" ] +then + rm -f /etc/ld.so.conf.d/nemu-x86_64.conf +fi +/sbin/ldconfig + +echo ">> musrfit post uninstall script done." +