Skip to content
Snippets Groups Projects
Commit fdfb5841 authored by dpuzyrkov's avatar dpuzyrkov
Browse files

[*] deb arch fixed.

parent 82278ca5
No related branches found
No related tags found
3 merge requests!974bugfix-8996,!873Hotfix 8568,!522[+] Version from version file, proper debian packages arch. Project.yaml dep file added. All submodules to its develop last.
...@@ -12,9 +12,11 @@ SET( CPACK_PACKAGE_VERSION_MAJOR 5) ...@@ -12,9 +12,11 @@ SET( CPACK_PACKAGE_VERSION_MAJOR 5)
SET( CPACK_PACKAGE_VERSION_MINOR 2) SET( CPACK_PACKAGE_VERSION_MINOR 2)
SET( CPACK_PACKAGE_VERSION_PATCH 0) SET( CPACK_PACKAGE_VERSION_PATCH 0)
SET( CPACK_SYSTEM_ARCH ${CMAKE_SYSTEM_PROCESSOR}) #possible need be setted during crosscompily
SET( CPACK_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}") #by default it uses dpkg --print-architecture
SET( CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}") #we ok with it on native builds.
#SET( CPACK_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
#SET( CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
# init CellFrame SDK # init CellFrame SDK
add_definitions("-DDAP_VERSION=\"${CPACK_PACKAGE_VERSION_MAJOR}-${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\"") add_definitions("-DDAP_VERSION=\"${CPACK_PACKAGE_VERSION_MAJOR}-${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\"")
...@@ -81,20 +83,42 @@ if(UNIX) ...@@ -81,20 +83,42 @@ if(UNIX)
if(LINUX) if(LINUX)
message("[*] Debian package setup for ${CPACK_PACKAGE_ARCHITECTURE}")
SET( CPACK_GENERATOR "DEB") SET( CPACK_GENERATOR "DEB")
SET( CPACK_SYSTEM_TYPE "Debian") SET( CPACK_SYSTEM_TYPE "Debian")
SET( CPACK_SYSTEM_VERSION "${DEBIAN_OS_VERSION}") SET( CPACK_SYSTEM_VERSION "${DEBIAN_OS_VERSION}")
SET( CPACK_SYSTEM_CODENAME "${DEBIAN_OS_NAME}") SET( CPACK_SYSTEM_CODENAME "${DEBIAN_OS_NAME}")
SET( CPACK_SYSTEM_NAME "${CPACK_SYSTEM_ARCH}")
# set architecture
find_program(DPKG_CMD dpkg)
if(NOT CPACK_SYSTEM_NAME)
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_PROCESSOR})
# sanity check
if(CPACK_SYSTEM_NAME STREQUAL x86_64)
set(CPACK_SYSTEM_NAME amd64)
endif()
endif()
if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
if(NOT DPKG_CMD)
message(WARNING "DEB Generator: Can't find dpkg in your path. Setting CPACK_DEBIAN_PACKAGE_ARCHITECTURE to i386.")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
else()
execute_process(COMMAND "${DPKG_CMD}" --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
endif()
SET( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH}")
if(BUILD_WITH_GDB_DRIVER_PGSQL) if(BUILD_WITH_GDB_DRIVER_PGSQL)
SET( CPACK_SYSTEM_NAME "${CPACK_SYSTEM_NAME}-pgsql" ) SET( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}-pgsql" )
endif() endif()
if(CMAKE_BUILD_TYPE MATCHES Debug) if(CMAKE_BUILD_TYPE MATCHES Debug)
SET( CPACK_SYSTEM_NAME "${CPACK_SYSTEM_NAME}-dbg" ) SET( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}-dbg" )
endif() endif()
SET( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH}")
SET( CPACK_DEBIAN_PACKAGE_MAINTAINER "Dmitriy Gerasimov <naeper@demlabs.net>" ) SET( CPACK_DEBIAN_PACKAGE_MAINTAINER "Dmitriy Gerasimov <naeper@demlabs.net>" )
SET( CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "CellFrame Node software https://cellframe.net" ) SET( CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "CellFrame Node software https://cellframe.net" )
SET( CPACK_DEBIAN_PACKAGE_DESCRIPTION "CellFrame Node" ) SET( CPACK_DEBIAN_PACKAGE_DESCRIPTION "CellFrame Node" )
...@@ -106,12 +130,14 @@ if(UNIX) ...@@ -106,12 +130,14 @@ if(UNIX)
SET( CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) SET( CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
endif() endif()
message("[*] Debian package setup target=${CPACK_SYSTEM_NAME} pkgarch=${CPACK_DEBIAN_PACKAGE_ARCHITECTURE} version=${CPACK_PACKAGE_VERSION}")
SET( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA SET( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR}/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debian/postrm;${CMAKE_CURRENT_SOURCE_DIR}/debian/templates;${CMAKE_CURRENT_SOURCE_DIR}/debian/config;") "${CMAKE_CURRENT_SOURCE_DIR}/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debian/postrm;${CMAKE_CURRENT_SOURCE_DIR}/debian/templates;${CMAKE_CURRENT_SOURCE_DIR}/debian/config;")
elseif(BSD) elseif(BSD)
message("[*] BSD family system ${CMAKE_SYSTEM} ") message("[*] BSD family system ${CMAKE_SYSTEM} ")
elseif(DARWIN) elseif(DARWIN)
message("[*] Darwin kernel (MacOS/iOS) ") message("[*] Darwin kernel (MacOS/iOS) ")
else() else()
message("[!] Unknown UNIX") message("[!] Unknown UNIX")
endif() endif()
...@@ -448,3 +474,4 @@ else() ...@@ -448,3 +474,4 @@ else()
endif() endif()
INCLUDE(CPack) INCLUDE(CPack)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment