Skip to content

Commit a618dee

Browse files
committed
Refined .deb build script with arch naming and postinst
1 parent 8b48773 commit a618dee

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CMakeLists.txt

+10
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,16 @@ string(REGEX MATCH "[0-9]" BOX64_REVISION ${TEMP_STRING})
475475
set(CPACK_PACKAGE_VERSION_MAJOR ${BOX64_MAJOR})
476476
set(CPACK_PACKAGE_VERSION_MINOR ${BOX64_MINOR})
477477
set(CPACK_PACKAGE_VERSION_PATCH ${BOX64_REVISION})
478+
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst")
479+
if(_aarch64)
480+
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
481+
elseif(_x86_64)
482+
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "x86_64")
483+
else()
484+
#probably wrong...
485+
execute_process(COMMAND "dpkg --print-architecture" OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
486+
endif()
487+
set(CPACK_DEBIAN_FILE_NAME "${BOX64}-${BOX64_MAJOR}.${BOX64_MINOR}.${BOX64_REVISION}_Linux-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
478488
INCLUDE(CPack)
479489

480490
add_test(test01 ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64}

postinst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
systemctl restart systemd-binfmt

0 commit comments

Comments
 (0)