[SCM] Packaging for the OpenArena engine branch, master, updated. debian/0.8.5-5+exp1-4-g315c454

Simon McVittie smcv at debian.org
Thu Nov 11 22:48:38 UTC 2010


The following commit has been merged in the master branch:
commit 0d28d2aa2b14d164878d368ca63b1c1ff9b4beb0
Author: Simon McVittie <smcv at debian.org>
Date:   Thu Nov 11 20:14:51 2010 +0000

    Create a Debian-openarena user and install an init script (off by default) (Closes: #503106)
    
    * Create a Debian-openarena user and install an init script (off by default)
      (Closes: #503106)
    * Add a README.Debian explaining alternative ways to run the server

diff --git a/debian/changelog b/debian/changelog
index d094d5b..a04525f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+openarena (0.8.5-5+exp2) UNRELEASED; urgency=low
+
+  * Create a Debian-openarena user and install an init script (off by default)
+    (Closes: #503106)
+  * Add a README.Debian explaining alternative ways to run the server
+
+ -- Simon McVittie <smcv at debian.org>  Thu, 11 Nov 2010 20:13:30 +0000
+
 openarena (0.8.5-5+exp1) experimental; urgency=low
 
   * Install wrapper scripts for ioquake3, instead of our own engine
diff --git a/debian/control b/debian/control
index db21b5c..19d4e8b 100644
--- a/debian/control
+++ b/debian/control
@@ -31,7 +31,8 @@ Package: openarena-server
 Architecture: any
 Depends: ${misc:Depends}, ${shlibs:Depends},
          openarena-data (>= 0.8.5), openarena-data (<< 0.8.6~),
-         ioquake3-server
+         ioquake3-server,
+         adduser
 Description: server and game logic for the game OpenArena
  OpenArena is an open-source content package for ioQuake3 licensed under the
  GPL, effectively creating a free stand-alone game. Though OpenArena is a free
diff --git a/debian/openarena-server.README.Debian b/debian/openarena-server.README.Debian
new file mode 100644
index 0000000..784b2c9
--- /dev/null
+++ b/debian/openarena-server.README.Debian
@@ -0,0 +1,52 @@
+OpenArena dedicated server for Debian
+=====================================
+
+Running the server via sysvinit
+-------------------------------
+
+By default, openarena-server adds a user under which to run the dedicated
+server (Debian-openarena) but does not actually start the dedicated server.
+
+To run the dedicated server in the conventional Debian way, edit
+/etc/default/openarena-server and set START_DAEMON to 1. This is a simple
+setup suitable for running one server on a machine; by default it will
+[FIXME]
+
+The Debian-openarena user's home directory is /var/games/openarena-server,
+so you can find OA files in the /var/games/openarena-server/.openarena
+directory.
+
+By default, the init script will use
+/usr/lib/games/openarena/baseoa/debian_server.cfg, which is a symlink to
+/etc/openarena-server/server.cfg. You can edit this file, or put an alternative
+configuration in /var/games/openarena-server/.openarena/baseoa and change
+/etc/default/openarena-server to exec that.
+
+There are various alternative ways you can run the server if this doesn't
+meet your requirements.
+
+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 net_port on each server after
+the first, and it's safest to give each server a unique fs_homepath so they
+don't overwrite each other's configuration files.
+
+To do this, you could put something like this in the Debian-openarena user's
+crontab (don't break the long lines!):
+
+    @reboot screen -d -m -S ffa /usr/games/openarena-server +set fs_homepath /var/games/openarena-server/ffa +exec ffa.cfg
+    @reboot screen -d -m -S ctf /usr/games/openarena-server +set fs_homepath /var/games/openarena-server/ctf +set net_port 54321 +exec ctf.cfg
+
+or in /etc/crontab or a file in /etc/cron.d:
+
+    @reboot Debian-openarena screen -d -m -S ffa /usr/games/openarena-server +set fs_homepath /var/games/openarena-server/ffa +exec ffa.cfg
+    @reboot Debian-openarena screen -d -m -S ctf /usr/games/openarena-server +set fs_homepath /var/games/openarena-server/ctf +set net_port 54321 +exec ctf.cfg
+
+If you do that, you can access the servers' consoles by attaching a screen
+session to them:
+
+    sudo -u Debian-openarena screen -r ffa
+    sudo -u Debian-openarena screen -r ctf
diff --git a/debian/openarena-server.default b/debian/openarena-server.default
new file mode 100644
index 0000000..349cc96
--- /dev/null
+++ b/debian/openarena-server.default
@@ -0,0 +1,14 @@
+# Defaults for OpenArena init script
+# sourced by /etc/init.d/openarena-server
+# installed at /etc/default/openarena-server by the maintainer scripts
+
+# set to 1 to enable
+START_DAEMON=0
+
+# Additional options that are passed to the daemon.
+# Add "+set dedicated 2" here, or "set dedicated 2" in server.cfg, if you want
+# your server advertised on the public server list.
+#
+# debian_server.cfg is a symlink to /etc/openarena-server/server.cfg, so you
+# can use that file for system-wide configuration.
+DAEMON_OPTS="+exec debian_server.cfg"
diff --git a/debian/openarena-server.init b/debian/openarena-server.init
new file mode 100644
index 0000000..22b9547
--- /dev/null
+++ b/debian/openarena-server.init
@@ -0,0 +1,90 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          openarena-server
+# Required-Start:    $remote_fs $network
+# Required-Stop:     $remote_fs $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start OpenArena game server
+### END INIT INFO
+
+PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+NAME="openarena-server"
+DAEMON="/usr/games/$NAME"
+DESC="OpenArena dedicated server"
+PIDFILE="/var/run/$NAME.pid"
+BINARY="/usr/lib/ioquake3/ioq3ded"
+USER="Debian-openarena"
+
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+# Include defaults if available
+if [ -f /etc/default/$NAME ] ; then
+	. /etc/default/$NAME
+fi
+
+q3_start() {
+    if [ -f $PIDFILE ]; then
+        return 2
+    fi
+    if [ "$START_DAEMON" != 1 ]; then
+        echo -n " (not starting - disabled in /etc/default/$NAME)"
+        return 0
+    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
+}
+
+q3_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"
+        q3_start
+        log_end_msg $?
+	;;
+    stop)
+        log_begin_msg "Stopping $DESC: $NAME"
+        q3_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"
+        q3_stop && sleep 1 && q3_start
+        log_end_msg $?
+	;;
+    *)
+	# echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/debian/openarena-server.install b/debian/openarena-server.install
index c6ad6b7..df5bcbd 100644
--- a/debian/openarena-server.install
+++ b/debian/openarena-server.install
@@ -1,3 +1,4 @@
+debian/server.cfg etc/openarena-server
 debian/scripts/openarena-server usr/games
 debian/tmp/usr/lib/games/openarena/*/*.so
 debian/tmp/usr/lib/games/openarena/*/*/*.so
diff --git a/debian/openarena-server.links b/debian/openarena-server.links
index 519973c..4efd157 100644
--- a/debian/openarena-server.links
+++ b/debian/openarena-server.links
@@ -1,3 +1,4 @@
+etc/openarena-server/server.cfg usr/lib/games/openarena/baseoa/debian_server.cfg
 usr/share/doc/openarena-data/changelog.gz usr/share/doc/openarena-server/changelog.gz
 usr/share/doc/openarena-data/CREDITS usr/share/doc/openarena-server/CREDITS
 usr/share/doc/openarena-data/LINUXNOTES usr/share/doc/openarena-server/LINUXNOTES
diff --git a/debian/openarena-server.postinst b/debian/openarena-server.postinst
new file mode 100644
index 0000000..04b6a23
--- /dev/null
+++ b/debian/openarena-server.postinst
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+  configure)
+    if ! getent passwd Debian-openarena >/dev/null; then
+      adduser --disabled-password --quiet --system \
+        --home /var/games/openarena-server --no-create-home \
+        --gecos "OpenArena dedicated server" \
+	--ingroup games --force-badname Debian-openarena
+    fi
+    install -d /var/games
+    install -d -o Debian-openarena -g games /var/games/openarena-server
+  ;;
+  abort-upgrade|abort-remove|abort-deconfigure)
+  ;;
+  *)
+    echo "postinst called with unknown argument \`$1'" >&2
+    exit 1
+  ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/openarena-server.postrm b/debian/openarena-server.postrm
new file mode 100644
index 0000000..a028060
--- /dev/null
+++ b/debian/openarena-server.postrm
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if [ "$1" = "purge" ] ; then
+    deluser --quiet --system Debian-openarena > /dev/null || true
+fi
diff --git a/debian/server.cfg b/debian/server.cfg
new file mode 100644
index 0000000..0858962
--- /dev/null
+++ b/debian/server.cfg
@@ -0,0 +1,26 @@
+// Sample server configuration for OpenArena in Debian
+
+// set dedicated to 2 (default is 1) to advertise your server in the global
+// server list
+//set dedicated 2
+
+// name of your server
+//sv_hostname "An anonymous Debian server"
+
+// Type of game to run
+// 0 = free-for-all deathmatch
+// 1 = tournament 1-on-1
+// 3 = team deathmatch
+// 4 = CTF
+// 5 = 1-flag CTF
+// 6 = obelisk
+// 7 = harvester
+// 8 = team elimination
+// 9 = CTF elimination
+// 10 = last man standing
+// 11 = double domination
+// 12 = domination
+g_gametype 0
+
+// Start this map first
+map oa_dm1

-- 
Packaging for the OpenArena engine



More information about the Pkg-games-commits mailing list