Skip to content

Commit

Permalink
build: support 'make deb'
Browse files Browse the repository at this point in the history
Problem: The 'make deb' target was dropped in the conversion to cmake,
but having an easy way to build test .deb packages has become an
essential component of testing.

Add a custom 'deb' target to CmakeLists.txt. Since this target requires
'make dist', add a 'dist' custom target as well.

Some versions of git do not support the `--add-virtual-file` option,
so instead of using that to add the flux-sched.ver file to the archive,
just create the file, add it, and subsequently remove it.

Fixes #1072
  • Loading branch information
grondo committed Sep 28, 2023
1 parent ba59913 commit 32ebb75
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,25 @@ add_custom_target(check
)
add_custom_target(installcheck
COMMAND env FLUX_SCHED_TEST_INSTALLED=1 ${CMAKE_CTEST_COMMAND} ${CTEST_COMMON_FLAGS})
add_custom_target(dist
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND echo ${FLUX_SCHED_VER} > flux-sched.ver
COMMAND git archive --format=tar.gz
--add-file=flux-sched.ver
--prefix=flux-sched-${FLUX_SCHED_VER}/
--output=${CMAKE_BINARY_DIR}/flux-sched-${FLUX_SCHED_VER}.tar.gz
HEAD .
COMMAND rm flux-sched.ver
COMMENT "Generated flux-sched-${FLUX_SCHED_VER}.tar.gz"
)
# run installcheck, if it passes then write out version information and pack up
# a tarball with the result
add_custom_target(distcheck
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target all
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target check
COMMAND git archive --format=tar.gz
--add-virtual-file=flux-sched.ver:${FLUX_SCHED_VER}
--prefix=flux-sched-${FLUX_SCHED_VER}/
--output=${CMAKE_BINARY_DIR}/flux-sched-${FLUX_SCHED_VER}.tar.gz
HEAD .
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target dist
)
add_custom_target(deb
COMMAND ${CMAKE_SOURCE_DIR}/scripts/debbuild.sh ${CMAKE_SOURCE_DIR}
)

0 comments on commit 32ebb75

Please sign in to comment.