[game-data-packager] 183/293: Add support for Quake II

Simon McVittie smcv at debian.org
Fri Oct 14 00:12:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch quake
in repository game-data-packager.

commit 7a565da7390cad477107f7d57ad9d0cefb7e979f
Author: Simon McVittie <smcv at debian.org>
Date:   Thu Sep 26 23:09:42 2013 +0100

    Add support for Quake II
---
 .gitignore                                    |  4 ++
 Makefile                                      | 53 +++++++++++++++-
 debian/changelog                              |  6 ++
 debian/control                                | 44 ++++++++++++-
 debian/copyright                              | 16 +++--
 debian/policy.txt                             | 22 +++++--
 debian/q2/debian_server.cfg                   | 23 +++++++
 debian/q2/demo/debian_server.cfg              | 21 +++++++
 debian/{README.Debian => quake.README.Debian} |  0
 debian/quake2-server.README.Debian            | 64 +++++++++++++++++++
 debian/quake2-server.default                  |  6 ++
 debian/quake2-server.init                     | 90 +++++++++++++++++++++++++++
 debian/quake2-server.install                  |  3 +
 debian/quake2-server.links                    |  2 +
 debian/quake2-server.manpages                 |  1 +
 debian/quake2-server.postinst                 | 30 +++++++++
 debian/quake2-server.postrm                   | 16 +++++
 debian/quake2.README.Debian                   | 32 ++++++++++
 debian/quake2.docs                            |  1 +
 debian/quake2.install                         | 11 ++++
 debian/quake2.manpages                        |  1 +
 debian/quake2.menu                            |  2 +
 need-data.sh                                  |  4 +-
 quake.in                                      |  3 +-
 quake2-server.6                               | 61 ++++++++++++++++++
 quake2.6                                      | 58 +++++++++++++++++
 quake2.desktop                                |  8 +++
 quake.in => quake2.in                         | 37 +++++++----
 28 files changed, 584 insertions(+), 35 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4868106..c4dbfa8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,10 @@
 /48/
 /256/
 /quake
+/quake2
 /quake-server
+/quake2-server
 /quake.xpm
+/quake2.xpm
 /quake.svg
+/quake2.svg
diff --git a/Makefile b/Makefile
index c9c105e..3cc1614 100644
--- a/Makefile
+++ b/Makefile
@@ -2,15 +2,25 @@
 
 obj = \
 	quake \
+	quake2 \
 	quake-server \
+	quake2-server \
 	quake.xpm \
+	quake2.xpm \
 	16/quake.png \
+	16/quake2.png \
 	22/quake.png \
+	22/quake2.png \
 	24/quake.png \
+	24/quake2.png \
 	32/quake.png \
+	32/quake2.png \
 	48/quake.png \
+	48/quake2.png \
 	256/quake.png \
-	quake.svg
+	256/quake2.png \
+	quake.svg \
+	quake2.svg
 
 all: $(obj)
 
@@ -22,6 +32,22 @@ quake: quake.in
 		< $< > $@
 	chmod +x $@
 
+quake2: quake2.in
+	sed -e 's/@self@/quake2/g' \
+		-e 's/@role@/client/g' \
+		-e 's/@options@//g' \
+		-e 's/@alternative@/quake2-engine/g' \
+		< $< > $@
+	chmod +x $@
+
+quake2-server: quake2.in
+	sed -e 's/@self@/quake2-server/g' \
+		-e 's/@role@/dedicated server/g' \
+		-e 's/@options@/+set dedicated 1/g' \
+		-e 's/@alternative@/quake2-engine-server/g' \
+		< $< > $@
+	chmod +x $@
+
 quake-server: quake.in
 	sed -e 's/@self@/quake-server/g' \
 		-e 's/@role@/server/g' \
@@ -34,6 +60,10 @@ quake-server: quake.in
 	install -d 24
 	convert -bordercolor Transparent -border 1x1 $< $@
 
+24/quake2.png: 22/quake2.png
+	install -d 24
+	convert -bordercolor Transparent -border 1x1 $< $@
+
 %/quake.png: quake1+2.svg
 	install -d $*
 	inkscape \
@@ -45,7 +75,18 @@ quake-server: quake.in
 		--export-png=$@ \
 		$<
 
