From 763e607bcf1e2c768d5794ff2aadc57ad46f26f3 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 23 May 2016 15:20:25 +0200 Subject: [PATCH] games-fps/sauerbraten: fix openrc support --- .../confd/sauerbraten} | 4 ++-- .../initd/sauerbraten} | 8 ++++---- ...es-0 => sauerbraten-2013.02.03-r1.exheres-0} | 17 +++-------------- 3 files changed, 9 insertions(+), 20 deletions(-) rename packages/games-fps/sauerbraten/files/{sauerbraten.conf => openrc/confd/sauerbraten} (88%) rename packages/games-fps/sauerbraten/files/{sauerbraten.init => openrc/initd/sauerbraten} (89%) rename packages/games-fps/sauerbraten/{sauerbraten-2013.02.03.exheres-0 => sauerbraten-2013.02.03-r1.exheres-0} (84%) diff --git a/packages/games-fps/sauerbraten/files/sauerbraten.conf b/packages/games-fps/sauerbraten/files/openrc/confd/sauerbraten similarity index 88% rename from packages/games-fps/sauerbraten/files/sauerbraten.conf rename to packages/games-fps/sauerbraten/files/openrc/confd/sauerbraten index e83ad029..f0c2896b 100644 --- a/packages/games-fps/sauerbraten/files/sauerbraten.conf +++ b/packages/games-fps/sauerbraten/files/openrc/confd/sauerbraten @@ -9,7 +9,7 @@ GROUP="sauerbraten" RUNSERVER="Yes" # Location of the dedicated server config directory -SERVERCONFIG="%SYSCONFDIR%" +SERVERCONFIG="/var/lib/sauerbraten" # Additional command line arguments to the dedicated server SERVERARGS="" @@ -19,7 +19,7 @@ SERVERARGS="" RUNMASTER="No" # Location of the master server config directory -MASTERCONFIG="%SYSCONFDIR%" +MASTERCONFIG="/var/lib/sauerbraten" # What port should the masterserver use MASTERPORT="28787" diff --git a/packages/games-fps/sauerbraten/files/sauerbraten.init b/packages/games-fps/sauerbraten/files/openrc/initd/sauerbraten similarity index 89% rename from packages/games-fps/sauerbraten/files/sauerbraten.init rename to packages/games-fps/sauerbraten/files/openrc/initd/sauerbraten index 2ba66dcb..5ff5e3c1 100644 --- a/packages/games-fps/sauerbraten/files/sauerbraten.init +++ b/packages/games-fps/sauerbraten/files/openrc/initd/sauerbraten @@ -16,7 +16,7 @@ start_server() { ebegin "Starting Sauerbraten dedicated server" # Make sure necessary parameters are set - SERVERCONFIG="${SERVERCONFIG:-%SYSCONFDIR%}" + SERVERCONFIG="${SERVERCONFIG:-/var/lib/sauerbraten}" if [ ! -d ${SERVERCONFIG} ]; then einfo "No ${SERVERCONFIG} around. Creating new..." @@ -38,7 +38,7 @@ start_server() { --make-pidfile \ --pidfile "${rundir}"/server.pid \ --background \ - --exec %LIBEXECDIR%/sauer_server -- ${SERVERARGS} + --exec /usr/libexec/sauerbraten/sauer_server -- ${SERVERARGS} eend $? } @@ -46,7 +46,7 @@ start_master() { ebegin "Starting Sauerbraten master server" # Make sure necessary parameters are set - MASTERCONFIG="${MASTERCONFIG:-%SYSCONFDIR%}" + MASTERCONFIG="${MASTERCONFIG:-/var/lib/sauerbraten}" [ -n "${MASTERIP}" ] && MASTERPORT="${MASTERPORT:-28787}" MASTERARGS="${MASTERCONFIG}/ ${MASTERPORT} ${MASTERIP}" @@ -69,7 +69,7 @@ start_master() { --make-pidfile \ --pidfile "${rundir}"/master.pid \ --background \ - --exec %LIBEXECDIR%/sauer_master -- ${MASTERARGS} + --exec /usr/libexec/sauerbraten/sauer_master -- ${MASTERARGS} eend $? } diff --git a/packages/games-fps/sauerbraten/sauerbraten-2013.02.03.exheres-0 b/packages/games-fps/sauerbraten/sauerbraten-2013.02.03-r1.exheres-0 similarity index 84% rename from packages/games-fps/sauerbraten/sauerbraten-2013.02.03.exheres-0 rename to packages/games-fps/sauerbraten/sauerbraten-2013.02.03-r1.exheres-0 index 82b04f42..e18336ce 100644 --- a/packages/games-fps/sauerbraten/sauerbraten-2013.02.03.exheres-0 +++ b/packages/games-fps/sauerbraten/sauerbraten-2013.02.03-r1.exheres-0 @@ -5,6 +5,7 @@ EDITION="collect_edition" require gtk-icon-cache \ sourceforge [ pnv=sauerbraten_${PV//./_}_${EDITION}_linux ] +require openrc-service [ openrc_confd_files=[ "${FILES}"/openrc/confd ] ] SUMMARY="Cube 2: Sauerbraten is an open source game engine (Cube 2) with freeware game data (Sauerbraten)" HOMEPAGE="http://sauerbraten.org/" @@ -96,26 +97,14 @@ EOF exec "${LIBEXECDIR}/sauer_master" ${STATEDIR} "\$@" EOF - # Install the server init script - edo cp "${FILES}"/${PN}.init "${TEMP}" - edo sed -i \ - -e "s:%SYSCONFDIR%:${STATEDIR}:g" \ - -e "s:%LIBEXECDIR%:${LIBEXECDIR}:g" \ - "${TEMP}"/${PN}.init - newinitd "${TEMP}"/${PN}.init ${PN} - edo cp "${FILES}"/${PN}.conf "${TEMP}" - edo sed -i \ - -e "s:%SYSCONFDIR%:${STATEDIR}:g" \ - -e "s:%LIBEXECDIR%:${LIBEXECDIR}:g" \ - "${TEMP}"/${PN}.conf - newconfd "${TEMP}"/${PN}.conf ${PN} - dodoc src/*.txt docs/dev/*.txt insinto /usr/share/doc/${PNVR}/html doins -r README.html docs/* edo chown sauerbraten:sauerbraten "${IMAGE%/}/${STATEDIR}" + + install_openrc_files } pkg_postinst() {