From 3d3270b21474e94d369f4ad04e31b2a67688d2f3 Mon Sep 17 00:00:00 2001 From: "Jonathan R. Madsen" Date: Fri, 6 Aug 2021 13:29:09 -0500 Subject: [PATCH] License + CPack support [ROCm/rocprofiler-systems commit: 7dca3a71498933c9b0555736aba34d55630a4352] --- projects/rocprofiler-systems/CMakeLists.txt | 12 +++++- projects/rocprofiler-systems/LICENSE | 27 ++++++++++++ .../cmake/ConfigCPack.cmake | 43 +++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 projects/rocprofiler-systems/LICENSE create mode 100644 projects/rocprofiler-systems/cmake/ConfigCPack.cmake diff --git a/projects/rocprofiler-systems/CMakeLists.txt b/projects/rocprofiler-systems/CMakeLists.txt index 8ff1c90891..76d727fd86 100644 --- a/projects/rocprofiler-systems/CMakeLists.txt +++ b/projects/rocprofiler-systems/CMakeLists.txt @@ -11,8 +11,10 @@ endif() project( hosttrace - LANGUAGES CXX) + LANGUAGES CXX + VERSION 0.0.1) +message(STATUS "[${PROJECT_NAME}] version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) if("${CMAKE_BUILD_TYPE}" STREQUAL "") @@ -135,3 +137,11 @@ include(CTest) enable_testing() add_subdirectory(tests) + +#------------------------------------------------------------------------------# +# +# packaging +# +#------------------------------------------------------------------------------# + +include(ConfigCPack) diff --git a/projects/rocprofiler-systems/LICENSE b/projects/rocprofiler-systems/LICENSE new file mode 100644 index 0000000000..d92876e2a5 --- /dev/null +++ b/projects/rocprofiler-systems/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2018 Advanced Micro Devices, Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +with the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of Advanced Micro Devices, Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this Software without specific prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH +THE SOFTWARE. diff --git a/projects/rocprofiler-systems/cmake/ConfigCPack.cmake b/projects/rocprofiler-systems/cmake/ConfigCPack.cmake new file mode 100644 index 0000000000..88a5c1c7d3 --- /dev/null +++ b/projects/rocprofiler-systems/cmake/ConfigCPack.cmake @@ -0,0 +1,43 @@ + +# Add packaging directives for timemory +set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) +set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc.") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Runtime instrumentation and binary rewriting for Perfetto via Dyninst") +set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") +set(CPACK_PACKAGE_CONTACT "jonathan.madsen@amd.com") +set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") + +# Debian package specific variables +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/AARInternal/hosttrace-dyninst") +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() + +# RPM package specific variables +if(DEFINED CPACK_PACKAGING_INSTALL_PREFIX) + set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CPACK_PACKAGING_INSTALL_PREFIX}") +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() + +# Get rpm distro +if(CPACK_RPM_PACKAGE_RELEASE) + set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) +endif() + +# Prepare final version for the CPACK use +set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") + +# Set the names now using CPACK utility +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") + +include(CPack)