-quake.xpm: 32/quake.png
+%/quake2.png: quake1+2.svg
+	install -d $*
+	inkscape \
+		--export-area=0:0:$*:$* \
+		--export-width=$* \
+		--export-height=$* \
+		--export-id=layer-quake2-$* \
+		--export-id-only \
+		--export-png=$@ \
+		$<
+
+%.xpm: 32/%.png
 	convert $< $@
 
 clean: 
@@ -59,3 +100,11 @@ quake.svg: quake1+2.svg Makefile
 		--export-plain-svg=$@ \
 		tmp.svg
 	rm -f tmp.svg
+
+quake2.svg: quake1+2.svg Makefile
+	xmlstarlet ed -d "//*[local-name() = 'g' and @id != 'layer-quake2-256']" < $< > tmp.svg
+	inkscape \
+		--export-area-page \
+		--export-plain-svg=$@ \
+		tmp.svg
+	rm -f tmp.svg
diff --git a/debian/changelog b/debian/changelog
index 040897b..657e47d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+quake (4) UNRELEASED; urgency=low
+
+  * Add support for Quake II
+
+ -- Simon McVittie <smcv at debian.org>  Thu, 26 Sep 2013 23:03:32 +0100
+
 quake (3) unstable; urgency=low
 
   [ David Banks ]
diff --git a/debian/control b/debian/control
index d32fbbb..c808d65 100644
--- a/debian/control
+++ b/debian/control
@@ -17,9 +17,10 @@ Depends: ${misc:Depends},
          quake-registered | quake-shareware | game-data-packager
 Recommends: x11-utils | zenity | kdebase-bin
 Suggests: quake-armagon (>= 29), quake-dissolution (>= 29)
-Description: classic first person shooter
- This package contains a launcher script and menu entry to play
- Quake 1 with any suitable engine.
+Description: classic gothic/horror-themed first person shooter
+ Quake is a classic first-person shooter game by id Software,
+ released in 1996. This package contains a launcher script and menu
+ entry to play Quake with any suitable engine.
  .
  To make this package useful, you will need to create and install the
  non-distributable quake-registered or quake-shareware package, by using the
@@ -30,6 +31,23 @@ Description: classic first person shooter
  .
  Creating quake-shareware requires the shareware version of Quake.
 
+Package: quake2
+Architecture: all
+Depends: ${misc:Depends},
+         yamagi-quake2 | quake-engine,
+         quake2-retail | quake2-demo | game-data-packager,
+         quake2-patch | quake2-demo | game-data-packager
+Recommends: x11-utils | zenity | kdebase-bin
+Description: classic science-fiction-themed first person shooter
+ Quake II is a classic first-person shooter game by id Software,
+ released in 1997. This package contains a launcher script and menu
+ entry to play Quake II with any suitable engine.
+ .
+ To make this package useful, you will need to create and install some
+ non-distributable packages by using the game-data-packager package:
+ either quake2-full-data or quake2-demo-data. Creating quake2-full-data
+ requires data files from a Quake II installation or CD-ROM.
+
 Package: quake-server
 Architecture: all
 Depends: adduser,
@@ -43,3 +61,23 @@ Description: classic first person shooter - server and init script
  To make this package useful, you will need to create and install the
  non-distributable quake-registered or quake-shareware package, by using the
  game-data-packager package.
+
+Package: quake2-server
+Architecture: all
+Depends: adduser,
+         yamagi-quake2-server | quake2-engine-server,
+         quake2-full-data | quake2-demo-data | game-data-packager,
+         ${misc:Depends}
+Recommends: x11-utils | zenity | kdebase-bin
+Description: dedicated server for Quake II
+ This package contains a launcher script and init script to run a
+ Quake II server automatically, with any suitable engine.
+ .
+ To make this package useful, you will need to create and install some
+ non-distributable packages by using the game-data-packager package:
+ either quake2-full-data or quake2-demo-data. Creating quake2-full-data
+ requires data files from a Quake II installation or CD-ROM.
+ .
+ The configuration file provided by this package is intended
+ for the full version of Quake II - some reconfiguration will be
+ needed for the demo.
diff --git a/debian/copyright b/debian/copyright
index 3ba502a..e409fcf 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,15 +1,11 @@
-Format: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?view=co&revision=174
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Quake
+License: GPL-2+
 
 Files: *
