Skip to content

Commit

Permalink
Unite cpack
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtropets committed Jan 30, 2025
1 parent d8d618b commit 0ef1933
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
git config --global --add safe.directory /__w/CCF/CCF
mkdir build
cd build
CC=`which clang` CXX=`which clang++` cmake -GNinja -DCOMPILE_TARGET=${{ matrix.platform.name }} -DCLIENT_PROTOCOLS_TEST=ON -DPACKAGE_TYPE=${{ matrix.platform.package_format }} -DCMAKE_BUILD_TYPE=Release ..
CC=`which clang` CXX=`which clang++` cmake -GNinja -DCOMPILE_TARGET=${{ matrix.platform.name }} -DCLIENT_PROTOCOLS_TEST=ON -DCMAKE_BUILD_TYPE=Release ..
ninja -v | tee build.log
- name: "Install Extended Testing Tools"
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,17 @@ jobs:
- name: virtual
os: ubuntu
image: ghcr.io/microsoft/ccf/ci/default:build-14-01-2025
package_format: DEB
test_filter: "benchmark|unit"
- name: snp
os: ubuntu
image: ghcr.io/microsoft/ccf/ci/default:build-14-01-2025
package_format: DEB
- name: virtual
os: azure-linux
image: mcr.microsoft.com/azurelinux/base/core:3.0
package_format: RPM
test_filter: "benchmark|unit|protocolstest|lts"
- name: snp
os: azure-linux
image: mcr.microsoft.com/azurelinux/base/core:3.0
package_format: RPM

runs-on: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
container:
Expand Down Expand Up @@ -118,7 +114,7 @@ jobs:
git config --global --add safe.directory /__w/CCF/CCF
mkdir build
cd build
CC=`which clang` CXX=`which clang++` cmake -GNinja -DCOMPILE_TARGET=${{ matrix.platform.name }} -DCLIENT_PROTOCOLS_TEST=ON -DPACKAGE_TYPE=${{ matrix.platform.package_format }} -DCMAKE_BUILD_TYPE=Release ..
CC=`which clang` CXX=`which clang++` cmake -GNinja -DCOMPILE_TARGET=${{ matrix.platform.name }} -DCLIENT_PROTOCOLS_TEST=ON -DCMAKE_BUILD_TYPE=Release ..
ninja -v | tee build.log
- name: "Install Extended Testing Tools"
Expand Down
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
)
endif()

if(PACKAGE_TYPE STREQUAL "DEB")
include(${CCF_DIR}/cmake/cpack_deb.cmake)
elseif(PACKAGE_TYPE STREQUAL "RPM")
include(${CCF_DIR}/cmake/cpack_rpm.cmake)
endif()
include(${CCF_DIR}/cmake/cpack_settings.cmake)

message(STATUS "CMAKE_INSTALL_PREFIX is '${CMAKE_INSTALL_PREFIX}'")

Expand Down
31 changes: 0 additions & 31 deletions cmake/cpack_rpm.cmake

This file was deleted.

26 changes: 26 additions & 0 deletions cmake/cpack_deb.cmake → cmake/cpack_settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ set(CPACK_RESOURCE_FILE_LICENSE "${CCF_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION ${CCF_RELEASE_VERSION})
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})

# DEB-specific settings

set(CPACK_DEBIAN_PACKAGE_VERSION "${CCF_RELEASE_VERSION}")

if(CCF_VERSION_SUFFIX)
Expand All @@ -32,6 +34,30 @@ endif()

list(JOIN CCF_DEB_DEPENDENCIES ", " CPACK_DEBIAN_PACKAGE_DEPENDS)

message(STATUS "DEB package dependencies: ${CCF_DEB_DEPENDENCIES}")

set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)

# RPM-specific settings

set(CPACK_RPM_PACKAGE_VERSION "${CCF_RELEASE_VERSION}")

if(CCF_VERSION_SUFFIX)
set(CPACK_RPM_PACKAGE_VERSION
"${CPACK_RPM_PACKAGE_VERSION}~${CCF_VERSION_SUFFIX}"
)
endif()

message(STATUS "RPM package version: ${CPACK_RPM_PACKAGE_VERSION}")

set(CCF_RPM_DEPENDENCIES
"libuv >= 1.34.2, openssl >= 3.3.0, nghttp2 >= 1.40.0, curl >= 7.68.0, libcxxabi >= 18.1.2"
)

message(STATUS "RPM package dependencies: ${CCF_RPM_DEPENDENCIES}")

set(CPACK_RPM_PACKAGE_REQUIRES "${CCF_RPM_DEPENDENCIES}")

set(CPACK_RPM_FILE_NAME RPM-DEFAULT)

include(CPack)

0 comments on commit 0ef1933

Please sign in to comment.