1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
From: Xuanteng Huang <xuanteng.huang@outlook.com>
Date: Fri, 12 Jul 2024 16:20:39 +0800
Subject: remove built-in package
Upstream developers provide some native approaches to build packages for Debian/CentOS.
We don't need this.
Forwarded: not-needed
---
CMakeLists.txt | 81 ----------------------------------------------------------
1 file changed, 81 deletions(-)
Index: amdsmi/CMakeLists.txt
===================================================================
--- amdsmi.orig/CMakeLists.txt
+++ amdsmi/CMakeLists.txt
@@ -265,136 +265,3 @@ install(
# Make for goamdsmi_shim library
add_subdirectory(goamdsmi_shim)
-
-#Debian package specific variables
-set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python3-argcomplete, libdrm-dev, libdrm-amdgpu-dev")
-set(CPACK_DEBIAN_ASAN_PACKAGE_RECOMMENDS ${CPACK_DEBIAN_PACKAGE_RECOMMENDS})
-set(CPACK_DEBIAN_DEV_PACKAGE_RECOMMENDS ${CPACK_DEBIAN_PACKAGE_RECOMMENDS})
-set(CPACK_DEBIAN_PACKAGE_DEPENDS "sudo, libc6, python3 (>= 3.6.8), python3-pip, python3-setuptools, python3-wheel")
-set(CPACK_DEBIAN_ASAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS})
-set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS})
-
-# $CURRENT_YEAR is used by copyright.in
-string(TIMESTAMP CURRENT_YEAR "%Y")
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/copyright.in DEBIAN/copyright @ONLY)
-
-## Process the Debian install/remove scripts to update the CPACK variables
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst.in
- DEBIAN/postinst
- @ONLY
- FILE_PERMISSIONS
- OWNER_READ
- OWNER_WRITE
- OWNER_EXECUTE
- GROUP_READ
- GROUP_EXECUTE
- WORLD_READ
- WORLD_EXECUTE)
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/prerm.in
- DEBIAN/prerm
- @ONLY
- FILE_PERMISSIONS
- OWNER_READ
- OWNER_WRITE
- OWNER_EXECUTE
- GROUP_READ
- GROUP_EXECUTE
- WORLD_READ
- WORLD_EXECUTE)
-list(APPEND CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/DEBIAN/postinst"
- "${CMAKE_CURRENT_BINARY_DIR}/DEBIAN/prerm")
-
-# Configure pre-rm for tests only
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/${CPACK_PACKAGE_NAME}-tests/prerm.in
- DEBIAN/${CPACK_PACKAGE_NAME}-tests/prerm
- @ONLY
- FILE_PERMISSIONS
- OWNER_READ
- OWNER_WRITE
- OWNER_EXECUTE
- GROUP_READ
- GROUP_EXECUTE
- WORLD_READ
- WORLD_EXECUTE)
-
-# Assign control scripts to the AMDSMI Lib & Tests packages
-set(CPACK_DEBIAN_DEV_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/DEBIAN/prerm")
-set(CPACK_DEBIAN_TESTS_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/DEBIAN/${CPACK_PACKAGE_NAME}-tests/prerm")
-
-# install copyright file into share/doc/amd-smi-lib/copyright
-# required for debian package compliance
-install(
- FILES "${CMAKE_CURRENT_BINARY_DIR}/DEBIAN/copyright"
- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${CPACK_PACKAGE_NAME}
- COMPONENT dev)
-
-# RPM package specific variables
-set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
- "${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
-#Set rpm distro
-if(CPACK_RPM_PACKAGE_RELEASE)
- set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
-endif()
-# NOTE: RPM SUGGESTS DO NOT WORK! https://bugzilla.redhat.com/show_bug.cgi?id=1811358
-set(CPACK_RPM_PACKAGE_SUGGESTS "python3-argcomplete, libdrm-dev, libdrm-amdgpu-dev")
-set(CPACK_RPM_DEV_PACKAGE_SUGGESTS ${CPACK_RPM_PACKAGE_SUGGESTS})
-set(CPACK_RPM_ASAN_PACKAGE_SUGGESTS ${CPACK_RPM_PACKAGE_SUGGESTS})
-# python version gated by rhel8 :(
-set(CPACK_RPM_PACKAGE_REQUIRES "sudo, python3 >= 3.6.8, python3-pip, python3-wheel, python3-setuptools")
-set(CPACK_RPM_DEV_PACKAGE_REQUIRES ${CPACK_RPM_PACKAGE_REQUIRES})
-set(CPACK_RPM_ASAN_PACKAGE_REQUIRES ${CPACK_RPM_PACKAGE_REQUIRES})
-
-# don't terminate if bytecompile of python files fails
-set(CPACK_RPM_SPEC_MORE_DEFINE "%define _python_bytecompile_errors_terminate_build 0")
-# Cpack converts !/usr/bin/env python3 to /usr/libexec/platform-python in RHEL8.
-# prevent the BRP(buildroot policy) script from checking and modifying interpreter directives
-string(APPEND CPACK_RPM_SPEC_MORE_DEFINE "\n%undefine __brp_mangle_shebangs")
-
-# Add rocm-core dependency if -DROCM_DEP_ROCMCORE=ON is passed
-if(ROCM_DEP_ROCMCORE)
- string(APPEND CPACK_DEBIAN_ASAN_PACKAGE_DEPENDS ", rocm-core-asan")
- string(APPEND CPACK_RPM_ASAN_PACKAGE_REQUIRES ", rocm-core-asan")
- string(APPEND CPACK_DEBIAN_DEV_PACKAGE_DEPENDS ", rocm-core")
- string(APPEND CPACK_RPM_DEV_PACKAGE_REQUIRES ", rocm-core")
- string(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS ", rocm-core")
- string(APPEND CPACK_RPM_PACKAGE_REQUIRES ", rocm-core")
-endif()
-
-## Enable Component Mode and set component specific flags
-set(CPACK_DEB_COMPONENT_INSTALL ON)
-set(CPACK_DEBIAN_DEV_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
-set(CPACK_DEBIAN_TESTS_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-tests")
-set(CPACK_DEBIAN_ASAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-asan")
-set(CPACK_RPM_COMPONENT_INSTALL ON)
-set(CPACK_RPM_DEV_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
-set(CPACK_RPM_TESTS_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-tests")
-set(CPACK_RPM_ASAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-asan")
-if(ENABLE_ASAN_PACKAGING)
- # ASAN Package requires only asan component with libraries and license file
- set(CPACK_COMPONENTS_ALL asan)
-else()
- set(CPACK_COMPONENTS_ALL dev tests)
-endif()
-
-# The line below doesn't currently work; it may be this issue:
-# https://bugzilla.redhat.com/show_bug.cgi?id=1811358
-# set(CPACK_RPM_PACKAGE_SUGGESTS "sudo, libdrm-dev")
-
-## Process the Rpm install/remove scripts to update the CPACK variables
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/RPM/post.in" RPM/post @ONLY)
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/RPM/preun.in" RPM/preun @ONLY)
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/RPM/postun.in" RPM/postun @ONLY)
-set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/RPM/post")
-set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/RPM/preun")
-set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/RPM/postun")
-
-#Set the names now using CPACK utility
-set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
-set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
-
-include(CPack)
-
-generic_package_post()
|