File: quake3.in

package info (click to toggle)
quake 8
  • links: PTS, VCS
  • area: contrib
  • in suites: jessie, jessie-kfreebsd
  • size: 928 kB
  • ctags: 5
  • sloc: sh: 510; makefile: 182
file content (71 lines) | stat: -rw-r--r-- 1,563 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh

# quake3 or quake3-server or whatever
IOQ3SELF=@IOQ3SELF@
# "server" or "client"
IOQ3ROLE=@IOQ3ROLE@
# ioquake3 or ioq3ded
IOQ3BINARY=@IOQ3BINARY@
# q3a or openarena
IOQ3DOTDIR=q3a

BASEPATH="/usr/share/games/quake3"
ENGINE="/usr/lib/ioquake3/${IOQ3BINARY}"

DEBUGGER="$QUAKE3_DEBUGGER"

# the defaults mostly apply
CVARS="+set com_standalone 0"
CVARS="$CVARS +set fs_basepath $BASEPATH"

QUIET=0

EXCUSE="\
Quake III Arena ${IOQ3ROLE} wrapper for Debian\n\
\n\
Usage: ${IOQ3SELF} [OPTION]...\n\
\n\
 -h, --help\t\tDisplay this help\n\
 -q, --quiet\t\tDisable console output\n\
  +<internal command>\tPass commands to the engine\n"

while [ "$1" != "" ]; do
  case "$1" in
    -h|--help)
      echo ${EXCUSE}
      exit 0
      ;;
    -q|--quiet)
      CVARS="$CVARS +set ttycon 0"
      QUIET=1
      ;;
    *)
      break
      ;;
  esac
  shift
done

# sanity check: the engine doesn't cope well with missing data
for i in 0 1 2 3 4 5 6 7 8; do
  if test -f $BASEPATH/baseq3/pak$i.pk3; then
    :
  else
    if test "$IOQ3ROLE" = client; then
      $BASEPATH/need-data.sh "Quake III Arena" "`cat $BASEPATH/README.quake3-data`"
    else
      echo "Quake III Arena data missing, see /usr/share/doc/quake3-server/README.quake3-data"
    fi
    exit 72     # EX_OSFILE
  fi
done

if test "z$QUIET" = z1; then
  exec >/dev/null 2>&1;
fi

if test -n "$QUAKE3_BACKTRACE"; then
  exec gdb -return-child-result -batch -ex run -ex 'thread apply all bt full' -ex kill -ex quit --args ${ENGINE} ${CVARS} "$@"
else
  exec ${DEBUGGER} ${ENGINE} ${CVARS} "$@"
fi