Skip to content

Commit

Permalink
[cmake] Don't use CPACK_DEBIAN_PACKAGE_RELEASE, set CPACK_DEBIAN_PACK…
Browse files Browse the repository at this point in the history
…AGE_VERSION directly.
  • Loading branch information
s3rj1k committed Feb 22, 2024
1 parent c432105 commit 372629d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,24 @@ if("${CMAKE_OS_NAME}" STREQUAL "Debian")
set(CHANGELOG_FOOTER " -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${RFC2822_TIMESTAMP}")
endif()

# Set version release from environment variable
# Guess version release from environment variable
# (usage of CPACK_DEBIAN_PACKAGE_RELEASE breaks ability to set CPACK_DEBIAN_PACKAGE_VERSION properly)
if (NOT "$ENV{PACKAGE_RELEASE}" STREQUAL "")
set(CPACK_DEBIAN_PACKAGE_RELEASE "$ENV{PACKAGE_RELEASE}")
set(PACKAGE_RELEASE "$ENV{PACKAGE_RELEASE}")
else()
if(DATE_CMD)
execute_process(COMMAND ${DATE_CMD} +%Y%m%d OUTPUT_VARIABLE DATE_YMD)
set(CPACK_DEBIAN_PACKAGE_RELEASE ${DATE_YMD})
set(PACKAGE_RELEASE ${DATE_YMD})
else()
set(CPACK_DEBIAN_PACKAGE_RELEASE "1")
set(PACKAGE_RELEASE "1")
endif()
endif()

# Set package version
set(CPACK_DEBIAN_PACKAGE_VERSION ${PROJECT_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}~${DISTRO_CODENAME})
set(CPACK_DEBIAN_PACKAGE_VERSION ${PROJECT_VERSION}-${PACKAGE_RELEASE}~${DISTRO_CODENAME})

# Set debian file name format
set(CPACK_DEBIAN_FILE_NAME "${PACKAGE_NAME}_${PROJECT_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${DISTRO_CODENAME}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
set(CPACK_DEBIAN_FILE_NAME "${PACKAGE_NAME}_${PROJECT_VERSION}-${PACKAGE_RELEASE}_${DISTRO_CODENAME}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")

# Set a Debian compliant changelog header
set(CHANGELOG_HEADER "signalwire-client-c2 (${CPACK_DEBIAN_PACKAGE_VERSION}) ${DISTRO_CODENAME}\; urgency=${CPACK_DEBIAN_PACKAGE_PRIORITY}")
Expand Down

0 comments on commit 372629d

Please sign in to comment.