diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-07-18 01:21:18 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-07-18 01:25:06 +0200 |
commit | 22ba5d5103c7b1c00a416a89432e98fbd938d77c (patch) | |
tree | 2c2b792083187d849fe1e78e9593c991284305bd /scripts | |
parent | 7217b90cd1c88daf44f02c9c408ebf707cbdaec4 (diff) |
Improved OpenWrt Makefile: set an optional libnDPI commit hash
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/get-and-build-libndpi.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/get-and-build-libndpi.sh b/scripts/get-and-build-libndpi.sh index 25f1916cc..102909d18 100755 --- a/scripts/get-and-build-libndpi.sh +++ b/scripts/get-and-build-libndpi.sh @@ -7,7 +7,12 @@ WGET_EXEC="$(command -v wget || printf '%s' "")" UNZIP_EXEC="$(command -v unzip || printf '%s' "")" MAKE_EXEC="$(command -v make || printf '%s' "")" -GITHUB_FALLBACK_URL='https://github.com/ntop/nDPI/archive/refs/heads/dev.zip' +if [ -z "${NDPI_COMMIT_HASH}" ]; then + NDPI_COMMIT_HASH="dev" + GITHUB_FALLBACK_URL='https://github.com/ntop/nDPI/archive/refs/heads/dev.zip' +else + GITHUB_FALLBACK_URL="https://github.com/ntop/nDPI/archive/${NDPI_COMMIT_HASH}.zip" +fi if [ -z "${GIT_EXEC}" -o -z "${WGET_EXEC}" -o -z "${UNZIP_EXEC}" -o -z "${MAKE_EXEC}" ]; then printf '%s\n' "Required Executables missing: git, wget, unzip, make" >&2 @@ -44,6 +49,7 @@ ADDITIONAL_ARGS=${ADDITIONAL_ARGS:-} MAKE_PROGRAM=${MAKE_PROGRAM:-} MAKEFLAGS=${MAKEFLAGS} DEST_INSTALL=${DEST_INSTALL:-} +NDPI_COMMIT_HASH=${NDPI_COMMIT_HASH:-} ----------------------------------- EOF @@ -75,10 +81,10 @@ if [ ${GIT_SUCCESS} -eq 0 ]; then printf 'URL: %s\n' "${GITHUB_FALLBACK_URL}" printf '%s\n' '-----------------------------------' set -x - wget "${GITHUB_FALLBACK_URL}" -O ./libnDPI-github-dev.zip - unzip ./libnDPI-github-dev.zip + wget "${GITHUB_FALLBACK_URL}" -O ./libnDPI-github-${NDPI_COMMIT_HASH}.zip + unzip ./libnDPI-github-${NDPI_COMMIT_HASH}.zip rm -rf ./libnDPI - mv ./nDPI-dev ./libnDPI + mv ./nDPI-${NDPI_COMMIT_HASH} ./libnDPI fi cd ./libnDPI |