diff --git a/CMakeLists.txt b/CMakeLists.txt index 97939faa5..5401c6c01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,15 +211,17 @@ add_dependencies(nDPId umask_check) add_custom_target(dist) add_custom_command( TARGET dist + PRE_BUILD COMMAND "${CMAKE_SOURCE_DIR}/scripts/make-dist.sh" ) add_custom_target(daemon) add_custom_command( - TARGET daemon + TARGET daemon + POST_BUILD COMMAND env nDPIsrvd_ARGS='-C 1024' "${CMAKE_SOURCE_DIR}/scripts/daemon.sh" "$" "$" - DEPENDS nDPId nDPIsrvd ) +add_dependencies(daemon nDPId nDPIsrvd) if(CMAKE_CROSSCOMPILING) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/scripts/make-dist.sh b/scripts/make-dist.sh index 67578e504..921eacb54 100755 --- a/scripts/make-dist.sh +++ b/scripts/make-dist.sh @@ -19,7 +19,7 @@ fi git submodule update --init ./libnDPI NDPID_GIT_VERSION="$(git describe --tags || printf '%s' 'unknown')" cd ./libnDPI && \ - LIBNDPI_GIT_VERSION="$(git describe --tags || printf '%s' 'unknown')" && \ + LIBNDPI_GIT_VERSION="$(git tag --list '[0-9].[0-9]' | tail -n1 || printf '%s' 'unknown')-$(git rev-parse --short HEAD)" && \ printf '%s\n' "Creating $(realpath ./libnDPI-${LIBNDPI_GIT_VERSION}.tar)" && \ git archive --prefix="nDPId-${NDPID_GIT_VERSION}/libnDPI/" -o "../libnDPI-${LIBNDPI_GIT_VERSION}.tar" HEAD && \ cd ..