summaryrefslogtreecommitdiffstats
path: root/packaging/makeself/build.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
commitbe1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch)
tree9754ff1ca740f6346cf8483ec915d4054bc5da2d /packaging/makeself/build.sh
parentInitial commit. (diff)
downloadnetdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.tar.xz
netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.zip
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/makeself/build.sh')
-rwxr-xr-xpackaging/makeself/build.sh65
1 files changed, 65 insertions, 0 deletions
diff --git a/packaging/makeself/build.sh b/packaging/makeself/build.sh
new file mode 100755
index 00000000..3ac600ed
--- /dev/null
+++ b/packaging/makeself/build.sh
@@ -0,0 +1,65 @@
+#!/usr/bin/env sh
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# -----------------------------------------------------------------------------
+# parse command line arguments
+
+set -e
+
+export NETDATA_BUILD_WITH_DEBUG=0
+
+while [ -n "${1}" ]; do
+ case "${1}" in
+ debug)
+ export NETDATA_BUILD_WITH_DEBUG=1
+ ;;
+
+ *) ;;
+
+ esac
+
+ shift
+done
+
+# -----------------------------------------------------------------------------
+
+# First run install-alpine-packages.sh under alpine linux to install
+# the required packages. build-x86_64-static.sh will do this for you
+# using docker.
+
+mkdir -p /usr/src
+cp -va /netdata /usr/src/netdata
+chown -R root:root /usr/src/netdata
+
+cd /usr/src/netdata/packaging/makeself || exit 1
+
+git clean -dxf
+git submodule foreach --recursive git clean -dxf
+
+cat >&2 << EOF
+This program will create a self-extracting shell package containing
+a statically linked netdata, able to run on any 64bit Linux system,
+without any dependencies from the target system.
+
+It can be used to have netdata running in no-time, or in cases the
+target Linux system cannot compile netdata.
+EOF
+
+if [ ! -d tmp ]; then
+ mkdir tmp || exit 1
+else
+ rm -rf tmp/*
+fi
+
+if [ -z "${GITHUB_ACTIONS}" ]; then
+ export GITHUB_ACTIONS=false
+fi
+
+if ! ./run-all-jobs.sh "$@"; then
+ printf >&2 "Build failed."
+ exit 1
+fi
+
+mkdir -p /netdata/artifacts
+cp -va /usr/src/netdata/artifacts/* /netdata/artifacts/
+chown -R "$(stat -c '%u:%g' /netdata)" /netdata/artifacts/