From 7daeee141d235b53b4b3c1b825acaf06a0cf19c9 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 8 Jun 2021 15:57:13 +0200 Subject: `make dist` * fixed run_tests.sh file check bug, CI compat * updated results due to libnDPI submodule update Signed-off-by: Toni Uhlig --- scripts/make-dist.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/make-dist.sh (limited to 'scripts/make-dist.sh') diff --git a/scripts/make-dist.sh b/scripts/make-dist.sh new file mode 100755 index 000000000..b978aeb65 --- /dev/null +++ b/scripts/make-dist.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -e + +LOCKFILE="$(realpath "${0}").lock" +touch "${LOCKFILE}" +exec 42< "${LOCKFILE}" +flock -x -n 42 || { + printf '%s\n' "Could not aquire file lock for ${0}. Already running instance?" >&2; + exit 1; +} + +cd "$(dirname "${0}")/.." +if [ ! -d ./.git ]; then + printf '%s\n' "This script can only by run from a nDPId git repository." >&2 +fi + +git submodule update --init ./libnDPI +NDPID_GIT_VERSION="$(git describe --tags)" +cd ./libnDPI && \ + LIBNDPI_GIT_VERSION="$(git describe --tags)" + git archive --prefix="nDPId-${NDPID_GIT_VERSION}/libnDPI/" -o "../libnDPI-${LIBNDPI_GIT_VERSION}.tar" HEAD && \ + cd .. +git archive --prefix="nDPId-${NDPID_GIT_VERSION}/" -o "./nDPId-${NDPID_GIT_VERSION}.tar" HEAD +tar --concatenate --file="./nDPId-${NDPID_GIT_VERSION}.tar" "./libnDPI-${LIBNDPI_GIT_VERSION}.tar" +bzip2 -9 "./nDPId-${NDPID_GIT_VERSION}.tar" + +rm -f "${LOCKFILE}" -- cgit v1.2.3