games-fps/sauerbraten: fix openrc support
This commit is contained in:
parent
cdb79c5112
commit
763e607bcf
@ -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"
|
@ -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 $?
|
||||
}
|
||||
|
@ -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() {
|
Loading…
Reference in New Issue
Block a user