diff options
author | Tristan Heaven <tristan@gentoo.org> | 2009-10-01 16:03:40 +0000 |
---|---|---|
committer | Tristan Heaven <tristan@gentoo.org> | 2009-10-01 16:03:40 +0000 |
commit | 5e3618de7c62b17deac8db6be53ebf5684c3d868 (patch) | |
tree | 5c7e4dde93ecdf9ad9ce7bddf89c9d946b5fd546 /eclass/games-mods.eclass | |
parent | Remove USE sse from mpg123's mask since there's x86_64 opts in all available ... (diff) | |
download | historical-5e3618de7c62b17deac8db6be53ebf5684c3d868.tar.gz historical-5e3618de7c62b17deac8db6be53ebf5684c3d868.tar.bz2 historical-5e3618de7c62b17deac8db6be53ebf5684c3d868.zip |
use games_make_wrapper instead of own function; move installation of confd and initd files into the games-mod_make* functions
Diffstat (limited to 'eclass/games-mods.eclass')
-rw-r--r-- | eclass/games-mods.eclass | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/eclass/games-mods.eclass b/eclass/games-mods.eclass index 2305b47199e4..bac789a882ad 100644 --- a/eclass/games-mods.eclass +++ b/eclass/games-mods.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/games-mods.eclass,v 1.25 2009/10/01 14:05:04 nyhm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/games-mods.eclass,v 1.26 2009/10/01 16:03:40 nyhm Exp $ # Variables to specify in an ebuild which uses this eclass: # GAME - (doom3, quake4 or ut2004, etc), unless ${PN} starts with e.g. "doom3-" @@ -351,15 +351,11 @@ games-mods_src_install() { dosym "${GAMES_SYSCONFDIR}"/${GAME}/${MOD_DIR}/server.cfg \ "${GAMES_PREFIX}"/${DED_CFG_DIR}/${MOD_DIR}/server.cfg fi - games-mods_make_ded_exec - newgamesbin "${T}"/${GAME_EXE}-${MOD_DIR}-ded.bin \ - ${GAME_EXE}-${MOD_DIR}-ded || die "dedicated" - games-mods_make_init.d - newinitd "${T}"/${GAME_EXE}-${MOD_DIR}-ded.init.d \ - ${GAME_EXE}-${MOD_DIR}-ded || die "init.d" - games-mods_make_conf.d - newconfd "${T}"/${GAME_EXE}-${MOD_DIR}-ded.conf.d \ - ${GAME_EXE}-${MOD_DIR}-ded || die "conf.d" + games_make_wrapper \ + ${GAME_EXE}-${MOD_DIR}-ded \ + "${DED_EXE} ${SELECT_MOD}${MOD_DIR} ${DED_OPTIONS}" + games-mods_make_initd + games-mods_make_confd fi prepgamesdirs @@ -390,51 +386,41 @@ games-mods_pkg_postinst() { fi } -games-mods_make_ded_exec() { - cat <<-EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded.bin - #!/bin/sh - ${GAMES_BINDIR}/${DED_EXE} ${SELECT_MOD}${MOD_DIR} ${DED_OPTIONS} \${@} - EOF -} - -games-mods_make_init.d() { - cat <<EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded.init.d +games-mods_make_initd() { + cat <<EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded #!/sbin/runscript -$(<${PORTDIR}/header.txt) +$(head -n 2 ${PORTDIR}/header.txt) +# Generated by games-mods.eclass depend() { need net } start() { - ebegin "Starting ${GAME_TITLE} - ${MOD_NAME} dedicated server" + ebegin "Starting ${GAME_TITLE} ${MOD_NAME} dedicated server" start-stop-daemon --start --quiet --background --chuid \\ ${GAMES_USER_DED}:games --env HOME="${GAMES_PREFIX}" --exec \\ - ${GAMES_BINDIR}/${GAME_EXE}-${MOD_DIR}-ded \\ - \${${GAME_EXE}_${MOD_DIR}_OPTS} + ${GAMES_BINDIR}/${GAME_EXE}-${MOD_DIR}-ded -- \\ + \${${GAME_EXE}_${MOD_DIR}_opts} eend \$? } stop() { - ebegin "Stopping ${GAME_TITLE} - ${MOD_NAME} dedicated server" + ebegin "Stopping ${GAME_TITLE} ${MOD_NAME} dedicated server" start-stop-daemon --stop --quiet --exec \\ ${GAMES_BINDIR}/${GAME_EXE}-${MOD_DIR}-ded eend \$? } EOF -} -games-mods_make_conf.d() { - if [[ -e ${FILESDIR}/${GAME_EXE}-${MOD_DIR}.conf.d ]] ; then - cp "${FILESDIR}"/${GAME_EXE}-${MOD_DIR}.conf.d \ - "${T}"/${GAME_EXE}-${MOD_DIR}-ded.conf.d - return 0 - fi -cat <<-EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded.conf.d - $(<${PORTDIR}/header.txt) + doinitd "${T}"/${GAME_EXE}-${MOD_DIR}-ded || die "doinitd failed" +} +games-mods_make_confd() { + cat <<-EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded # Any extra options you want to pass to the dedicated server - # ${GAME_EXE}_${MOD_DIR}_OPTS="+set com_hunkmegs 64 +set com_zonemegs 32" - + ${GAME_EXE}_${MOD_DIR}_opts="" EOF + + doconfd "${T}"/${GAME_EXE}-${MOD_DIR}-ded || die "doconfd failed" } |