diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-11-16 03:24:56 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-11-16 03:24:56 +0000 |
commit | 65206801a13ce34282a5e0a6717b5c0da5b13609 (patch) | |
tree | d0c3eb374b8d029a07a3fa457c0db44722e798cf /games-server | |
parent | bump (diff) | |
download | gentoo-2-65206801a13ce34282a5e0a6717b5c0da5b13609.tar.gz gentoo-2-65206801a13ce34282a5e0a6717b5c0da5b13609.tar.bz2 gentoo-2-65206801a13ce34282a5e0a6717b5c0da5b13609.zip |
update instructions and add init.d script #112526 by Kai Lippok
(Portage version: 2.0.53_rc7)
Diffstat (limited to 'games-server')
-rw-r--r-- | games-server/halflife-steam/files/hlds.confd | 14 | ||||
-rw-r--r-- | games-server/halflife-steam/files/hlds.rc | 38 | ||||
-rw-r--r-- | games-server/halflife-steam/halflife-steam-2.0.ebuild | 28 |
3 files changed, 71 insertions, 9 deletions
diff --git a/games-server/halflife-steam/files/hlds.confd b/games-server/halflife-steam/files/hlds.confd new file mode 100644 index 000000000000..ccea142ce1e1 --- /dev/null +++ b/games-server/halflife-steam/files/hlds.confd @@ -0,0 +1,14 @@ +# /etc/conf.d/hlds: config file for halflife steam server + +# Path to game +HLDS_PATH="@GAMESDIR@" + +# Machine type: The binary you want to start +# For Source-based games use the following values: +# srcds_amd for Athlon and x64 systems +# srcds_i486 for non-MMX capable machines +# srcds_i686 on most x86 systems +#HLDS_MT="srcds_i686" + +# Here you can set your start options like game type and maxplayers ... +HLDS_OPTS="-console -port 27015 -game cstrike +map de_dust +maxplayers 6" diff --git a/games-server/halflife-steam/files/hlds.rc b/games-server/halflife-steam/files/hlds.rc new file mode 100644 index 000000000000..14720fe0cec1 --- /dev/null +++ b/games-server/halflife-steam/files/hlds.rc @@ -0,0 +1,38 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/files/hlds.rc,v 1.1 2005/11/16 03:24:56 vapier Exp $ + +depend() { + use net +} + +checkconfig() { + local var + for var in HLDS_PATH HLDS_MT HLDS_OPTS ; do + if [[ -z ${!var} ]] ; then + eerror "Need to set ${var} in /etc/conf.d/HLDS_PATH" + return 1 + fi + done + return 0 +} + +start() { + checkconfig || return $? + + ebegin "Starting Halflife Dedicated Server" + export LD_LIBRARY_PATH=${HLDS_PATH}:${HLDS_PATH}/bin:${LD_LIBRARY_PATH} + start-stop-daemon --start \ + --chdir ${HLDS_PATH} -c @GAMES_USER@:@GAMES_GROUP@ \ + -n ${HLDS_MT} -b -a ${HLDS_PATH}/${HLDS_MT} \ + -- \ + -pidfile /var/run/hlds.pid ${HLDS_OPTS} + eend $? +} + +stop() { + ebegin "Stopping Halflife Dedicated Server" + start-stop-daemon --stop --pidfile /var/run/hlds.pid + eend $? +} diff --git a/games-server/halflife-steam/halflife-steam-2.0.ebuild b/games-server/halflife-steam/halflife-steam-2.0.ebuild index 1ac4cba85f27..0043645f4719 100644 --- a/games-server/halflife-steam/halflife-steam-2.0.ebuild +++ b/games-server/halflife-steam/halflife-steam-2.0.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/halflife-steam-2.0.ebuild,v 1.10 2005/09/26 18:19:59 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/halflife-steam-2.0.ebuild,v 1.11 2005/11/16 03:24:56 vapier Exp $ inherit eutils games @@ -23,9 +23,19 @@ src_unpack() { src_install() { exeinto "${GAMES_PREFIX_OPT}"/halflife - doexe steam + doexe steam || die - games_make_wrapper steam ./steam "${GAMES_PREFIX_OPT}"/halflife + newinitd "${FILESDIR}"/hlds.rc hlds + sed -i \ + -e "s:@GAMES_USER@:${GAMES_USER_DED}:" \ + -e "s:@GAMES_GROUP@:${GAMES_GROUP}:" \ + "${D}"/etc/init.d/hlds || die "sed init.d" + newconfd "${FILESDIR}"/hlds.confd hlds + sed -i \ + -e "s:@GAMESDIR@:${GAMES_PREFIX_OPT}/halflife:" \ + "${D}"/etc/conf.d/hlds || die "sed conf.d" + + games_make_wrapper steam ./steam "${GAMES_PREFIX_OPT}"/halflife "${GAMES_PREFIX_OPT}"/halflife prepgamesdirs } @@ -36,14 +46,14 @@ pkg_postinst() { einfo 'Steam Usage ! (note: please do this as root)' einfo '1. Run `steam` to update itself.' einfo '2. Run `steam` again to get help menu.' - einfo '3. Create an account:' - einfo ' steam -command create -username foobar -email linux1@here.com -password comPlexPass -question "Your hint" -answer "answer"' - einfo '4. Update the halflife modules you want:' - einfo " steam -command update -game cstrike -dir ${GAMES_PREFIX_OPT}/halflife -username -email linux1@here.com -password comPlexPass" - einfo " steam -command update -game tfc -dir ${GAMES_PREFIX_OPT}/halflife -username -email linux1@here.com -password comPlexPass" - einfo " steam -command update -game valve -dir ${GAMES_PREFIX_OPT}/halflife -username -email linux1@here.com -password comPlexPass" + einfo '3. Update the halflife modules you want:' + einfo " steam -command update -game 'Counter-Strike Source' -dir ${GAMES_PREFIX_OPT}/halflife" + einfo " steam -command update -game cstrike -dir ${GAMES_PREFIX_OPT}/halflife" + einfo " steam -command update -game tfc -dir ${GAMES_PREFIX_OPT}/halflife" + einfo " steam -command update -game valve -dir ${GAMES_PREFIX_OPT}/halflife" einfo ' *Note: tfc contains tfc, dmc, and ricochet mods' einfo '5. After your first update, you only have to run:' + einfo ' steam -update "Counter-Strike Source"' einfo ' steam -update cstrike' einfo ' steam -update tfc' einfo ' steam -update valve' |