diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-07-10 10:01:49 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-07-10 10:01:49 +0200 |
| commit | a618dee15cce0216b9288173e1d6ce6545d8bc3b (patch) | |
| tree | 7f2e2fe71534070ea01a4f6c61ea7ad91b95747e | |
| parent | 8b48773176bdcc89756e90e6d597fdf6a5c9ae7e (diff) | |
| download | box64-a618dee15cce0216b9288173e1d6ce6545d8bc3b.tar.gz box64-a618dee15cce0216b9288173e1d6ce6545d8bc3b.zip | |
Refined .deb build script with arch naming and postinst
| -rwxr-xr-x | CMakeLists.txt | 10 | ||||
| -rwxr-xr-x | postinst | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 64825f4e..1760c849 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 00000000..c0dedd6e --- /dev/null +++ b/postinst @@ -0,0 +1,2 @@ +#!/bin/sh +systemctl restart systemd-binfmt |