summaryrefslogtreecommitdiffstats
path: root/packaging/makeself/jobs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-05-21 18:55:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-05-21 18:55:22 +0000
commit61d0027904ee9c040985b1642ca228737d616d03 (patch)
treec90838c137b4dc4a2de1cff9f2d7be5552d605e7 /packaging/makeself/jobs
parentAdding upstream version 1.14.0. (diff)
downloadnetdata-61d0027904ee9c040985b1642ca228737d616d03.tar.xz
netdata-61d0027904ee9c040985b1642ca228737d616d03.zip
Adding upstream version 1.15.0.upstream/1.15.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/makeself/jobs')
-rwxr-xr-xpackaging/makeself/jobs/10-prepare-destination.install.sh16
-rwxr-xr-xpackaging/makeself/jobs/50-bash-4.4.18.install.sh54
-rwxr-xr-xpackaging/makeself/jobs/50-curl-7.60.0.install.sh34
-rwxr-xr-xpackaging/makeself/jobs/50-fping-4.2.install.sh29
-rwxr-xr-xpackaging/makeself/jobs/50-ioping-1.1.install.sh18
-rwxr-xr-xpackaging/makeself/jobs/70-netdata-git.install.sh26
-rwxr-xr-xpackaging/makeself/jobs/99-makeself.install.sh99
7 files changed, 276 insertions, 0 deletions
diff --git a/packaging/makeself/jobs/10-prepare-destination.install.sh b/packaging/makeself/jobs/10-prepare-destination.install.sh
new file mode 100755
index 000000000..06dc82f29
--- /dev/null
+++ b/packaging/makeself/jobs/10-prepare-destination.install.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+
+[ -d "${NETDATA_INSTALL_PATH}.old" ] && run rm -rf "${NETDATA_INSTALL_PATH}.old"
+[ -d "${NETDATA_INSTALL_PATH}" ] && run mv -f "${NETDATA_INSTALL_PATH}" "${NETDATA_INSTALL_PATH}.old"
+
+run mkdir -p "${NETDATA_INSTALL_PATH}/bin"
+run mkdir -p "${NETDATA_INSTALL_PATH}/usr"
+run cd "${NETDATA_INSTALL_PATH}"
+run ln -s bin sbin
+run cd "${NETDATA_INSTALL_PATH}/usr"
+run ln -s ../bin bin
+run ln -s ../sbin sbin
+run ln -s . local
diff --git a/packaging/makeself/jobs/50-bash-4.4.18.install.sh b/packaging/makeself/jobs/50-bash-4.4.18.install.sh
new file mode 100755
index 000000000..a762d37ae
--- /dev/null
+++ b/packaging/makeself/jobs/50-bash-4.4.18.install.sh
@@ -0,0 +1,54 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+
+fetch "bash-4.4.18" "http://ftp.gnu.org/gnu/bash/bash-4.4.18.tar.gz"
+
+run ./configure \
+ --prefix=${NETDATA_INSTALL_PATH} \
+ --without-bash-malloc \
+ --enable-static-link \
+ --enable-net-redirections \
+ --enable-array-variables \
+ --disable-profiling \
+ --disable-nls \
+# --disable-rpath \
+# --enable-alias \
+# --enable-arith-for-command \
+# --enable-array-variables \
+# --enable-brace-expansion \
+# --enable-casemod-attributes \
+# --enable-casemod-expansions \
+# --enable-command-timing \
+# --enable-cond-command \
+# --enable-cond-regexp \
+# --enable-directory-stack \
+# --enable-dparen-arithmetic \
+# --enable-function-import \
+# --enable-glob-asciiranges-default \
+# --enable-help-builtin \
+# --enable-job-control \
+# --enable-net-redirections \
+# --enable-process-substitution \
+# --enable-progcomp \
+# --enable-prompt-string-decoding \
+# --enable-readline \
+# --enable-select \
+
+
+run make clean
+run make -j$(find_processors)
+
+cat >examples/loadables/Makefile <<EOF
+all:
+clean:
+install:
+EOF
+
+run make install
+
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
+then
+ run strip ${NETDATA_INSTALL_PATH}/bin/bash
+fi
diff --git a/packaging/makeself/jobs/50-curl-7.60.0.install.sh b/packaging/makeself/jobs/50-curl-7.60.0.install.sh
new file mode 100755
index 000000000..c91598251
--- /dev/null
+++ b/packaging/makeself/jobs/50-curl-7.60.0.install.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+
+fetch "curl-curl-7_60_0" "https://github.com/curl/curl/archive/curl-7_60_0.tar.gz"
+
+export LDFLAGS="-static"
+export PKG_CONFIG="pkg-config --static"
+
+run ./buildconf
+
+run ./configure \
+ --prefix=${NETDATA_INSTALL_PATH} \
+ --enable-optimize \
+ --disable-shared \
+ --enable-static \
+ --enable-http \
+ --enable-proxy \
+ --enable-ipv6 \
+ --enable-cookies \
+ ${NULL}
+
+# Curl autoconf does not honour the curl_LDFLAGS environment variable
+run sed -i -e "s/curl_LDFLAGS =/curl_LDFLAGS = -all-static/" src/Makefile
+
+run make clean
+run make -j$(find_processors)
+run make install
+
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
+then
+ run strip ${NETDATA_INSTALL_PATH}/bin/curl
+fi
diff --git a/packaging/makeself/jobs/50-fping-4.2.install.sh b/packaging/makeself/jobs/50-fping-4.2.install.sh
new file mode 100755
index 000000000..a137753d8
--- /dev/null
+++ b/packaging/makeself/jobs/50-fping-4.2.install.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+
+fetch "fping-4.2" "https://github.com/schweikert/fping/releases/download/v4.2/fping-4.2.tar.gz"
+
+export CFLAGS="-static"
+
+run ./configure \
+ --prefix=${NETDATA_INSTALL_PATH} \
+ --enable-ipv4 \
+ --enable-ipv6 \
+ ${NULL}
+
+cat >doc/Makefile <<EOF
+all:
+clean:
+install:
+EOF
+
+run make clean
+run make -j$(find_processors)
+run make install
+
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
+then
+ run strip ${NETDATA_INSTALL_PATH}/bin/fping
+fi
diff --git a/packaging/makeself/jobs/50-ioping-1.1.install.sh b/packaging/makeself/jobs/50-ioping-1.1.install.sh
new file mode 100755
index 000000000..83c778c15
--- /dev/null
+++ b/packaging/makeself/jobs/50-ioping-1.1.install.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+
+fetch "netdata-ioping-43d15a5" "https://github.com/netdata/ioping/tarball/master"
+
+export CFLAGS="-static"
+
+run make clean
+run make -j$(find_processors)
+run mkdir -p ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/
+run install -o root -g root -m 4750 ioping ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/
+
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
+then
+ run strip ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/ioping
+fi
diff --git a/packaging/makeself/jobs/70-netdata-git.install.sh b/packaging/makeself/jobs/70-netdata-git.install.sh
new file mode 100755
index 000000000..71ea0f63a
--- /dev/null
+++ b/packaging/makeself/jobs/70-netdata-git.install.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+. ${NETDATA_MAKESELF_PATH}/functions.sh "${@}" || exit 1
+
+cd "${NETDATA_SOURCE_PATH}" || exit 1
+
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
+then
+ export CFLAGS="-static -O3"
+else
+ export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness -fstack-protector-all -D_FORTIFY_SOURCE=2 -DNETDATA_INTERNAL_CHECKS=1"
+# export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness"
+fi
+
+run ./netdata-installer.sh --install "${NETDATA_INSTALL_PARENT}" \
+ --dont-wait \
+ --dont-start-it \
+ ${NULL}
+
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
+then
+ run strip ${NETDATA_INSTALL_PATH}/bin/netdata
+ run strip ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/apps.plugin
+ run strip ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/cgroup-network
+fi
diff --git a/packaging/makeself/jobs/99-makeself.install.sh b/packaging/makeself/jobs/99-makeself.install.sh
new file mode 100755
index 000000000..f3056e6ac
--- /dev/null
+++ b/packaging/makeself/jobs/99-makeself.install.sh
@@ -0,0 +1,99 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+
+run cd "${NETDATA_SOURCE_PATH}" || exit 1
+
+# -----------------------------------------------------------------------------
+# find the netdata version
+
+VERSION="$(git describe 2>/dev/null)"
+if [ -z "${VERSION}" ]; then
+ VERSION=$(cat packaging/version)
+fi
+
+if [ "${VERSION}" == "" ]; then
+ echo >&2 "Cannot find version number. Create makeself executable from source code with git tree structure."
+ exit 1
+fi
+
+# -----------------------------------------------------------------------------
+# copy the files needed by makeself installation
+
+run mkdir -p "${NETDATA_INSTALL_PATH}/system"
+
+run cp \
+ packaging/makeself/post-installer.sh \
+ packaging/makeself/install-or-update.sh \
+ packaging/installer/functions.sh \
+ configs.signatures \
+ system/netdata-init-d \
+ system/netdata-lsb \
+ system/netdata-openrc \
+ system/netdata.logrotate \
+ system/netdata.service \
+ "${NETDATA_INSTALL_PATH}/system/"
+
+
+# -----------------------------------------------------------------------------
+# create a wrapper to start our netdata with a modified path
+
+run mkdir -p "${NETDATA_INSTALL_PATH}/bin/srv"
+
+run mv "${NETDATA_INSTALL_PATH}/bin/netdata" \
+ "${NETDATA_INSTALL_PATH}/bin/srv/netdata" || exit 1
+
+cat >"${NETDATA_INSTALL_PATH}/bin/netdata" <<EOF
+#!${NETDATA_INSTALL_PATH}/bin/bash
+export NETDATA_BASH_LOADABLES="DISABLE"
+export PATH="${NETDATA_INSTALL_PATH}/bin:\${PATH}"
+exec "${NETDATA_INSTALL_PATH}/bin/srv/netdata" "\${@}"
+EOF
+run chmod 755 "${NETDATA_INSTALL_PATH}/bin/netdata"
+
+
+# -----------------------------------------------------------------------------
+# remove the links to allow untaring the archive
+
+run rm "${NETDATA_INSTALL_PATH}/sbin" \
+ "${NETDATA_INSTALL_PATH}/usr/bin" \
+ "${NETDATA_INSTALL_PATH}/usr/sbin" \
+ "${NETDATA_INSTALL_PATH}/usr/local"
+
+
+# -----------------------------------------------------------------------------
+# create the makeself archive
+
+run sed "s|NETDATA_VERSION|${VERSION}|g" <"${NETDATA_MAKESELF_PATH}/makeself.lsm" >"${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"
+
+run "${NETDATA_MAKESELF_PATH}/makeself.sh" \
+ --gzip \
+ --complevel 9 \
+ --notemp \
+ --needroot \
+ --target "${NETDATA_INSTALL_PATH}" \
+ --header "${NETDATA_MAKESELF_PATH}/makeself-header.sh" \
+ --lsm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp" \
+ --license "${NETDATA_MAKESELF_PATH}/makeself-license.txt" \
+ --help-header "${NETDATA_MAKESELF_PATH}/makeself-help-header.txt" \
+ "${NETDATA_INSTALL_PATH}" \
+ "${NETDATA_INSTALL_PATH}.gz.run" \
+ "netdata, the real-time performance and health monitoring system" \
+ ./system/post-installer.sh \
+ ${NULL}
+
+run rm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"
+
+# -----------------------------------------------------------------------------
+# copy it to the netdata build dir
+
+FILE="netdata-${VERSION}.gz.run"
+
+run mkdir -p artifacts
+run mv "${NETDATA_INSTALL_PATH}.gz.run" "artifacts/${FILE}"
+
+[ -f netdata-latest.gz.run ] && rm netdata-latest.gz.run
+run ln -s "artifacts/${FILE}" netdata-latest.gz.run
+
+echo >&2 "Self-extracting installer moved to 'artifacts/${FILE}'"