From 84c80844bd6b18be76d924a8a360570a92624178 Mon Sep 17 00:00:00 2001 From: Diogo Mendes Matsubara Date: Thu, 31 Oct 2024 08:41:36 +0100 Subject: [PATCH] fix: align with zenoh-c - 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 --- CMakeLists.txt | 11 ++++------- ci/scripts/build-linux.bash | 10 +++++----- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83539b850..6cd3a83d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") @@ -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() @@ -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() diff --git a/ci/scripts/build-linux.bash b/ci/scripts/build-linux.bash index 96e2ee474..3ac09ccdc 100644 --- a/ci/scripts/build-linux.bash +++ b/ci/scripts/build-linux.bash @@ -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" @@ -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