[SCM] [contrib] Quake III: Arena launcher branch, master, updated. 8f730e69d05cd16baf110f410d00c27484c83965

Simon McVittie smcv at debian.org
Thu Oct 14 22:31:22 UTC 2010


The following commit has been merged in the master branch:
commit eb0c6e8fa95b8a0249c11773b0b20e710603bb3e
Author: Simon McVittie <smcv at debian.org>
Date:   Thu Oct 14 23:28:46 2010 +0100

    Merge the launcher scripts with my example one from ioquake3

diff --git a/Makefile b/Makefile
index 00b4848..f57d691 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,28 @@
 ALL = \
+	build/quake3 \
+	build/quake3-server \
 	build/quake3.png \
 	build/quake3.xpm \
 	build/quake332.xpm
 
 all: $(ALL)
 
+build/quake3: quake3.in Makefile
+	sed \
+		-e 's!@IOQ3BINARY@!ioquake3!' \
+		-e 's!@IOQ3SELF@!quake3!' \
+		-e 's!@IOQ3ROLE@!client!' \
+		< $< > $@
+	chmod +x $@
+
+build/quake3-server: quake3.in Makefile
+	sed \
+		-e 's!@IOQ3BINARY@!ioq3ded!' \
+		-e 's!@IOQ3SELF@!quake3!' \
+		-e 's!@IOQ3ROLE@!server!' \
+		< $< > $@
+	chmod +x $@
+
 build/quake3.png: quake3-tango.xcf
 	install -d build
 	xcf2png -o $@ $<
diff --git a/debian/quake3-server.install b/debian/quake3-server.install
index 1b5c500..9b4b15e 100644
--- a/debian/quake3-server.install
+++ b/debian/quake3-server.install
@@ -1 +1 @@
-debian/scripts/quake3-server usr/games
+build/quake3-server usr/games
diff --git a/debian/quake3.install b/debian/quake3.install
index f23759f..cb18ad3 100644
--- a/debian/quake3.install
+++ b/debian/quake3.install
@@ -2,4 +2,4 @@ debian/quake3.desktop usr/share/applications
 build/quake3.png usr/share/pixmaps
 build/quake3.xpm usr/share/pixmaps
 build/quake332.xpm usr/share/pixmaps
-debian/scripts/quake3 usr/games
+build/quake3 usr/games
diff --git a/debian/scripts/quake3 b/debian/scripts/quake3
deleted file mode 100644
index 0991a3b..0000000
--- a/debian/scripts/quake3
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-# Adapted from Tremulous and Nexuiz launch scripts
-BINARY=/usr/lib/ioquake3/ioquake3
-BASE_PATH=/usr/share/games/quake3
-CVARS="+set fs_basepath ${BASE_PATH}"
-QUIET=0
-EXCUSE="\
-Quake III client wrapper\n\
-This script is Debian specific, it is *NOT* part of the source distribution!\n\
-Usage: quake3 [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"
-
-# ioQuake3 binaries don't understand "regular" command line parameters.
-# Let's catch them here, to avoid accidentally launching the binary.
-
-while [ "$1" != "" ]; do {
-	if [ ${1:0:1} = "+" ]; then
-		break;
-	fi
-	case "$1" in
-		-h|--help)
-			echo ${EXCUSE}
-			exit 0
-			;;
-		-q|--quiet)
-			QUIET=1
-			;;
-	esac
-	shift
-}; done
-
-# baseq3 creates botlib.log in cwd rather than ~/.q3a/baseq3
-# this is a dirty hack to work around this issue
-[ -d $HOME/.q3a/baseq3 ] || mkdir -p $HOME/.q3a/baseq3; cd $HOME/.q3a/baseq3
-
-# Ready to rumble!
-
-if [ ${QUIET} -eq 1 ]; then
-	exec ${BINARY} ${CVARS} +set ttycon 0 $* >/dev/null 2>&1
-else
-	exec ${BINARY} ${CVARS} $*
-fi
-
-exit $?
diff --git a/debian/scripts/quake3-server b/debian/scripts/quake3-server
deleted file mode 100644
index 4eb1405..0000000
--- a/debian/scripts/quake3-server
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-# Adapted from Tremulous and Nexuiz launch scripts
-BINARY=/usr/lib/ioquake3/ioq3ded
-BASE_PATH=/usr/share/games/quake3
-CVARS="+set fs_basepath ${BASE_PATH}"
-QUIET=0
-EXCUSE="\
-Quake III server wrapper\n\
-This script is Debian specific, it is *NOT* part of the source distribution!\n\
-Usage: quake3-server [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"
-
-# ioQuake3 binaries don't understand "regular" command line parameters.
-# Let's catch them here, to avoid accidentally launching the binary.
-
-while [ "$1" != "" ]; do {
-	if [ ${1:0:1} = "+" ]; then
-		break;
-	fi
-	case "$1" in
-		-h|--help)
-			echo ${EXCUSE}
-			exit 0
-			;;
-		-q|--quiet)
-			QUIET=1
-			;;
-	esac
-	shift
-}; done
-
-# baseq3 creates botlib.log in cwd rather than ~/.q3a/baseq3
-# this is a dirty hack to work around this issue
-[ -d $HOME/.q3a/baseq3 ] || mkdir -p $HOME/.q3a/baseq3; cd $HOME/.q3a/baseq3
-
-# Ready to rumble!
-
-if [ ${QUIET} -eq 1 ]; then
-	exec ${BINARY} ${CVARS} +set ttycon 0 $* >/dev/null 2>&1
-else
-	exec ${BINARY} ${CVARS} $*
-fi
-
-exit $?
diff --git a/quake3.in b/quake3.in
new file mode 100644
index 0000000..ceee2c2
--- /dev/null
+++ b/quake3.in
@@ -0,0 +1,56 @@
+#!/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
+
+ENGINE="/usr/lib/ioquake3/${IOQ3BINARY}"
+
+DEBUGGER="$QUAKE3_DEBUGGER"
+
+if test -n "$QUAKE3_BACKTRACE"; then
+  DEBUGGER="gdb -return-child-result -batch -ex run -ex 'thread apply all bt full' -ex kill -ex quit --args"
+fi
+
+# the defaults mostly apply
+CVARS="+set com_standalone 0"
+CVARS="$CVARS +set fs_basepath /usr/share/games/quake3"
+
+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
+
+if test "z$QUIET" = z1; then
+  exec >/dev/null 2>&1;
+fi
+
+exec ${ENGINE} ${CVARS} "$@"

-- 
[contrib] Quake III: Arena launcher



More information about the Pkg-games-commits mailing list