summaryrefslogtreecommitdiffstats
path: root/games/typhoon_2001/typhoon_2001
diff options
context:
space:
mode:
Diffstat (limited to 'games/typhoon_2001/typhoon_2001')
-rw-r--r--games/typhoon_2001/typhoon_200150
1 files changed, 50 insertions, 0 deletions
diff --git a/games/typhoon_2001/typhoon_2001 b/games/typhoon_2001/typhoon_2001
new file mode 100644
index 0000000000..2953ebdd88
--- /dev/null
+++ b/games/typhoon_2001/typhoon_2001
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# 20080301 bkw:
+
+# Wrapper script for typhoon 2001. This binary-only game was originally
+# written for MS Windows, so it expects to find its data files in the
+# current directory, and to be able to write log and config files there.
+
+# To allow for system-wide installation, this script will create and
+# populate a per-user symlink forest in ~/.$PRGNAM, allowing each
+# user to have his own typhoon.cfg and typhoon.log files.
+
+T2K1_BIN=/usr/libexec/typhoon
+T2K1_SHARE=/usr/share/games/typhoon_2001
+T2K1_HOME=~/.typhoon_2001
+
+if [ ! -e $T2K1_BIN ]; then
+ echo "$T2K1_BIN does not exist, are you sure Typhoon 2001 is installed?"
+ exit 1
+fi
+
+if [ ! -d $T2K1_SHARE ]; then
+ echo "$T2K1_SHARE does not exist, are you sure Typhoon 2001 is installed?"
+ exit 1
+fi
+
+if [ ! -d "$T2K1_HOME" ]; then
+ echo "Installing user dir: $T2K1_HOME"
+ mkdir $T2K1_HOME || exit 1
+ cd $T2K1_HOME || exit 1
+ ln -s $T2K1_BIN ./typhoon
+ ln -s $T2K1_SHARE/*.* .
+
+ # if game/ or any game/dir is a symlink, choosing level-set from the
+ # gameplay menu doesn't work.
+ # Binary-only, so I can't just fix it, so they have to be real dirs...
+
+ mkdir game
+ for i in tempest 'tempest tubes' 'typhoon 2001'; do
+ mkdir "$T2K1_HOME/game/$i"
+ (
+ cd "$T2K1_HOME/game/$i"
+ ln -s "$T2K1_SHARE/game/$i/"* .
+ )
+ done
+fi
+
+cd "$T2K1_HOME" && exec ./typhoon || \
+ echo "Can't exec $T2K1_HOME/typhoon - " \
+ "corrupt install, try removing $T2K1_HOME and running $0 again"