3 # Product setup script - Loki Entertainment Software
5 # TTimo FIXME need a way to configure this easily
6 critical_error="Please contact Id software technical support at bugs@idsoftware.com"
8 # Go to the proper setup directory (if not already there)
11 # Return the appropriate architecture string
24 # Return the appropriate version string
28 if [ `uname -s` != Linux ]; then
32 if [ -f `echo /lib/libc.so.6* | tail -1` ]; then
33 if fgrep GLIBC_2.1 /lib/libc.so.6* 2>&1 >/dev/null; then
40 elif [ -f /lib/libc.so.5 ]; then
49 # Detect the Linux environment
54 # Find the installation program
55 # try_run INSTALLER_NAME [-fatal] [PARAMETERS_PASSED]
56 # INSTALLER_NAME: setup.gtk or setup
57 # -fatal option: if you want verbose messages in case
58 # - the script could not be found
59 # - it's execution would fail
60 # PARAMETERS_PASSED: additional arguments passed to the setup script
65 # added safe check, direct test seems buggy on older bash
67 # looks like bash < 2.* don't like == operator, using = instead
68 if [ "$1" = "-fatal" ]; then
75 # First find the binary we want to run
77 setup_bin="setup.data/bin/$os/$arch/$libc/$setup"
79 if [ ! -f "$setup_bin" ]; then
80 setup_bin="setup.data/bin/$os/$arch/$setup"
81 # libc dependant version failed, trying again
82 if [ ! -f "$setup_bin" ]; then
86 if [ "$failed" -eq 1 ]; then
87 if [ "$fatal" != "" ]; then
89 This installation doesn't support $libc on $os / $arch
98 # Try to run the binary ($setup_bin)
99 # The executable is here but we can't execute it from CD
100 setup="$HOME/.setup$$"
101 cp "$setup_bin" "$setup"
103 if [ "$fatal" != "" ]; then
107 "$setup" $* 2>/dev/null
115 # Try to run the setup program
118 try_run setup.gtk $* || try_run setup -fatal $* || {
119 echo "The setup program seems to have failed on $arch/$libc"