From 0b3555740e5d8ffc13e67d76bec94ab2afcf5203 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Wed, 24 Feb 2016 20:29:19 +0100 Subject: [PATCH] games-fps/sauerbraten: initial import of version 2013.02.03 --- metadata/accounts/groups/sauerbraten.conf | 0 metadata/accounts/users/sauerbraten.conf | 4 + .../sauerbraten/files/sauerbraten.conf | 28 ++++ .../sauerbraten/files/sauerbraten.init | 97 ++++++++++++++ .../sauerbraten-2013.02.03.exheres-0 | 126 ++++++++++++++++++ 5 files changed, 255 insertions(+) create mode 100644 metadata/accounts/groups/sauerbraten.conf create mode 100644 metadata/accounts/users/sauerbraten.conf create mode 100644 packages/games-fps/sauerbraten/files/sauerbraten.conf create mode 100644 packages/games-fps/sauerbraten/files/sauerbraten.init create mode 100644 packages/games-fps/sauerbraten/sauerbraten-2013.02.03.exheres-0 diff --git a/metadata/accounts/groups/sauerbraten.conf b/metadata/accounts/groups/sauerbraten.conf new file mode 100644 index 00000000..e69de29b diff --git a/metadata/accounts/users/sauerbraten.conf b/metadata/accounts/users/sauerbraten.conf new file mode 100644 index 00000000..1a89e8f5 --- /dev/null +++ b/metadata/accounts/users/sauerbraten.conf @@ -0,0 +1,4 @@ +gecos = sauerbraten +home = /var/lib/sauerbraten +shell = /bin/bash +primary_group = sauerbraten diff --git a/packages/games-fps/sauerbraten/files/sauerbraten.conf b/packages/games-fps/sauerbraten/files/sauerbraten.conf new file mode 100644 index 00000000..e83ad029 --- /dev/null +++ b/packages/games-fps/sauerbraten/files/sauerbraten.conf @@ -0,0 +1,28 @@ +# Config file for /etc/init.d/sauerbraten + +# Owner of Sauerbraten server processes (must be existing) +USER="sauerbraten" +GROUP="sauerbraten" + + +# Whether to run the dedicated server +RUNSERVER="Yes" + +# Location of the dedicated server config directory +SERVERCONFIG="%SYSCONFDIR%" + +# Additional command line arguments to the dedicated server +SERVERARGS="" + + +# Whether to run the master server +RUNMASTER="No" + +# Location of the master server config directory +MASTERCONFIG="%SYSCONFDIR%" + +# What port should the masterserver use +MASTERPORT="28787" + +# What ip should the masterserver bind to +MASTERIP="" diff --git a/packages/games-fps/sauerbraten/files/sauerbraten.init b/packages/games-fps/sauerbraten/files/sauerbraten.init new file mode 100644 index 00000000..2ba66dcb --- /dev/null +++ b/packages/games-fps/sauerbraten/files/sauerbraten.init @@ -0,0 +1,97 @@ +#!/sbin/runscript + +rundir=${rundir:-/run/sauerbraten} + +depend() { + use net +} + +start() { + [ $(echo ${RUNMASTER} | tr '[:upper:]' '[:lower:]') = "yes" ] && start_master + [ $(echo ${RUNSERVER} | tr '[:upper:]' '[:lower:]') = "yes" ] && start_server + true +} + +start_server() { + ebegin "Starting Sauerbraten dedicated server" + + # Make sure necessary parameters are set + SERVERCONFIG="${SERVERCONFIG:-%SYSCONFDIR%}" + + if [ ! -d ${SERVERCONFIG} ]; then + einfo "No ${SERVERCONFIG} around. Creating new..." + mkdir ${SERVERCONFIG} + chown ${USER}:${GROUP} ${SERVERCONFIG} + fi + + [ -d ${rundir} ] || { + mkdir -p "${rundir}" + chown -R ${USER}:${GROUP} "${rundir}" + } + + start-stop-daemon \ + --quiet \ + --start \ + --user ${USER} \ + --group ${GROUP} \ + --chdir ${SERVERCONFIG} \ + --make-pidfile \ + --pidfile "${rundir}"/server.pid \ + --background \ + --exec %LIBEXECDIR%/sauer_server -- ${SERVERARGS} + eend $? +} + +start_master() { + ebegin "Starting Sauerbraten master server" + + # Make sure necessary parameters are set + MASTERCONFIG="${MASTERCONFIG:-%SYSCONFDIR%}" + [ -n "${MASTERIP}" ] && MASTERPORT="${MASTERPORT:-28787}" + MASTERARGS="${MASTERCONFIG}/ ${MASTERPORT} ${MASTERIP}" + + if [ ! -d ${MASTERCONFIG} ]; then + einfo "No ${MASTERCONFIG} around. Creating new..." + mkdir ${MASTERCONFIG} + chown ${USER}:${GROUP} ${MASTERCONFIG} + fi + + [ -d ${rundir} ] || { + mkdir -p "${rundir}" + chown -R ${USER}:${GROUP} "${rundir}" + } + + start-stop-daemon \ + --quiet \ + --start \ + --user ${USER} \ + --group ${GROUP} \ + --make-pidfile \ + --pidfile "${rundir}"/master.pid \ + --background \ + --exec %LIBEXECDIR%/sauer_master -- ${MASTERARGS} + eend $? +} + +stop() { + [ $(echo ${RUNSERVER} | tr '[:upper:]' '[:lower:]') = "yes" ] && stop_server + [ $(echo ${RUNMASTER} | tr '[:upper:]' '[:lower:]') = "yes" ] && stop_master + true +} + +stop_server() { + ebegin "Stopping Sauerbraten dedicated server" + start-stop-daemon --stop --retry 3 --pidfile "${rundir}"/server.pid + eend $? +} + +stop_master() { + ebegin "Stopping Sauerbraten master server" + start-stop-daemon --stop --retry 3 --pidfile "${rundir}"/master.pid + eend $? +} + +restart() { + svc_stop + svc_start +} diff --git a/packages/games-fps/sauerbraten/sauerbraten-2013.02.03.exheres-0 b/packages/games-fps/sauerbraten/sauerbraten-2013.02.03.exheres-0 new file mode 100644 index 00000000..c6c1b5d4 --- /dev/null +++ b/packages/games-fps/sauerbraten/sauerbraten-2013.02.03.exheres-0 @@ -0,0 +1,126 @@ +# Copyright 2016 Julian Ospald +# Distributed under the terms of the GNU General Public License v2 + +require gtk-icon-cache + +EDITION="collect_edition" +SUMMARY="Cube 2: Sauerbraten is an open source game engine (Cube 2) with freeware game data (Sauerbraten)" +HOMEPAGE="http://sauerbraten.org/" +DOWNLOADS="mirror://sourceforge/sauerbraten/sauerbraten/2013_01_04/sauerbraten_${PV//./_}_${EDITION}_linux.tar.bz2" + +LICENCES="ZLIB freedist" +SLOT="0" +PLATFORMS="~amd64 ~x86" +MYOPTIONS="" + +DEPENDENCIES=" + build+run: + media-libs/SDL:0[X] + media-libs/SDL_image:1 + media-libs/SDL_mixer:0[ogg] + x11-libs/libX11 + sys-libs/zlib + x11-dri/glu + x11-dri/mesa + run: + group/sauerbraten [[ note = [ for server ] ]] + user/sauerbraten [[ note = [ for server ] ]] +" + +WORK=${WORKBASE}/${PN} + +src_prepare() { + edo rm -r sauerbraten_unix bin_unix src/{include,lib,vcpp} + + default + + # Fix links so they point to the correct directory + edo sed -i -e 's:docs/::' README.html +} + +src_compile() { + emake -C src master server client +} + +src_install() { + local LIBEXECDIR="/usr/$(exhost --target)/libexec/${PN}" + local DATADIR="/usr/share/${PN}" + local STATEDIR="/var/lib/${PN}" + + # Install the game data + insinto "${DATADIR}" + doins -r data packages + + # Install the client executable + exeinto "${LIBEXECDIR}" + doexe src/sauer_client + + # Install the client wrapper + herebin ${PN}-client <