diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-09-24 01:08:26 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-09-24 01:08:26 +0000 |
commit | ac6608ebc421039ec7bc86f496c9a44f1dfcf50a (patch) | |
tree | d5283a15d61043ea6ffde7a64fa6355503a79129 /eclass/games-q3mod.eclass | |
parent | Remove masking for libcdio-0.75-r2 as it never made it into the tree actually. (diff) | |
download | gentoo-2-ac6608ebc421039ec7bc86f496c9a44f1dfcf50a.tar.gz gentoo-2-ac6608ebc421039ec7bc86f496c9a44f1dfcf50a.tar.bz2 gentoo-2-ac6608ebc421039ec7bc86f496c9a44f1dfcf50a.zip |
quote the hell out of variables and only announce the -ded script if USE=dedicated #107039
Diffstat (limited to 'eclass/games-q3mod.eclass')
-rw-r--r-- | eclass/games-q3mod.eclass | 73 |
1 files changed, 35 insertions, 38 deletions
diff --git a/eclass/games-q3mod.eclass b/eclass/games-q3mod.eclass index 546f531c57f8..a3d9c50caa79 100644 --- a/eclass/games-q3mod.eclass +++ b/eclass/games-q3mod.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/games-q3mod.eclass,v 1.28 2005/07/06 20:23:20 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/games-q3mod.eclass,v 1.29 2005/09/24 01:08:26 vapier Exp $ inherit games @@ -14,8 +14,7 @@ KEYWORDS="-* x86 amd64" IUSE="opengl X dedicated" DEPEND="app-arch/unzip" -RDEPEND="virtual/libc - games-fps/quake3 +RDEPEND="games-fps/quake3 amd64? ( app-emulation/emul-linux-x86-baselibs X? ( app-emulation/emul-linux-x86-xlibs ) ) dedicated? ( app-misc/screen ) @@ -25,84 +24,82 @@ RDEPEND="virtual/libc S=${WORKDIR} games-q3mod_src_install() { - [ -z "${MOD_NAME}" ] && die "what is the name of this q3mod ?" + [[ -z ${MOD_NAME} ]] && die "what is the name of this q3mod ?" local bdir=${GAMES_PREFIX_OPT}/quake3 local mdir=${bdir}/${MOD_NAME} MOD_BINS=${MOD_BINS:-${MOD_NAME}} - if [ -d ${MOD_NAME} ] ; then - dodir ${bdir} - mv ${MOD_NAME} ${D}/${bdir}/ + if [[ -d ${MOD_NAME} ]] ; then + dodir "${bdir}" + mv ${MOD_NAME} "${D}/${bdir}/" fi - if [ -d baseq3 ] ; then - dodir ${bdir} - mv baseq3 ${D}/${bdir}/ + if [[ -d baseq3 ]] ; then + dodir "${bdir}" + mv baseq3 "${D}/${bdir}/" fi - if [ ! -z "`ls ${S}/* 2> /dev/null`" ] ; then - dodir ${mdir} - mv ${S}/* ${D}/${mdir}/ + if [[ ! -z $(ls "${S}"/* 2> /dev/null) ]] ; then + dodir "${mdir}" + mv "${S}"/* "${D}/${mdir}/" fi if use dedicated; then games-q3mod_make_q3ded_exec - newgamesbin ${T}/q3${MOD_NAME}-ded.bin q3${MOD_BINS}-ded + newgamesbin "${T}"/q3${MOD_NAME}-ded.bin q3${MOD_BINS}-ded fi games-q3mod_make_quake3_exec - newgamesbin ${T}/quake3-${MOD_NAME}.bin quake3-${MOD_BINS} + newgamesbin "${T}"/quake3-${MOD_NAME}.bin quake3-${MOD_BINS} if use dedicated; then games-q3mod_make_init.d - exeinto /etc/init.d - newexe ${T}/q3${MOD_NAME}-ded.init.d q3${MOD_BINS}-ded + newinitd "${T}"/q3${MOD_NAME}-ded.init.d q3${MOD_BINS}-ded games-q3mod_make_conf.d - insinto /etc/conf.d - newins ${T}/q3${MOD_NAME}-ded.conf.d q3${MOD_BINS}-ded + newconfd "${T}"/q3${MOD_NAME}-ded.conf.d q3${MOD_BINS}-ded fi - dodir ${GAMES_SYSCONFDIR}/quake3 + dodir "${GAMES_SYSCONFDIR}"/quake3 - dodir ${bdir}/q3a-homedir - dosym ${bdir}/q3a-homedir ${GAMES_PREFIX}/.q3a - keepdir ${bdir}/q3a-homedir + dodir "${bdir}"/q3a-homedir + dosym "${bdir}"/q3a-homedir "${GAMES_PREFIX}"/.q3a + keepdir "${bdir}"/q3a-homedir prepgamesdirs - chmod g+rw ${D}/${mdir} ${D}/${bdir}/q3a-homedir - chmod -R g+rw ${D}/${GAMES_SYSCONFDIR}/quake3 + chmod g+rw "${D}/${mdir}" "${D}/${bdir}"/q3a-homedir + chmod -R g+rw "${D}/${GAMES_SYSCONFDIR}"/quake3 } games-q3mod_pkg_postinst() { local samplecfg=${FILESDIR}/server.cfg local realcfg=${GAMES_PREFIX_OPT}/quake3/${MOD_NAME}/server.cfg - if [ -e ${samplecfg} ] && [ ! -e ${realcfg} ] ; then - cp ${samplecfg} ${realcfg} + if [[ -e ${samplecfg} ]] && [[ ! -e ${realcfg} ]] ; then + cp "${samplecfg}" "${realcfg}" fi einfo "To play this mod: quake3-${MOD_BINS}" - einfo "To launch a dedicated server: q3${MOD_BINS}-ded" use dedicated && \ + einfo "To launch a dedicated server: q3${MOD_BINS}-ded" && \ einfo "To launch server at startup: /etc/init.d/q3${MOD_NAME}-ded" games_pkg_postinst } games-q3mod_make_q3ded_exec() { -cat << EOF > ${T}/q3${MOD_NAME}-ded.bin +cat << EOF > "${T}"/q3${MOD_NAME}-ded.bin #!/bin/sh -exec ${GAMES_BINDIR}/q3ded +set fs_game ${MOD_NAME} +set dedicated 1 +exec server.cfg \${@} +exec "${GAMES_BINDIR}"/q3ded +set fs_game ${MOD_NAME} +set dedicated 1 +exec server.cfg \${@} EOF } games-q3mod_make_quake3_exec() { -cat << EOF > ${T}/quake3-${MOD_NAME}.bin +cat << EOF > "${T}"/quake3-${MOD_NAME}.bin #!/bin/sh -exec ${GAMES_BINDIR}/quake3 +set fs_game ${MOD_NAME} \${@} +exec "${GAMES_BINDIR}"/quake3 +set fs_game ${MOD_NAME} \${@} EOF } games-q3mod_make_init.d() { -cat << EOF > ${T}/q3${MOD_NAME}-ded.init.d +cat << EOF > "${T}"/q3${MOD_NAME}-ded.init.d #!/sbin/runscript -$(<${PORTDIR}/header.txt) +$(<"${PORTDIR}"/header.txt) depend() { need net @@ -138,12 +135,12 @@ EOF } games-q3mod_make_conf.d() { - if [ -e ${FILESDIR}/${MOD_NAME}.conf.d ] ; then - cp ${FILESDIR}/${MOD_NAME}.conf.d ${T}/q3${MOD_NAME}-ded.conf.d + if [[ -e ${FILESDIR}/${MOD_NAME}.conf.d ]] ; then + cp "${FILESDIR}"/${MOD_NAME}.conf.d "${T}"/q3${MOD_NAME}-ded.conf.d return 0 fi -cat << EOF > ${T}/q3${MOD_NAME}-ded.conf.d -$(<${PORTDIR}/header.txt) +cat << EOF > "${T}"/q3${MOD_NAME}-ded.conf.d +$(<"${PORTDIR}"/header.txt) # Any extra options you want to pass to the dedicated server ${MOD_NAME}_OPTS="+set vm_game 0 +set sv_pure 1 +set bot_enable 0 +set com_hunkmegs 24 +set net_port 27960" |