-Copyright: © 2011 David Banks
-           © 2011 Simon McVittie
+Copyright: © 2011-2013 David Banks
+           © 2011-2013 Simon McVittie
 License: GPL-2+
-  Permission is granted to copy, distribute and/or modify this work under the
-  terms of the GNU General Public License, Version 2, or any later version
-  published by the Free Software Foundation.
-  .
-  On Debian systems, the complete text of the GNU General Public License can
-  be found in /usr/share/common-licenses/GPL-2.
 
 Files: quake1+2.svg
 Copyright: © 2011 Simon McVittie
@@ -24,6 +20,8 @@ Copyright:
   © 2008 Peter Eisentraut
   © 2010 Simon McVittie
 License: GPL-2+
+
+License: GPL-2+
   Permission is granted to copy, distribute and/or modify this work under the
   terms of the GNU General Public License, Version 2, or any later version
   published by the Free Software Foundation.
diff --git a/debian/policy.txt b/debian/policy.txt
index d5247ff..3d5bdda 100644
--- a/debian/policy.txt
+++ b/debian/policy.txt
@@ -1,5 +1,5 @@
-Debian Quake mini-policy, version 1
-===================================
+Debian Quake/Quake II mini-policy, version 2
+============================================
 
 Configuration files
 -------------------
@@ -22,6 +22,13 @@ definition, almost every quake-engine could also be a quake-engine-server, but
 engines where there is a separate server build with reduced dependencies
 do not need to register their client as a potential server.)
 
+quake2-engine is any Quake II engine that, when run with +set basedir DIR,
+acts as a Quake II client.
+
+quake2-engine-server is any Quake II engine that, when run with the
+command-line options "+set dedicated 1" in addition to the options above,
+acts as a Quake II server.
+
 Neither quake-engine nor quake-engine-server is really meant to be run
 directly, so the alternatives go in /usr/lib/quake:
 
@@ -39,10 +46,8 @@ never causes the user to "lose" their configuration and savegames.
 Virtual packages
 ----------------
 
-Packages providing quake-engine must implement the quake-engine alternative.
-
-Packages providing quake-engine-server must implement the quake-engine-server
-alternative.
+Packages providing quake-engine must implement the quake-engine alternative,
+and so on.
 
 Non-Quake games
 ---------------
@@ -55,3 +60,8 @@ community patches or extra features (so no JPEG textures, for instance).
 (For instance, Nexuiz relies on features from DarkPlaces, which is its
 "official" engine, so it should depend on darkplaces directly and not rely
 on quake-engine.)
