diff --git a/CMakeLists.txt b/CMakeLists.txt index 64825f4e2..1760c849a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -475,6 +475,16 @@ string(REGEX MATCH "[0-9]" BOX64_REVISION ${TEMP_STRING}) set(CPACK_PACKAGE_VERSION_MAJOR ${BOX64_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${BOX64_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${BOX64_REVISION}) +set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst") +if(_aarch64) + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64") +elseif(_x86_64) + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "x86_64") +else() + #probably wrong... + execute_process(COMMAND "dpkg --print-architecture" OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE) +endif() +set(CPACK_DEBIAN_FILE_NAME "${BOX64}-${BOX64_MAJOR}.${BOX64_MINOR}.${BOX64_REVISION}_Linux-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") INCLUDE(CPack) add_test(test01 ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} diff --git a/postinst b/postinst new file mode 100755 index 000000000..c0dedd6e0 --- /dev/null +++ b/postinst @@ -0,0 +1,2 @@ +#!/bin/sh +systemctl restart systemd-binfmt