From 7ee93bc0e38b782d1eb7153bb4448ae33d81d961 Mon Sep 17 00:00:00 2001 From: "Matt T. Proud" Date: Wed, 12 Jun 2013 17:46:43 +0200 Subject: [PATCH] Include runner script for packaging. --- build/package/run_prometheus.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 build/package/run_prometheus.sh diff --git a/build/package/run_prometheus.sh b/build/package/run_prometheus.sh new file mode 100755 index 0000000000..c433453b80 --- /dev/null +++ b/build/package/run_prometheus.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# If either of the two tests below fail, you may need to install GNU coreutils +# in your environment. + +if [ ! -x "$(which readlink)" ]; then + echo "readlink tool cannot be found." > /dev/stderr + exit 1 +fi + +if [ ! -x "$(which dirname)" ]; then + echo "dirname tool cannot be found." > /dev/stderr + exit 1 +fi + +readonly binary="${0}" +readonly binary_path="$(readlink -f ${binary})" +readonly binary_directory="$(dirname ${binary_path})" + +if [ -n "${LD_LIBRARY_PATH}" ]; then + export LD_LIBRARY_PATH="${binary_directory}/lib:${LD_LIBRARY_PATH}" +fi + +if [ -n "${DYLD_LIBRARY_PATH}" ]; then + export DYLD_LIBRARY_PATH="${binary_directory}/lib:${DYLD_LIBRARY_PATH}" +fi + +"${binary_directory}/prometheus" "${@}" &