games-fps/sauerbraten: fix openrc support
This commit is contained in:
parent
cdb79c5112
commit
763e607bcf
@ -9,7 +9,7 @@ GROUP="sauerbraten"
|
|||||||
RUNSERVER="Yes"
|
RUNSERVER="Yes"
|
||||||
|
|
||||||
# Location of the dedicated server config directory
|
# Location of the dedicated server config directory
|
||||||
SERVERCONFIG="%SYSCONFDIR%"
|
SERVERCONFIG="/var/lib/sauerbraten"
|
||||||
|
|
||||||
# Additional command line arguments to the dedicated server
|
# Additional command line arguments to the dedicated server
|
||||||
SERVERARGS=""
|
SERVERARGS=""
|
||||||
@ -19,7 +19,7 @@ SERVERARGS=""
|
|||||||
RUNMASTER="No"
|
RUNMASTER="No"
|
||||||
|
|
||||||
# Location of the master server config directory
|
# Location of the master server config directory
|
||||||
MASTERCONFIG="%SYSCONFDIR%"
|
MASTERCONFIG="/var/lib/sauerbraten"
|
||||||
|
|
||||||
# What port should the masterserver use
|
# What port should the masterserver use
|
||||||
MASTERPORT="28787"
|
MASTERPORT="28787"
|
@ -16,7 +16,7 @@ start_server() {
|
|||||||
ebegin "Starting Sauerbraten dedicated server"
|
ebegin "Starting Sauerbraten dedicated server"
|
||||||
|
|
||||||
# Make sure necessary parameters are set
|
# Make sure necessary parameters are set
|
||||||
SERVERCONFIG="${SERVERCONFIG:-%SYSCONFDIR%}"
|
SERVERCONFIG="${SERVERCONFIG:-/var/lib/sauerbraten}"
|
||||||
|
|
||||||
if [ ! -d ${SERVERCONFIG} ]; then
|
if [ ! -d ${SERVERCONFIG} ]; then
|
||||||
einfo "No ${SERVERCONFIG} around. Creating new..."
|
einfo "No ${SERVERCONFIG} around. Creating new..."
|
||||||
@ -38,7 +38,7 @@ start_server() {
|
|||||||
--make-pidfile \
|
--make-pidfile \
|
||||||
--pidfile "${rundir}"/server.pid \
|
--pidfile "${rundir}"/server.pid \
|
||||||
--background \
|
--background \
|
||||||
--exec %LIBEXECDIR%/sauer_server -- ${SERVERARGS}
|
--exec /usr/libexec/sauerbraten/sauer_server -- ${SERVERARGS}
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ start_master() {
|
|||||||
ebegin "Starting Sauerbraten master server"
|
ebegin "Starting Sauerbraten master server"
|
||||||
|
|
||||||
# Make sure necessary parameters are set
|
# Make sure necessary parameters are set
|
||||||
MASTERCONFIG="${MASTERCONFIG:-%SYSCONFDIR%}"
|
MASTERCONFIG="${MASTERCONFIG:-/var/lib/sauerbraten}"
|
||||||
[ -n "${MASTERIP}" ] && MASTERPORT="${MASTERPORT:-28787}"
|
[ -n "${MASTERIP}" ] && MASTERPORT="${MASTERPORT:-28787}"
|
||||||
MASTERARGS="${MASTERCONFIG}/ ${MASTERPORT} ${MASTERIP}"
|
MASTERARGS="${MASTERCONFIG}/ ${MASTERPORT} ${MASTERIP}"
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ start_master() {
|
|||||||
--make-pidfile \
|
--make-pidfile \
|
||||||
--pidfile "${rundir}"/master.pid \
|
--pidfile "${rundir}"/master.pid \
|
||||||
--background \
|
--background \
|
||||||
--exec %LIBEXECDIR%/sauer_master -- ${MASTERARGS}
|
--exec /usr/libexec/sauerbraten/sauer_master -- ${MASTERARGS}
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
|
@ -5,6 +5,7 @@ EDITION="collect_edition"
|
|||||||
|
|
||||||
require gtk-icon-cache \
|
require gtk-icon-cache \
|
||||||
sourceforge [ pnv=sauerbraten_${PV//./_}_${EDITION}_linux ]
|
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)"
|
SUMMARY="Cube 2: Sauerbraten is an open source game engine (Cube 2) with freeware game data (Sauerbraten)"
|
||||||
HOMEPAGE="http://sauerbraten.org/"
|
HOMEPAGE="http://sauerbraten.org/"
|
||||||
@ -96,26 +97,14 @@ EOF
|
|||||||
exec "${LIBEXECDIR}/sauer_master" ${STATEDIR} "\$@"
|
exec "${LIBEXECDIR}/sauer_master" ${STATEDIR} "\$@"
|
||||||
EOF
|
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
|
dodoc src/*.txt docs/dev/*.txt
|
||||||
|
|
||||||
insinto /usr/share/doc/${PNVR}/html
|
insinto /usr/share/doc/${PNVR}/html
|
||||||
doins -r README.html docs/*
|
doins -r README.html docs/*
|
||||||
|
|
||||||
edo chown sauerbraten:sauerbraten "${IMAGE%/}/${STATEDIR}"
|
edo chown sauerbraten:sauerbraten "${IMAGE%/}/${STATEDIR}"
|
||||||
|
|
||||||
|
install_openrc_files
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
Loading…
Reference in New Issue
Block a user