about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-07-10 10:01:49 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-07-10 10:01:49 +0200
commita618dee15cce0216b9288173e1d6ce6545d8bc3b (patch)
tree7f2e2fe71534070ea01a4f6c61ea7ad91b95747e
parent8b48773176bdcc89756e90e6d597fdf6a5c9ae7e (diff)
downloadbox64-a618dee15cce0216b9288173e1d6ce6545d8bc3b.tar.gz
box64-a618dee15cce0216b9288173e1d6ce6545d8bc3b.zip
Refined .deb build script with arch naming and postinst
-rwxr-xr-xCMakeLists.txt10
-rwxr-xr-xpostinst2
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