Enable Lintian Support rocm-systems (#1578)
* draft testing fix for no copyright file and no changelog * test fix no-changelog no-copyright * changelog copyright fixt * remove utils.cmake * rocr lintian * lintian overrides, copyright, changelog install * fix lintian overrides install * comp_type static fix and remove debug logs * syntax error * update static build check * update file permissions to 0755 to fix error control-file-has-bad-permissions 0664 != 0755 * fix lintian errors in rdc and remove logs from roctracer * lintian error fix rocprofiler * fix lintian error * mmove lintian overrides install * lintian errors fix * move lintian overrides install * use changelog already provided by rdc * fix formatting use existing changelog if provided * fix formatting use changelog in rocprofiler * draft testing fix for no copyright file and no changelog * test fix no-changelog no-copyright * changelog copyright fixt * lintian overrides, copyright, changelog install * fix lintian overrides install * comp_type static fix and remove debug logs * fix lintian errors in rdc and remove logs from roctracer * lintian error fix rocprofiler * fix lintian error * mmove lintian overrides install * lintian errors fix * move lintian overrides install * use changelog already provided by rdc * fix formatting use existing changelog if provided * fix formatting use changelog in rocprofiler * remove overrides. Use existing changelog and copyright * resolve merge conflict * update license for hsa-rocr. Use NCSA license * install license * install license
This commit is contained in:
@@ -45,6 +45,9 @@ cmake_minimum_required(VERSION 3.7)
|
||||
|
||||
# Set the project name
|
||||
project("rocr")
|
||||
set( CORE_TARGET "hsa-rocr" )
|
||||
set( BUILD_ENABLE_LINTIAN_OVERRIDES ON CACHE BOOL "Enable/Disable Lintian Overrides" )
|
||||
set( BUILD_DEBIAN_PKGING_FLAG ON CACHE BOOL "Internal Status Flag to indicate Debian Packaging Build" )
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
## Expose static library option
|
||||
@@ -82,6 +85,7 @@ function(add_rocm_subdir subdir subdir_assigns)
|
||||
endfunction()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
|
||||
include ( GNUInstallDirs )
|
||||
include(utils)
|
||||
|
||||
|
||||
@@ -179,14 +183,19 @@ endif()
|
||||
if (ENABLE_ASAN_PACKAGING)
|
||||
# ASAN Package requires only asan component with libraries and license file
|
||||
set(CPACK_COMPONENTS_ALL asan)
|
||||
set( COMP_TYPE "asan" )
|
||||
else()
|
||||
set(CPACK_COMPONENTS_ALL binary dev)
|
||||
set( COMP_TYPE "binary" )
|
||||
endif()
|
||||
|
||||
set(PKG_MAINTAINER_NM "AMD HSA Support")
|
||||
set(PKG_MAINTAINER_EMAIL "dl.HSA-Runtime-Support@amd.com")
|
||||
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
||||
set(CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc.")
|
||||
set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION_STRING})
|
||||
set(CPACK_PACKAGE_CONTACT "AMD HSA Support <dl.HSA-Runtime-Support@amd.com>")
|
||||
set(CPACK_PACKAGE_CONTACT "${PKG_MAINTAINER_NM} <${PKG_MAINTAINER_EMAIL}>")
|
||||
set(CPACK_COMPONENT_DESCRIPTION "Includes HSAKMT, the ROCk driver, headers, pkgonfig and cmake files for ROCT.")
|
||||
set(CPACK_COMPONENT_BINARY_DESCRIPTION "AMD Heterogeneous System Architecture HSA - Linux HSA Runtime for Boltzmann (ROCm) platforms")
|
||||
set(CPACK_COMPONENT_DEV_DESCRIPTION "AMD Heterogeneous System Architecture HSA development package.\n This package contains the headers and cmake files for the rocr-runtime package.")
|
||||
@@ -334,6 +343,7 @@ include(CPack)
|
||||
# Group binary and dev component to single package
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
cpack_add_component_group("static")
|
||||
set( COMP_TYPE "static" )
|
||||
cpack_add_component(binary GROUP static)
|
||||
cpack_add_component(dev GROUP static)
|
||||
endif()
|
||||
@@ -341,3 +351,6 @@ endif()
|
||||
cpack_add_component(asan
|
||||
DISPLAY_NAME "ASAN"
|
||||
DESCRIPTION "ASAN libraries for rocr-runtime")
|
||||
|
||||
# Debian specific packaging configuration install lintian files
|
||||
configure_pkg( ${CORE_TARGET} ${COMP_TYPE} ${CPACK_PACKAGE_VERSION} ${PKG_MAINTAINER_NM} ${PKG_MAINTAINER_EMAIL} )
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
@@ -0,0 +1,4 @@
|
||||
@DEB_PACKAGE_NAME@ (@DEB_PACKAGE_VERSION@) stable; urgency=low
|
||||
|
||||
* ROCm Runtime software stack Base Package.
|
||||
-- @DEB_MAINTAINER_NAME@ <@DEB_MAINTAINER_EMAIL@> @DEB_TIMESTAMP@
|
||||
@@ -0,0 +1,7 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: @DEB_PACKAGE_NAME@
|
||||
Upstream-Contact: @DEB_MAINTAINER_NAME@ <@DEB_MAINTAINER_EMAIL@>
|
||||
Source: https://github.com/ROCm/@DEB_PACKAGE_NAME@
|
||||
Files: *
|
||||
License: @DEB_LICENSE@
|
||||
Copyright: @DEB_COPYRIGHT_YEAR@ Advanced Micro Devices, Inc. All rights Reserved.
|
||||
Regular → Executable
Regular → Executable
@@ -231,3 +231,91 @@ if (PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
## Configure Copyright File for Debian Package
|
||||
function( configure_pkg PACKAGE_NAME_T COMPONENT_NAME_T PACKAGE_VERSION_T MAINTAINER_NM_T MAINTAINER_EMAIL_T)
|
||||
# Check If Debian Platform
|
||||
find_file (DEBIAN debian_version debconf.conf PATHS /etc)
|
||||
if(DEBIAN)
|
||||
set( BUILD_DEBIAN_PKGING_FLAG ON CACHE BOOL "Internal Status Flag to indicate Debian Packaging Build" FORCE )
|
||||
set_pkg_cmake_flags( ${PACKAGE_NAME_T} ${PACKAGE_VERSION_T}
|
||||
${MAINTAINER_NM_T} ${MAINTAINER_EMAIL_T} )
|
||||
|
||||
# Create debian directory in build tree
|
||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/DEBIAN")
|
||||
|
||||
# Configure the copyright file
|
||||
configure_file(
|
||||
"${CMAKE_SOURCE_DIR}/DEBIAN/copyright.in"
|
||||
"${CMAKE_BINARY_DIR}/DEBIAN/copyright"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# Install copyright file
|
||||
install ( FILES "${CMAKE_BINARY_DIR}/DEBIAN/copyright"
|
||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
|
||||
COMPONENT ${COMPONENT_NAME_T} )
|
||||
|
||||
# Configure the changelog file
|
||||
configure_file(
|
||||
"${CMAKE_SOURCE_DIR}/DEBIAN/changelog.in"
|
||||
"${CMAKE_BINARY_DIR}/DEBIAN/changelog.Debian"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# Install Change Log
|
||||
find_program ( DEB_GZIP_EXEC gzip )
|
||||
if(EXISTS "${CMAKE_BINARY_DIR}/DEBIAN/changelog.Debian" )
|
||||
execute_process(
|
||||
COMMAND ${DEB_GZIP_EXEC} -f -n -9 "${CMAKE_BINARY_DIR}/DEBIAN/changelog.Debian"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/DEBIAN"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_VARIABLE error
|
||||
)
|
||||
if(NOT ${result} EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to compress: ${error}")
|
||||
endif()
|
||||
install ( FILES "${CMAKE_BINARY_DIR}/DEBIAN/${DEB_CHANGELOG_INSTALL_FILENM}"
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
COMPONENT ${COMPONENT_NAME_T})
|
||||
endif()
|
||||
|
||||
else()
|
||||
# License file
|
||||
install ( FILES ${LICENSE_FILE}
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME LICENSE.txt
|
||||
COMPONENT ${COMPONENT_NAME_T})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Set variables for changelog and copyright
|
||||
# For Debian specific Packages
|
||||
function( set_pkg_cmake_flags DEB_PACKAGE_NAME_T DEB_PACKAGE_VERSION_T DEB_MAINTAINER_NM_T DEB_MAINTAINER_EMAIL_T )
|
||||
# Setting configure flags
|
||||
set( DEB_PACKAGE_NAME "${DEB_PACKAGE_NAME_T}" CACHE STRING "Debian Package Name" )
|
||||
set( DEB_PACKAGE_VERSION "${DEB_PACKAGE_VERSION_T}" CACHE STRING "Debian Package Version String" )
|
||||
set( DEB_MAINTAINER_NAME "${DEB_MAINTAINER_NM_T}" CACHE STRING "Debian Package Maintainer Name" )
|
||||
set( DEB_MAINTAINER_EMAIL "${DEB_MAINTAINER_EMAIL_T}" CACHE STRING "Debian Package Maintainer Email" )
|
||||
set( DEB_COPYRIGHT_YEAR "2025" CACHE STRING "Debian Package Copyright Year" )
|
||||
set( DEB_LICENSE "NSCA" CACHE STRING "Debian Package License Type" )
|
||||
set( DEB_CHANGELOG_INSTALL_FILENM "changelog.Debian.gz" CACHE STRING "Debian Package ChangeLog File Name" )
|
||||
|
||||
# Get TimeStamp
|
||||
find_program( DEB_DATE_TIMESTAMP_EXEC date )
|
||||
set ( DEB_TIMESTAMP_FORMAT_OPTION "-R" )
|
||||
execute_process (
|
||||
COMMAND ${DEB_DATE_TIMESTAMP_EXEC} ${DEB_TIMESTAMP_FORMAT_OPTION}
|
||||
OUTPUT_VARIABLE TIMESTAMP_T
|
||||
)
|
||||
set( DEB_TIMESTAMP "${TIMESTAMP_T}" CACHE STRING "Current Time Stamp for Copyright/Changelog" )
|
||||
|
||||
message(STATUS "DEB_PACKAGE_NAME : ${DEB_PACKAGE_NAME}" )
|
||||
message(STATUS "DEB_PACKAGE_VERSION : ${DEB_PACKAGE_VERSION}" )
|
||||
message(STATUS "DEB_MAINTAINER_NAME : ${DEB_MAINTAINER_NAME}" )
|
||||
message(STATUS "DEB_MAINTAINER_EMAIL : ${DEB_MAINTAINER_EMAIL}" )
|
||||
message(STATUS "DEB_COPYRIGHT_YEAR : ${DEB_COPYRIGHT_YEAR}" )
|
||||
message(STATUS "DEB_LICENSE : ${DEB_LICENSE}" )
|
||||
message(STATUS "DEB_TIMESTAMP : ${DEB_TIMESTAMP}" )
|
||||
message(STATUS "DEB_CHANGELOG_INSTALL_FILENM : ${DEB_CHANGELOG_INSTALL_FILENM}" )
|
||||
endfunction()
|
||||
|
||||
Regular → Executable
Executable → Regular
Reference in New Issue
Block a user