summaryrefslogtreecommitdiffstats
path: root/Modules/CPack.RuntimeScript.in
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CPack.RuntimeScript.in')
-rwxr-xr-xModules/CPack.RuntimeScript.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/Modules/CPack.RuntimeScript.in b/Modules/CPack.RuntimeScript.in
index 1ce43bc..fc3444a 100755
--- a/Modules/CPack.RuntimeScript.in
+++ b/Modules/CPack.RuntimeScript.in
@@ -5,6 +5,26 @@
CWD="`dirname \"$0\"`"
TMP=/tmp/$UID/TemporaryItems
+version=`sw_vers -productVersion`
+if [ "$?" == "0" ]; then
+ major=${version%%\.*}
+ rest=${version#*\.}
+ minor=${rest%%\.*}
+ build=${rest#*\.}
+else
+ major=10
+ minor=4
+ build=0
+fi
+
+echo $version
+echo "Major = $major"
+echo "Minor = $minor"
+echo "Build = $build"
+
+
+# if 10.5 or greater, then all the open-x11 stuff need not occur
+if ((( $major < 10 )) || ((( $major == 10)) && (( $minor < 5 )))); then
ps -wx -ocommand | grep -e '[X]11.app' > /dev/null
if [ "$?" != "0" -a ! -f ~/.xinitrc ]; then
echo "rm -f ~/.xinitrc" > ~/.xinitrc
@@ -42,4 +62,5 @@ echo "$@" > /tmp/arguments.log
if echo $1 | grep -- "^-psn_"; then
shift
fi
+fi
exec "$CWD/bin/@CPACK_EXECUTABLE_NAME@" "$@" > /tmp/slicer.output 2>&1