From 66ad40972a3b2456abf0c9a94639c04254b0730c Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Fri, 10 Feb 2023 09:08:07 +0530 Subject: [PATCH] SWDEV-371122 - Package name corrected for hip-catch-amd (#160) Change-Id: I8ca14f50761e8f332bc0ca096594e241077f4715 --- catch/CMakeLists.txt | 6 ++++++ catch/packaging/hip-tests.txt | 23 ++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/catch/CMakeLists.txt b/catch/CMakeLists.txt index f00a74295..03e018bbb 100644 --- a/catch/CMakeLists.txt +++ b/catch/CMakeLists.txt @@ -76,6 +76,12 @@ list(GET VERSION_LIST 2 HIP_VERSION_PATCH_GITHASH) string(REPLACE "-" ";" VERSION_LIST ${HIP_VERSION_PATCH_GITHASH}) list(GET VERSION_LIST 0 HIP_VERSION_PATCH) +if(DEFINED ENV{ROCM_LIBPATCH_VERSION}) + set(HIP_PACKAGING_VERSION_PATCH ${HIP_VERSION_PATCH}.$ENV{ROCM_LIBPATCH_VERSION}) +else() + set(HIP_PACKAGING_VERSION_PATCH ${HIP_VERSION_PATCH}-${HIP_VERSION_GITHASH}) +endif() + if(NOT DEFINED CATCH2_PATH) if(DEFINED ENV{CATCH2_PATH}) set(CATCH2_PATH $ENV{CATCH2_PATH} CACHE STRING "Catch2 Path") diff --git a/catch/packaging/hip-tests.txt b/catch/packaging/hip-tests.txt index b058fd30e..1c74ff4d2 100644 --- a/catch/packaging/hip-tests.txt +++ b/catch/packaging/hip-tests.txt @@ -76,7 +76,7 @@ set(CPACK_PACKAGE_DESCRIPTION "HIP: Heterogenous-computing Interface for Portability [CATCH TESTS]") set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc.") set(CPACK_PACKAGE_CONTACT "HIP Support ") -set(CPACK_PACKAGE_VERSION @HIP_VERSION_MAJOR@.@HIP_VERSION_MINOR@.@HIP_VERSION_PATCH_GITHASH@) +set(CPACK_PACKAGE_VERSION @HIP_VERSION_MAJOR@.@HIP_VERSION_MINOR@.@HIP_PACKAGING_VERSION_PATCH@) # by default rpm tries to reduce the file size by stripping the executable # To avoid build/packaging failures SWDEV-375603 and skip stripping set(CPACK_RPM_SPEC_MORE_DEFINE "%global __os_install_post %{nil}") @@ -100,6 +100,27 @@ if (CPACK_PACKAGE_VERSION MATCHES "local" ) set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX ${CPACK_INSTALL_PREFIX}) endif() +if (DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE}) + set(CPACK_DEBIAN_PACKAGE_RELEASE $ENV{CPACK_DEBIAN_PACKAGE_RELEASE}) +else() + set(CPACK_DEBIAN_PACKAGE_RELEASE "local") +endif() + +if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE}) + set(CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE}) +else() + set(CPACK_RPM_PACKAGE_RELEASE "local") +endif() + +execute_process( COMMAND rpm --eval %{?dist} + RESULT_VARIABLE PROC_RESULT + OUTPUT_VARIABLE EVAL_RESULT + OUTPUT_STRIP_TRAILING_WHITESPACE ) +# Add os distribution tag to rpm package name . For deb package its set from build env +if ( PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "" ) + string(APPEND CPACK_RPM_PACKAGE_RELEASE "%{?dist}") +endif() + set(CPACK_SOURCE_GENERATOR "TGZ") # Install license file set ( CPACK_RESOURCE_FILE_LICENSE "@CMAKE_CURRENT_LIST_DIR@/../LICENSE.txt" )