Commit d6995590 authored by Andreas Schuh's avatar Andreas Schuh

Fix architecture used for RPM packages and DEB/RPM package file names.

parent 04a30c86
......@@ -366,15 +366,31 @@ if (BUILD_PACKAGING)
set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/cmake/README_runtime.txt")
endif ()
# system name used for binary package file name
# system/architecture
if (WINDOWS)
if (CMAKE_CL_64)
set (CPACK_SYSTEM_NAME "win64")
else ()
set (CPACK_SYSTEM_NAME "win32")
endif ()
set (CPACK_PACKAGE_ARCHITECTURE)
else ()
string (TOLOWER "${CMAKE_SYSTEM_NAME}" CPACK_SYSTEM_NAME)
execute_process (
COMMAND dpkg --print-architecture
RESULT_VARIABLE RV
OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE
)
if (RV EQUAL 0)
string (STRIP "${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_ARCHITECTURE)
else ()
execute_process (COMMAND uname -m OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE)
if (CPACK_PACKAGE_ARCHITECTURE MATCHES "x86_64")
set (CPACK_PACKAGE_ARCHITECTURE amd64)
else ()
set (CPACK_PACKAGE_ARCHITECTURE i386)
endif ()
endif ()
endif ()
# source package settings
......@@ -383,10 +399,10 @@ if (BUILD_PACKAGING)
set (CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;\\\\.swp$;\\\\.#;/#;\\\\.*~;cscope\\\\.*;/[Bb]uild[.+-_a-zA-Z0-9]*/")
# default binary package settings
set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY TRUE)
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
if (CMAKE_SYSTEM_PROCESSOR)
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY TRUE)
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
if (CPACK_PACKAGE_ARCHITECTURE)
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CPACK_PACKAGE_ARCHITECTURE}")
endif ()
# generator specific configuration file
......
......@@ -27,40 +27,23 @@ elseif (CPACK_GENERATOR MATCHES "DEB")
else ()
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}0")
endif ()
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${CPACK_PACKAGE_VERSION}-1_${CMAKE_SYSTEM_PROCESSOR}")
execute_process (
COMMAND dpkg --print-architecture
RESULT_VARIABLE RV
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
)
if (NOT RV EQUAL 0)
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
endif ()
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${CPACK_PACKAGE_VERSION}-1_${CPACK_PACKAGE_ARCHITECTURE}")
set (CPACK_DEBIAN_PACKAGE_DEPENDS)
set (CPACK_DEBIAN_PACKAGE_SECTION "devel")
set (CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_RPM_PACKAGE_URL}")
set (CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR}")
set (CPACK_DEBIAN_PACKAGE_SECTION "devel")
set (CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_RPM_PACKAGE_URL}")
set (CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR}")
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CPACK_PACKAGE_ARCHITECTURE}")
# ------------------------------------------------------------------------------
# RPM package
elseif (CPACK_GENERATOR MATCHES "RPM")
execute_process (
COMMAND dpkg --print-architecture
RESULT_VARIABLE RV
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
)
if (NOT RV EQUAL 0)
set (CPACK_RPM_PACKAGE_ARCHITECTURE i386)
endif ()
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
if (DEVEL)
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-devel")
endif ()
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CPACK_PACKAGE_VERSION}-1_${CMAKE_SYSTEM_PROCESSOR}")
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CPACK_PACKAGE_VERSION}-1.${CPACK_PACKAGE_ARCHITECTURE}")
endif ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment