Skip to content

Commit

Permalink
Add "eln" suffix name into the rpm package
Browse files Browse the repository at this point in the history
Add "el7" or "el8" as a suffix name of rpm package,
like opae-1.3.7-5.el8.x86_64.rpm on RHEL 8.x system.

Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com>
  • Loading branch information
Figo-zhang committed Jun 17, 2020
1 parent db12639 commit 81afe79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
cmake_minimum_required(VERSION 2.8.12)
project(opae)

file(READ "/etc/os-release" ver)
string(REGEX MATCH "REDHAT_SUPPORT_PRODUCT_VERSION=.([0-9]*)" _ ${ver})
set(os_dist "el${CMAKE_MATCH_1}")

message("OS dist: ${os_dist}")

############################################################################
## Get git hash info, if available #########################################
############################################################################
Expand Down Expand Up @@ -213,13 +219,14 @@ set(CPACK_PACKAGE_VERSION_MINOR "${INTEL_FPGA_API_VER_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${INTEL_FPGA_API_VER_REV}")
set(CPACK_PACKAGE_VERSION ${INTEL_FPGA_API_VERSION})
set(CPACK_PACKAGE_RELEASE 5)
set(CPACK_PACKAGE_RELEASE_DIST ${CPACK_PACKAGE_RELEASE}.${os_dist})
set(CPACK_PACKAGE_CONTACT "opae@lists.01.org")
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
#Hashing the package components
if(HASH_ARCHIVES)
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}-git${GIT_COMMIT_HASH}")
else()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${os_dist}.${CMAKE_SYSTEM_PROCESSOR}")
endif()

if("${CPACK_GENERATOR}" STREQUAL "DEB")
Expand Down Expand Up @@ -364,7 +371,7 @@ set(CPACK_RPM_COMPONENT_INSTALL OFF)
set(CPACK_RPM_PACKAGE_COMPONENT OFF)
set(CPACK_RPM_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE})
set(CPACK_RPM_PACKAGE_LICENSE "BSD 3.0")
set(CPACK_TEMPORARY_PACKAGE_FILE_NAME "${CMAKE_BINARY_DIR}/_CPack_Packages/Linux/RPM/RPMS/x86_64/${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}.rpm")
set(CPACK_TEMPORARY_PACKAGE_FILE_NAME "${CMAKE_BINARY_DIR}/_CPack_Packages/Linux/RPM/RPMS/x86_64/${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${os_dist}.${CMAKE_SYSTEM_PROCESSOR}.rpm")
set(CPACK_META_GROUP_NAME "opae")
set(CPACK_RPM_PACKAGE_DESCRIPTION "This package contains the Open Programmable Acceleration Engine (OPAE) components ")

Expand Down
2 changes: 1 addition & 1 deletion opae.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BuildRoot: %_topdir/@CPACK_PACKAGE_FILE_NAME@
Summary: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@
Name: @CPACK_PACKAGE_NAME@
Version: @CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@
Release: @CPACK_PACKAGE_RELEASE@
Release: @CPACK_PACKAGE_RELEASE_DIST@
License: @CPACK_RPM_PACKAGE_LICENSE@
Group: @CPACK_META_GROUP_NAME@
Vendor: @CPACK_PACKAGE_VENDOR@
Expand Down

0 comments on commit 81afe79

Please sign in to comment.