summaryrefslogtreecommitdiff
path: root/tools/linux_packaging
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-12-01 23:15:12 +0100
committerRobin Gareus <robin@gareus.org>2014-12-01 23:15:12 +0100
commit859d6e20432f8f195ec68291b98bd031ea2fc2b0 (patch)
treeeb3a21b5de7b80af3d3494d251b574cda8704d47 /tools/linux_packaging
parent43cc295a585ac72209a8e76164907f92618d3979 (diff)
fix linux installer:
* allow to override install dir with environment variable. * create /opt if if it does not exist and INSTALL_DEST_BASE env is unset.
Diffstat (limited to 'tools/linux_packaging')
-rwxr-xr-xtools/linux_packaging/stage2.run42
1 files changed, 26 insertions, 16 deletions
diff --git a/tools/linux_packaging/stage2.run b/tools/linux_packaging/stage2.run
index 6af5b34181..06c16c0051 100755
--- a/tools/linux_packaging/stage2.run
+++ b/tools/linux_packaging/stage2.run
@@ -14,7 +14,13 @@ PGM_NAME="Ardour"
PGM_VENDOR="Ardour"
PGM_EXEC_FILE="ardour3"
-INSTALL_DEST_BASE="/opt"
+if test -z "$INSTALL_DEST_BASE"; then
+ INSTALL_DEST_BASE="/opt"
+ CALL_MKDIR=1
+else
+ CALL_MKDIR=
+fi
+
USER_BIN_DIR="/usr/local/bin"
PGM_NAME_LOWER=$(echo $PGM_NAME | tr '[:upper:]' '[:lower:]')
@@ -113,21 +119,6 @@ echo "Welcome to the ${PGM_NAME} installer"
echo ""
echo "${PGM_NAME} will be installed for user ${USER_NAME} in ${INSTALL_DEST_BASE}"
echo ""
-
-###############################
-# Check for install destination
-###############################
-
-if [ ! -d ${INSTALL_DEST_BASE} ];
-then
- echo ""
- echo "!!! ERROR !!! - Installation location ${INSTALL_DEST_BASE} does not exist!"
- echo "Installation will not complete."
- echo ""
- read -p "Press ENTER to exit installer:" BLAH
- exit 1
-fi
-
#############################
# Check for root privileges
#############################
@@ -195,6 +186,25 @@ else
NORM_USER="su -l $USER_NAME -c"
fi
+###############################
+# Check for install destination
+###############################
+
+if test -n "$CALL_MKDIR"; then
+ ${SUPER} mkdir -p "$INSTALL_DEST_BASE"
+fi
+
+if [ ! -d ${INSTALL_DEST_BASE} ];
+then
+ echo ""
+ echo "!!! ERROR !!! - Installation location ${INSTALL_DEST_BASE} does not exist!"
+ echo "Installation will not complete."
+ echo ""
+ read -p "Press ENTER to exit installer:" BLAH
+ exit 1
+fi
+
+
############################
# Determine processor type
############################