From c0534c4a68ed421abbda357d98d7f687009751dd Mon Sep 17 00:00:00 2001 From: Sarang Joshi Date: Fri, 21 Feb 2020 16:53:23 -0800 Subject: CPackRPM: Add PRE_/POST_TRANS scripts Add variables for PRE_TRANS and POST_TRANS scripts. Fixes: #18917 --- .../CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake | 4 ++-- Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'Tests/RunCMake/CPack') diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake index d7d82f27d6..1a1e983737 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake @@ -25,5 +25,5 @@ function(checkScripts_ FILE COMPARE_LIST) endforeach() endfunction() -checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\"") -checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\"") +checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\";echo \"pre trans foo\";echo \"post trans foo\"") +checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\";echo \"pre trans\";echo \"post trans\"") diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake index fb1b8de686..c200fa502c 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake @@ -7,6 +7,10 @@ if(GENERATOR_TYPE STREQUAL "RPM") "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh") set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh") + set(CPACK_RPM_PRE_TRANS_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/pre_trans.sh") + set(CPACK_RPM_POST_TRANS_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/post_trans.sh") set(CPACK_RPM_foo_PRE_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh") @@ -16,6 +20,10 @@ if(GENERATOR_TYPE STREQUAL "RPM") "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh") set(CPACK_RPM_foo_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh") + set(CPACK_RPM_foo_PRE_TRANS_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/pre_trans_foo.sh") + set(CPACK_RPM_foo_POST_TRANS_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/post_trans_foo.sh") endif() set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) @@ -29,6 +37,10 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh" "echo \"pre uninstall\"\n") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh" "echo \"post uninstall\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_trans.sh" + "echo \"pre trans\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_trans.sh" + "echo \"post trans\"\n") # specific file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh" @@ -39,6 +51,10 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh" "echo \"pre uninstall foo\"\n") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh" "echo \"post uninstall foo\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_trans_foo.sh" + "echo \"pre trans foo\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_trans_foo.sh" + "echo \"post trans foo\"\n") install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo) install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar) -- cgit v1.2.1