From 98ed3d79fd8397e307fdab7512d5e1fa4abcee91 Mon Sep 17 00:00:00 2001 From: Zack T Date: Mon, 8 Jan 2018 13:14:15 -0700 Subject: [PATCH] v1.1 = Using the build script to edit the deployment scripts + Set the install directory based on the Major Version in install_SPSS.sh + Set the version that is being updated based on the Major Version in update_SPSS.sh --- Software/SPSS Statistics/build_SPSS.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Software/SPSS Statistics/build_SPSS.sh b/Software/SPSS Statistics/build_SPSS.sh index aeccc4c..9d3e205 100644 --- a/Software/SPSS Statistics/build_SPSS.sh +++ b/Software/SPSS Statistics/build_SPSS.sh @@ -3,9 +3,9 @@ ################################################################################################### # Script Name: build_SPSS.sh # By: Zack Thompson / Created: 1/5/2018 -# Version: 1.0 / Updated: 1/5/2018 / By: ZT +# Version: 1.1 / Updated: 1/8/2018 / By: ZT # -# Description: This script uses munkpkg to build an SPSS Package. +# Description: This script uses munkpkg to build an SPSS package. # ################################################################################################### @@ -16,13 +16,17 @@ softwareTitle="SPSSStatistics" -# Set working directory - scriptDirectory=$(/usr/bin/dirname "$(/usr/bin/stat -f "$0")") # Switches switch1="${1}" # Build Type switch2="${2}" # Version switch3="${3}" # Version Value +# Set working directory + scriptDirectory=$(/usr/bin/dirname "$(/usr/bin/stat -f "$0")") + +# Get the Major Version + majorVersion=$(/bin/echo "${switch3}" | /usr/bin/awk -F "." '{print $1}') + ################################################## # Setup Functions @@ -71,6 +75,9 @@ case $switch1 in /bin/cp "${scriptDirectory}"/install_SPSS.sh "${scriptDirectory}"/scripts/postinstall /bin/cp "${scriptDirectory}"/build/$switch3/* "${scriptDirectory}"/scripts/ + # Set the desired install directory + /usr/bin/sed -i '' 's,USER_INSTALL_DIR=,'"USER_INSTALL_DIR=/Applications/SPSS Statistics ${majorVersion}/"',' "${scriptDirectory}"/scripts/installer.properties + # Function munkiBuild munkiBuild ;; @@ -78,6 +85,9 @@ case $switch1 in /bin/cp "${scriptDirectory}"/update_SPSS.sh "${scriptDirectory}"/scripts/postinstall /bin/cp "${scriptDirectory}"/build/$switch3/* "${scriptDirectory}"/scripts/ + # Set the version in the update_SPSS.sh script + /usr/bin/sed -i '' 's/version=/'"version=${majorVersion}"'/' "${scriptDirectory}"/scripts/update_SPSS.sh + # Function munkiBuild munkiBuild ;;