PGM_VENDOR="Ardour"
PGM_EXEC_FILE="ardour3"
-INSTALL_DEST_BASE="/opt"
+THE_SHELL="/bin/sh"
+
+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:]')
########################################################################
# Main
########################################################################
+umask 0022
# If you double click a script, some systems don't get the PWD correct.
# Force it to be correct
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
#############################
echo "Please enter root password below"
echo ""
- if ! su -c "./.stage2.run";
+ if ! su -s $THE_SHELL -c "./.stage2.run";
then
echo ""
echo "!!! ERROR !!!"
echo "running as root AND an attempt to use su failed."
echo ""
echo "Please correct this by installing and configuring sudo or running"
- echo "the installer as root (su -c)."
+ echo "the installer as root (su -s $THE_SHELL -c)."
echo ""
read -p "Press ENTER to exit installer:" BLAH
exit 1
fi
exit
+ else
+ sudo -k # make sudo forget about cached credentials
fi
if ! sudo date;
echo "Please enter root password below"
echo ""
- if ! su -c "./.stage2.run";
+ if ! su -s $THE_SHELL -c "./.stage2.run";
then
echo ""
echo "!!! ERROR !!!"
echo "running as root AND an attempt to use both sudo and su failed."
echo ""
echo "Please correct this by installing and configuring sudo or running"
- echo "the installer as root (su -c)."
+ echo "the installer as root (su -s $THE_SHELL -c)."
echo ""
read -p "Press ENTER to exit installer:" BLAH
exit 1
# su. Using sh -c in the normal case gets around that, but is a bit of a hack.
NORM_USER="sh -c"
else
- NORM_USER="su -l $USER_NAME -c"
+ NORM_USER="su -l $USER_NAME -s $THE_SHELL -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
############################
################################
# Setup derived variables
################################
-PGM_VERSION=$(echo ${BUNDLE_DIR} | awk 'BEGIN { FS = "-" } ; { print $2 }')
-PGM_BUILD=$(echo ${BUNDLE_DIR} | awk 'BEGIN { FS = "-" } ; { print $3 }')
-PGM_BUILDTYPE=$(echo ${BUNDLE_DIR} | awk 'BEGIN { FS = "-" } ; { print $3 }')
+PGM_VERSION=$(echo ${BUNDLE_DIR} | cut -d- -f2)
+PGM_BUILDTYPE=$(echo ${BUNDLE_DIR} | cut -d- -f3)
if [ -z ${PGM_BUILDTYPE} ];
then
- PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}-${PGM_BUILD}"
+ PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}"
ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}" #no dash between name and version since dash seperates vendor from program
MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}.desktop" #no dash between name and version since dash seperates vendor from program
DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}.desktop"
else
- PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}-${PGM_BUILD}-${PGM_BUILDTYPE}"
+ PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}-${PGM_BUILDTYPE}"
ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}" #no dash between name and version since dash seperates vendor from program
MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop" #no dash between name and version since dash seperates vendor from program
DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop"
# install
echo ""
-echo "Installing ${PGM_NAME} ${PGM_VERSION} built from ${PGM_BUILD} in ${INSTALL_DEST_BASE}"
+echo "Installing ${PGM_NAME} ${PGM_VERSION} in ${INSTALL_DEST_BASE}"
echo ""
# Copy the new version in the install directory
else
echo ""
echo "!!! WARNING !!! - The version of Jack on this system is too old!"
- echo "Using an old version of Jack is not recommened. Please update"
+ echo "Using an old version of Jack is not recommended. Please update"
echo "Jack for best results."
echo ""
echo "System Jack version:"
echo " ${JACK_VER_STRING}"
echo ""
- echo "Recommened minimum versions:"
+ echo "Recommended minimum versions:"
echo " Jack1 - 0.121.3"
echo " Jack2 - 1.9.8"
echo ""