Skip to content

Commit

Permalink
fix: align with zenoh-c
Browse files Browse the repository at this point in the history
- update package names
- set version string in the same way
- set DEBARCH/RPMARCH
- set CPACK_PACKAGE_FILE_NAME
- add -j to zip archive to not include parent folder
  • Loading branch information
diogomatsubara committed Oct 31, 2024
1 parent 07c621e commit 84c8084
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,8 @@ if(PACKAGING)
set(CPACK_PACKAGE_CHECKSUM MD5)
set(CPACK_PACKAGE_VENDOR "The Eclipse Foundation")
if(NOT CPACK_PACKAGE_VERSION)
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(SEM_VER "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
if(NOT DEFINED PROJECT_VERSION_TWEAK)
if(PROJECT_VERSION_TWEAK STREQUAL "")
set(CPACK_PACKAGE_VERSION ${SEM_VER})
elseif(PROJECT_VERSION_TWEAK EQUAL 0)
set(CPACK_PACKAGE_VERSION "${SEM_VER}~dev-1")
Expand All @@ -586,13 +585,13 @@ if(PACKAGING)
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-src-${project_version}")

set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")

if(PACKAGING MATCHES "DEB")
if(NOT DEBARCH)
set(DEBARCH ${CMAKE_SYSTEM_PROCESSOR})
set(DEBARCH ${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME})
endif()

message(STATUS "Configure DEB packaging for Linux ${DEBARCH}")

if(CPACK_GENERATOR)
set(CPACK_GENERATOR "${CPACK_GENERATOR};DEB")
else()
Expand All @@ -616,8 +615,6 @@ if(PACKAGING)
set(RPMARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()

message(STATUS "Configure RPM packaging for Linux ${RPMARCH}")

if(CPACK_GENERATOR)
set(CPACK_GENERATOR "${CPACK_GENERATOR};RPM")
else()
Expand Down
10 changes: 5 additions & 5 deletions ci/scripts/build-linux.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ BUILD_SHARED_LIBS=ON BUILD_TYPE=RELEASE make "$target"

readonly out=$GITHUB_WORKSPACE
readonly repo_name=${repo#*/}
readonly archive_lib=$out/$repo_name-$version-$target.zip
readonly archive_deb=$out/$repo_name-$version-$target-deb-pkgs.zip
readonly archive_rpm=$out/$repo_name-$version-$target-rpm-pkgs.zip
readonly archive_lib=$out/$repo_name-$version-$target-standalone.zip
readonly archive_deb=$out/$repo_name-$version-$target-debian.zip
readonly archive_rpm=$out/$repo_name-$version-$target-rpm.zip
readonly archive_examples=$out/$repo_name-$version-$target-examples.zip

cd crossbuilds/"$target"
Expand All @@ -24,8 +24,8 @@ cd -
zip -r "$archive_lib" include

cd crossbuilds/"$target"/packages
zip "$archive_deb" ./*.deb
zip "$archive_rpm" ./*.rpm
zip -9 -j "$archive_deb" ./*.deb
zip -9 -j "$archive_rpm" ./*.rpm
cd -

cd crossbuilds/"$target"/examples
Expand Down

0 comments on commit 84c8084

Please sign in to comment.