mirror of
https://github.com/utoni/nDPId.git
synced 2026-05-17 03:56:43 +00:00
Some checks failed
ArchLinux PKGBUILD / build (push) Waiting to run
CentOs / centos8 (push) Waiting to run
FreeBSD Build / Build and Test (push) Waiting to run
RPM Build / build (push) Waiting to run
Build / macOS-14 cc (push) Waiting to run
Build / ubuntu-latest clang (push) Waiting to run
Build / ubuntu-latest clang-1 (push) Waiting to run
Build / ubuntu-22.04 clang-12 (push) Waiting to run
Build / ubuntu-latest gcc (push) Waiting to run
Build / ubuntu-latest gcc-1 (push) Waiting to run
Build / ubuntu-latest gcc-2 (push) Waiting to run
Build / ubuntu-22.04 gcc-10 (push) Waiting to run
Build / ubuntu-22.04 gcc-9 (push) Waiting to run
SonarQube Scan / Build and analyze (push) Waiting to run
OpenWrt Build / arm_cortex-a15_neon-vfpv4 armvirt-32 (push) Has been cancelled
OpenWrt Build / arm_cortex-a9_vfpv3-d16 mvebu-cortexa9 (push) Has been cancelled
OpenWrt Build / x86_64 x86-64 (push) Has been cancelled
- updated deprecated Github Actions checkout/upload-artifact Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
32 lines
1.2 KiB
Bash
Executable file
32 lines
1.2 KiB
Bash
Executable file
#!/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
|
|
exit 1;
|
|
fi
|
|
|
|
git submodule update --init ./libnDPI
|
|
NDPID_GIT_VERSION="$(git describe --tags || printf '%s' 'unknown')"
|
|
cd ./libnDPI && \
|
|
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 ..
|
|
git archive --prefix="nDPId-${NDPID_GIT_VERSION}/" -o "./nDPId-${NDPID_GIT_VERSION}.tar" HEAD
|
|
printf '%s\n' "Creating $(realpath ./nDPId-${NDPID_GIT_VERSION}.tar)"
|
|
tar --concatenate --file="./nDPId-${NDPID_GIT_VERSION}.tar" "./libnDPI-${LIBNDPI_GIT_VERSION}.tar"
|
|
printf '%s\n' "Creating $(realpath ./nDPId-${NDPID_GIT_VERSION}.tar.bz2)"
|
|
bzip2 -f -9 "./nDPId-${NDPID_GIT_VERSION}.tar"
|
|
|
|
rm -f "${LOCKFILE}"
|