+
+Changes
+-------
+
+* version 2: added Quake II alternatives and virtual packages
diff --git a/debian/q2/debian_server.cfg b/debian/q2/debian_server.cfg
new file mode 100644
index 0000000..b1abcd1
--- /dev/null
+++ b/debian/q2/debian_server.cfg
@@ -0,0 +1,23 @@
+// Example Quake II server configuration for Debian
+// This is installed into /etc/quake2-server/debian_server.cfg and symlinked
+// into the game directory as debian_server.cfg, so you can run it via:
+//
+//     exec debian_server.cfg
+//
+// If you only have the demo (quake2-demo-data) look at
+// /etc/quake2-server/demo/debian_server.cfg instead.
+
+set hostname "An anonymous Debian server"
+set location "The Internet"
+set website "http://www.debian.org/"
+set deathmatch 1
+set maxclients 8
+set timelimit 30
+set fraglimit 30
+
+map q2dm1
+
+// to advertise your server to a public "master server" add something
+// like this:
+//set public 1
+//setmaster master.q2servers.com
diff --git a/debian/q2/demo/debian_server.cfg b/debian/q2/demo/debian_server.cfg
new file mode 100644
index 0000000..25d343e
--- /dev/null
+++ b/debian/q2/demo/debian_server.cfg
@@ -0,0 +1,21 @@
+// Example Quake II demo server configuration for Debian
+// This is installed into /etc/quake2-server/demo/debian_server.cfg
+// and symlinked into the demo data directory as debian_server.cfg, so
+// you can run it via:
+//
+//     exec debian_server.cfg
+//
+// If you have the full game (quake2-full-data) look at
+// /etc/quake2-server/debian_server.cfg instead.
+
+set hostname "An anonymous Debian Quake II demo server"
+set location "The Internet"
+set website "http://www.debian.org/"
+set deathmatch 1
+set maxclients 8
+set timelimit 30
+set fraglimit 30
+
+// the demo only contains a few maps, so you will have to select
+// one of them instead if using demo data
+map demo1
diff --git a/debian/README.Debian b/debian/quake.README.Debian
similarity index 100%
rename from debian/README.Debian
rename to debian/quake.README.Debian
diff --git a/debian/quake2-server.README.Debian b/debian/quake2-server.README.Debian
new file mode 100644
index 0000000..89d2c37
--- /dev/null
+++ b/debian/quake2-server.README.Debian
@@ -0,0 +1,64 @@
+Quake II dedicated server for Debian
+====================================
+
+Running the server via sysvinit
+-------------------------------
+
+By default, quake2-server adds a user under which to run the dedicated server
+(quake2-server) and sets it up to be run by an init script in the conventional
+Debian way. This is a simple setup suitable for running one server on a
+machine; by default it will run a deathmatch game.
+
+The quake2-server user's home directory is /var/games/quake2-server, so you
+can find Quake files in /var/games/quake2-server/.yq2 or similar.
+
+By default, the init script will use
+/usr/share/games/quake2/baseq2/debian_server.cfg, which is a symlink to
+/etc/quake2-server/debian_server.cfg. You can edit this file, or put an
+alternative configuration in /var/games/quake2-server/.yq2/baseq2 (or
+whatever is the appropriate directory for your selected engine) and change
+/etc/default/quake2-server to exec that.
+
+If you only have the demo data, the init script will use
+/usr/share/games/quake2-demo/baseq2/debian_server.cfg,
+which is a similar symlink to /etc/quake2-server/demo/debian_server.cfg.
+
+There are various alternative ways you can run the server if this doesn't
+meet your requirements.
+
+Disabling the init script
+-------------------------
+
+To stop the server:
+
+    /etc/init.d/quake2-server stop
+
+To prevent it from running again, use update-rc.d:
+
+    update-rc.d quake2-server disable
+
+Running the server with cron and screen
+---------------------------------------
+
+One alternative way to run the server is to run it in a screen(1) session
+from a cron @reboot action. This can be used to run multiple instances
+of the server; you'll need to set a different port number on each server after
+the first, and it's safest to give each server a unique home directory so they
+don't overwrite each other's configuration files.
+
+To do this, you could put something like this in the quake2-server user's
+crontab (don't break the long lines!):
+
+    @reboot screen -d -m -S ffa env HOME=/var/games/quake2-server/ffa /usr/games/quake2-server +exec ffa.config
+    @reboot screen -d -m -S ctf env HOME=/var/games/quake2-server/ctf /usr/games/quake2-server +set port 54321 +exec ctf.config
+
+or in /etc/crontab or a file in /etc/cron.d:
+
+    @reboot quake2-server screen -d -m -S ffa env HOME=/var/games/quake2-server/ffa /usr/games/quake2-server +exec ffa.config
+    @reboot quake2-server screen -d -m -S ctf env HOME=/var/games/quake2-server/ctf /usr/games/quake2-server +set port 54321 +exec ctf.config
+
+If you do that, you can access the servers' consoles by attaching a screen
+session to them:
+
+    sudo -u quake2-server screen -r ffa
+    sudo -u quake2-server screen -r ctf
diff --git a/debian/quake2-server.default b/debian/quake2-server.default
new file mode 100644
index 0000000..cf0182e
--- /dev/null
+++ b/debian/quake2-server.default
@@ -0,0 +1,6 @@
+# Defaults for Quake init script
+# sourced by /etc/init.d/quake2-server
+# installed at /etc/default/quake2-server by the maintainer scripts
+
+# Additional options that are passed to the daemon.
+DAEMON_OPTS="+exec debian_server.cfg"
diff --git a/debian/quake2-server.init b/debian/quake2-server.init
new file mode 100644
index 0000000..7ce83ac
--- /dev/null
+++ b/debian/quake2-server.init
@@ -0,0 +1,90 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          quake2-server
+# Required-Start:    $remote_fs $network
+# Required-Stop:     $remote_fs $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Quake II game server
+# Description:       Dedicated server for Quake II, a classic 3D FPS game
+### END INIT INFO
+
+PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+NAME="quake2-server"
+DAEMON="/usr/games/$NAME"
+DESC="Quake II dedicated server"
+PIDFILE="/var/run/$NAME.pid"
+BINARY="/usr/lib/quake2/quake2-engine-server"
+USER="$NAME"
+
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+# Include defaults if available
+if [ -f /etc/default/$NAME ] ; then
+	. /etc/default/$NAME
+fi
+
+do_start() {
+    if [ -f $PIDFILE ]; then
+        return 2
+    fi
+    start-stop-daemon --start --quiet --pidfile $PIDFILE --oknodo \
+	--background --exec $BINARY --startas $DAEMON \
+	--make-pidfile --chuid $USER \
+	-- $DAEMON_OPTS > /dev/null 2>&1 || return 1
+    return 0
+}
+
+do_stop() {
+    start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+	--oknodo --exec $BINARY || return 1
+    rm -f $PIDFILE
+    return 0
+}
+
+case "$1" in
+    start)
+        log_begin_msg "Starting $DESC: $NAME"
+	do_start
+        log_end_msg $?
+	;;
+    stop)
+        log_begin_msg "Stopping $DESC: $NAME"
+	do_stop
+        log_end_msg $?
+	;;
+    #reload)
+	#
+	#	If the daemon can reload its config files on the fly
+	#	for example by sending it SIGHUP, do it here.
+	#
+	#	If the daemon responds to changes in its config file
+	#	directly anyway, make this a do-nothing entry.
+	#
+	# echo "Reloading $DESC configuration files."
+	# start-stop-daemon --stop --signal 1 --quiet --pidfile \
+	#	/var/run/$NAME.pid --exec $DAEMON
+        #;;
+    restart|force-reload)
+	#
+	#	If the "reload" option is implemented, move the "force-reload"
+	#	option to the "reload" entry above. If not, "force-reload" is
+	#	just the same as "restart".
+	#
+        log_begin_msg "Restarting $DESC: $NAME"
+	do_stop && sleep 1 && do_start
+        log_end_msg $?
+	;;
+    status)
+        status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
+        ;;
+
+    *)
+	echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/debian/quake2-server.install b/debian/quake2-server.install
new file mode 100644
index 0000000..f45034d
--- /dev/null
+++ b/debian/quake2-server.install
@@ -0,0 +1,3 @@
+quake2-server                    /usr/games
+debian/q2/debian_server.cfg      /etc/quake2-server
+debian/q2/demo/debian_server.cfg /etc/quake2-server/demo
diff --git a/debian/quake2-server.links b/debian/quake2-server.links
new file mode 100644
index 0000000..d500b44
--- /dev/null
+++ b/debian/quake2-server.links
@@ -0,0 +1,2 @@
+etc/quake2-server/debian_server.cfg usr/share/games/quake2/baseq2/debian_server.cfg
+etc/quake2-server/demo/debian_server.cfg usr/share/games/quake2-demo/baseq2/debian_server.cfg
diff --git a/debian/quake2-server.manpages b/debian/quake2-server.manpages
new file mode 100644
index 0000000..3383afd
--- /dev/null
+++ b/debian/quake2-server.manpages
@@ -0,0 +1 @@
+quake2-server.6
diff --git a/debian/quake2-server.postinst b/debian/quake2-server.postinst
new file mode 100644
index 0000000..7c74330
--- /dev/null
+++ b/debian/quake2-server.postinst
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+  configure)
+    if ! getent passwd quake2-server >/dev/null; then
+      adduser --disabled-password --quiet --system \
+        --home /var/games/quake2-server --no-create-home \
+        --gecos "Quake II dedicated server" \
+        --ingroup games --force-badname quake2-server
+    fi
+    # Unlock account, if it was locked by our postrm
+    if [ -f /etc/shadow ]; then
+      usermod -U -e '' quake2-server
+    else
+      usermod -U quake2-server
+    fi
+    install -d /var/games
+    install -d -o quake2-server -g games /var/games/quake2-server
+  ;;
+  abort-upgrade|abort-remove|abort-deconfigure)
+  ;;
+  *)
+    echo "postinst called with unknown argument \`$1'" >&2
+    exit 1
+  ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/quake2-server.postrm b/debian/quake2-server.postrm
new file mode 100644
index 0000000..54334ea
--- /dev/null
+++ b/debian/quake2-server.postrm
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if [ "$1" = "purge" ] ; then
+    # Lock account on purge
+    if [ -f /etc/shadow ]; then
+        usermod -L -e 1 quake2-server
+    else
+        usermod -L quake2-server
+    fi
+    rm -r /var/games/quake2-server
+    rmdir --ignore-fail-on-non-empty /var/games
+fi
diff --git a/debian/quake2.README.Debian b/debian/quake2.README.Debian
new file mode 100644
index 0000000..cefcd4f
--- /dev/null
+++ b/debian/quake2.README.Debian
@@ -0,0 +1,32 @@
+Quake II for Debian
+===================
+
+Game data
+---------
+
+The Quake II engine requires game data to run.  The data is not freely
+redistributable.  You should use the 'game-data-packager' tool to install it.
+
+Switching engines
+-----------------
+
+There is no canonical upstream developer for the Quake engine, but several
+forks might be packaged in Debian in future. This package can use any
+compatible engine.
+
+Currently, the recommended engine is yamagi-quake2.
+
+To select a particular Quake engine once, you can use the --engine option:
+
+    quake --engine=/usr/lib/yamagi-quake2/quake2
+
+To change the preferred engine system-wide, reconfigure the quake2-engine
+alternative:
+
+    sudo update-alternatives --config quake2-engine
+
+Each Quake engine has its own dot-directory, with its own configuration and
+potentially its own savegame format. If you switch between two engines
+using update-alternatives (or by installing a second and uninstalling the
+first), you will have to configure the new engine separately, and any
+single-player savegames will not be visible to the new engine.
diff --git a/debian/quake2.docs b/debian/quake2.docs
new file mode 100644
index 0000000..efe80d5
--- /dev/null
+++ b/debian/quake2.docs
@@ -0,0 +1 @@
+debian/policy.txt
diff --git a/debian/quake2.install b/debian/quake2.install
new file mode 100644
index 0000000..9592bae
--- /dev/null
+++ b/debian/quake2.install
@@ -0,0 +1,11 @@
+quake2         /usr/games
+need-data.sh   /usr/share/games/quake2
+quake2.desktop /usr/share/applications
+quake2.xpm     /usr/share/pixmaps
+256/quake2.png /usr/share/icons/hicolor/256x256/apps
+48/quake2.png  /usr/share/icons/hicolor/48x48/apps
+32/quake2.png  /usr/share/icons/hicolor/32x32/apps
+24/quake2.png  /usr/share/icons/hicolor/24x24/apps
+22/quake2.png  /usr/share/icons/hicolor/22x22/apps
+16/quake2.png  /usr/share/icons/hicolor/16x16/apps
+quake2.svg     /usr/share/icons/hicolor/scalable/apps
diff --git a/debian/quake2.manpages b/debian/quake2.manpages
new file mode 100644
index 0000000..734518b
--- /dev/null
+++ b/debian/quake2.manpages
@@ -0,0 +1 @@
+quake2.6
diff --git a/debian/quake2.menu b/debian/quake2.menu
new file mode 100644
index 0000000..540c17e
--- /dev/null
+++ b/debian/quake2.menu
@@ -0,0 +1,2 @@
+?package(quake2):needs="X11" section="Games/Action" title="Quake II" \
+  icon="/usr/share/pixmaps/quake2.xpm" command="quake2"
diff --git a/need-data.sh b/need-data.sh
index 69412ae..4577838 100755
--- a/need-data.sh
+++ b/need-data.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-TITLE="Quake"
-TEXT="$1"
+TITLE="$1"
+TEXT="$2"
 
 try_zenity () {
   if command -v zenity >/dev/null; then
diff --git a/quake.in b/quake.in
index b3776d1..fb435ab 100644
--- a/quake.in
+++ b/quake.in
@@ -7,6 +7,7 @@ role="@role@"
 options="@options@"
 data_location=/usr/share/games/quake
 engine_path=/usr/lib/quake/@alternative@
+no_data_title="Quake"
 no_data_msg="Missing data; see /usr/share/doc/${self}/README.Debian"
 
 main() {
@@ -40,7 +41,7 @@ main() {
         if test "${role}" = server; then
             echo "$no_data_msg"
         else
-            exec "$data_location"/need-data.sh "$no_data_msg"
+            exec "$data_location"/need-data.sh "$no_data_title" "$no_data_msg"
         fi
     fi
     
diff --git a/quake2-server.6 b/quake2-server.6
new file mode 100644
index 0000000..b7b1702
--- /dev/null
+++ b/quake2-server.6
@@ -0,0 +1,61 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH QUAKE2-SERVER 6 "2013-09-26"
+.SH NAME
+quake2-server \- classic first person shooter (dedicated server)
+.SH SYNOPSIS
+.B quake2-server
+.RI [ WRAPPER-OPTIONS ]
+.RI [ ENGINE-OPTIONS ]
+.RI [ ENGINE-COMMANDS ] ...
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B quake2-server
+command.
+.PP
+\fBQuake II\fP is a popular first-person shooter game, released in 1997
+by iD Software.  This wrapper script will launch the Quake II engine.  The
+game data needs to be installed independently using the 'game-data-packager'
+program, and by default it will be looked for at \fI/usr/share/games/quake2\fR
+and \fI/usr/share/games/quake2-demo\fR.
+.PP
+This wrapper script accepts a few GNU-style options.
+Any further arguments are passed to the engine unmodified.
+Consult the engine documentation for full details, but most engines support a
+syntax where you can give console commands by prefixing with a plus sign.
+.PP
+In addition to any arguments on the command line, the quake2-server script
+automatically passes the arguments "+set dedicated 1" to the engine.
+.SH OPTIONS
+These options are accepted for \fBWRAPPER-OPTIONS\fR in the
+synopsis.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-version
+Show version of program.
+.TP
+.B \-\-engine=\fBENGINE\fR
+Select a non-default Quake II engine binary
+.TP
+.B \-\-demo
+Use the demo data, even if you have both the demo and the full version
+installed
+.SH EXAMPLES
+Run a server to play the demo in cooperative mode:
+.B quake2-server --demo +map demo1 +set coop 1
+.TP
+Run a deathmatch server:
+.B quake2-server +map q2dm1 +set deathmatch 1
+.TP
+Use the default server configuration in /etc/quake2-server/debian_server.cfg:
+.B quake2-server +exec debian_server.cfg
+.SH SEE ALSO
+.BR quake2 (6),
+.BR game-data-packager (6).
+.SH AUTHOR
+This manual page, and the quake2-server wrapper script, were written by
+Simon McVittie <smcv at debian.org>, for the Debian project (and may be used
+by others). They are based on the Quake packaging by David Banks and
+Simon McVittie.
diff --git a/quake2.6 b/quake2.6
new file mode 100644
index 0000000..7f2eb06
--- /dev/null
+++ b/quake2.6
@@ -0,0 +1,58 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH QUAKE2 6 "2013-09-25"
+.SH NAME
+quake2 \- classic first person shooter
+.SH SYNOPSIS
+.B quake2
+.RI [ WRAPPER-OPTIONS ]
+.RI [ ENGINE-OPTIONS ]
+.RI [ ENGINE-COMMANDS ] ...
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B quake2
+command.
+.PP
+\fBQuake II\fP is a popular first-person shooter game, released in 1997
+by iD Software.  This wrapper script will launch the Quake II engine.  The
+game data needs to be installed independently using the 'game-data-packager'
+program, and by default it will be looked for at \fI/usr/share/games/quake2\fR
+and \fI/usr/share/games/quake2-demo\fR.
+.PP
+This wrapper script accepts a few GNU-style options.
+Any further arguments are passed to the engine unmodified.
+Consult the engine documentation for full details, but most engines support a
+syntax where you can give console commands by prefixing with a plus sign.
+.SH OPTIONS
+These options are accepted for \fBWRAPPER-OPTIONS\fR in the
+synopsis.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-version
+Show version of program.
+.TP
+.B \-\-engine=\fBENGINE\fR
+Select a non-default Quake II engine binary
+.TP
+.B \-\-demo
+Use the demo data, even if you have both the demo and the full version
+installed
+.SH EXAMPLES
+Play the demo in cooperative mode:
+.B quake2 --demo +map demo1 +set coop 1
+.TP
+Connect to a server for multiplayer:
+.B quake2 +connect quake2.example.com
+.TP
+Run the client as a temporary dedicated server (see the \fBquake2-server\fR
+package for more server infrastructure):
+.B quake2 +set dedicated 1 +set deathmatch 1 +map q2dm1
+.SH SEE ALSO
+.BR quake2-server (6),
+.BR game-data-packager (6).
+.SH AUTHOR
+This manual page, and the quake2 wrapper script, were written by Simon McVittie
+<smcv at debian.org>, for the Debian project (and may be used by others).
+They are based on the Quake packaging by David Banks and Simon McVittie.
diff --git a/quake2.desktop b/quake2.desktop
new file mode 100644
index 0000000..a48258e
--- /dev/null
+++ b/quake2.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Type=Application
+Version=1.0
+Name=Quake II
+Comment=Classic first person shooter
+Icon=quake2
+Exec=/usr/games/quake2
+Categories=Game;ActionGame;
diff --git a/quake.in b/quake2.in
similarity index 53%
copy from quake.in
copy to quake2.in
index b3776d1..082a1e5 100644
--- a/quake.in
+++ b/quake2.in
@@ -1,14 +1,17 @@
 #! /bin/sh
 
-# quake.sh - launcher script for quake 1
+# @self@ - launcher script for Quake II @role@
 
 self="@self@"
 role="@role@"
 options="@options@"
-data_location=/usr/share/games/quake
-engine_path=/usr/lib/quake/@alternative@
+data_location=/usr/share/games/quake2
+engine_path=/usr/lib/quake2/@alternative@
+no_data_title="Quake II"
 no_data_msg="Missing data; see /usr/share/doc/${self}/README.Debian"
 
+use_data_location="$data_location"
+
 main() {
     while [ $# -gt 0 ]; do
         case "$1" in
@@ -28,6 +31,9 @@ main() {
                 engine_path="$1"
                 engine_path="${engine_path#--engine=}"
                 ;;
+            --demo)
+                use_data_location="$data_location-demo"
+                ;;
             *)
                 break
                 ;;
@@ -36,32 +42,39 @@ main() {
         shift
     done
 
-    if ! [ -f "${data_location}/id1/pak0.pak" ]; then
+    if ! [ -f "${use_data_location}/baseq2/pak0.pak" ]; then
+        # try to fall back to the demo data - might work?
+        use_data_location="$data_location-demo"
+    fi
+
+    if ! [ -f "${use_data_location}/baseq2/pak0.pak" ]; then
         if test "${role}" = server; then
             echo "$no_data_msg"
         else
-            exec "$data_location"/need-data.sh "$no_data_msg"
+            exec "$data_location"/need-data.sh "$no_data_title" "$no_data_msg"
         fi
     fi
-    
-    exec ${engine_path} -basedir ${data_location} ${options} "$@"
+
+    exec ${engine_path} ${options} +set basedir "$use_data_location" "$@"
 }
 
 show_help() {
     echo "Usage: ${self} [-h|--help] [-v|--version] [ARG1] [ARG2] ..."
-    echo "Launch Quake ${role}."
+    echo "Launch Quake II ${role}."
     echo
     echo "This script supports these options:"
     echo "  -h, --help       show this help information"
     echo "  -v, --version    show version information"
-    echo "  --engine BINARY  use BINARY as the Quake engine, e.g."
-    echo "                   quake --engine=/usr/games/darkplaces"
+    echo "  --engine BINARY  use BINARY as the Quake II engine, e.g."
+    echo "                   quake2 --engine=/usr/lib/yagami-quake2/quake2"
+    echo "  --demo           use the demo data, even if the full game is"
+    echo "                   also installed"
     echo
-    echo "Any further arguments will be passed directly to the Quake engine."
+    echo "Any further arguments will be passed directly to the engine."
 }
 
 show_version() {
-    echo "Debian Quake 1 wrapper script"
+    echo "Debian Quake II wrapper script"
     echo "Please consult your apt database for the version number of this script."
     echo "Looking for data at: '$data_location'"
     echo "Using engine: '$engine_path'"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list