# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/games-etmod.eclass,v 1.12 2006/10/02 06:31:40 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/games-etmod.eclass,v 1.13 2007/03/07 15:23:39 wolf31o2 Exp $
inherit games
S=${WORKDIR}
games-etmod_src_install() {
- [ -z "${MOD_NAME}" ] && die "what is the name of this etmod ?"
+ [[ -z "${MOD_NAME}" ]] && die "what is the name of this etmod ?"
local bdir=${GAMES_PREFIX_OPT}/enemy-territory
local mdir=${bdir}/${MOD_NAME}
MOD_BINS=${MOD_BINS:-${MOD_NAME}}
- if [ -d ${MOD_NAME} ] ; then
+ if [[ -d ${MOD_NAME} ]] ; then
dodir "${bdir}"
cp -PR ${MOD_NAME} "${D}/${bdir}/"
fi
- if [ -d etmain ] ; then
+ if [[ -d etmain ]] ; then
dodir "${bdir}"
cp -PR etmain "${D}/${bdir}/"
fi
- if [ ! -z "`ls "${S}"/* 2> /dev/null`" ] ; then
+ if [[ ! -z "`ls "${S}"/* 2> /dev/null`" ]] ; then
dodir "${mdir}"
cp -PR "${S}"/* "${D}/${mdir}/"
fi
local samplecfg=${FILESDIR}/server.cfg
local realcfg=${GAMES_PREFIX_OPT}/enemy-territory/${MOD_NAME}/server.cfg
- if [ -e "${samplecfg}" ] && [ ! -e "${realcfg}" ] ; then
+ if [[ -e "${samplecfg}" ]] && [[ ! -e "${realcfg}" ]] ; then
cp "${samplecfg}" "${realcfg}"
fi
stop() {
ebegin "Stopping ${MOD_NAME} dedicated"
local pid=\`screen -list | grep et-${MOD_BINS}-ded | awk -F . '{print \$1}' | sed -e s/.//\`
- if [ -z "\${pid}" ] ; then
+ if [[ -z "\${pid}" ]] ; then
eend 1 "Lost screen session"
else
pid=\`pstree -p \${pid} | sed -e 's:^.*etded\.x86::'\`
pid=\${pid:1:\${#pid}-2}
- if [ -z "\${pid}" ] ; then
+ if [[ -z "\${pid}" ]] ; then
eend 1 "Lost etded session"
else
kill \${pid}
}
games-etmod_make_conf.d() {
- if [ -e "${FILESDIR}"/${MOD_NAME}.conf.d ] ; then
+ if [[ -e "${FILESDIR}"/${MOD_NAME}.conf.d ]] ; then
cp "${FILESDIR}"/${MOD_NAME}.conf.d "${T}"/et-${MOD_NAME}-ded.conf.d
return 0
fi
# 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.35 2006/10/05 18:54:37 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/games-q3mod.eclass,v 1.36 2007/03/07 15:23:39 wolf31o2 Exp $
inherit games
stop() {
ebegin "Stopping ${MOD_NAME} dedicated"
local pid=\`screen -list | grep q3${MOD_BINS}-ded | awk -F . '{print \$1}' | sed -e s/.//\`
- if [ -z "\${pid}" ] ; then
+ if [[ -z "\${pid}" ]] ; then
eend 1 "Lost screen session"
else
pid=\`pstree -p \${pid} | sed -e 's:^.*q3ded::'\`
pid=\${pid:1:\${#pid}-2}
- if [ -z "\${pid}" ] ; then
+ if [[ -z "\${pid}" ]] ; then
eend 1 "Lost q3ded session"
else
kill \${pid}
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/games-ut2k4mod.eclass,v 1.9 2006/09/28 21:32:12 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/games-ut2k4mod.eclass,v 1.10 2007/03/07 15:23:39 wolf31o2 Exp $
inherit games
# to bugs.gentoo.org as I know it is a very ugly hack.
USE_DVD=
USE_ECE_DVD=
- if [ -n "${CD_ROOT}" ]
+ if [[ -n "${CD_ROOT}" ]]
then
- [ -d "${CD_ROOT}/CD1" ] && USE_DVD=1
- [ -d "${CD_ROOT}/CD7" ] && USE_ECE_DVD=1
+ [[ -d "${CD_ROOT}/CD1" ]] && USE_DVD=1
+ [[ -d "${CD_ROOT}/CD7" ]] && USE_ECE_DVD=1
else
local mline=""
for mline in `mount | egrep -e '(iso|cdrom)' | awk '{print $3}'`
do
- [ -d "${mline}/CD1" ] && USE_DVD=1
- [ -d "${mline}/CD7" ] && USE_ECE_DVD=1
+ [[ -d "${mline}/CD1" ]] && USE_DVD=1
+ [[ -d "${mline}/CD7" ]] && USE_ECE_DVD=1
done
fi
}
}
games-ut2k4mod_src_unpack() {
- [ -z "${MOD_TBZ2}" ] && die "what are we supposed to unpack ?"
- [ -z "${MOD_NAME}" ] && die "what is the name of this ut2k4mod ?"
+ [[ -z "${MOD_TBZ2}" ]] && die "what are we supposed to unpack ?"
+ [[ -z "${MOD_NAME}" ]] && die "what is the name of this ut2k4mod ?"
for src_uri in ${A}
do
mkdir ${S}/unpack
for tarball in ${MOD_TBZ2}
do
- if [ -e "${tarball}_${PV}-english.tar.bz2" ]
+ if [[ -e "${tarball}_${PV}-english.tar.bz2" ]]
then
tar xjf ${tarball}_${PV}-english.tar.bz2 -C ${S}/unpack \
|| die "uncompressing tarball"
- elif [ -e "${tarball}_${PV}.tar.bz2" ]
+ elif [[ -e "${tarball}_${PV}.tar.bz2" ]]
then
tar xjf ${tarball}_${PV}.tar.bz2 -C ${S}/unpack \
|| die "uncompressing tarball"
- else [ -e "${tarball}.tar.bz2" ]
+ else [[ -e "${tarball}.tar.bz2" ]]
tar xjf ${tarball}.tar.bz2 -C ${S}/unpack \
|| die "uncompressing tarball"
fi
do
dodoc ${readme} || die "dodoc failed"
done
- if [ -n "${MOD_BINS}" ]
+ if [[ -n "${MOD_BINS}" ]]
then
exeinto ${dir}
doexe bin/${MOD_BINS} || die "doexe failed"
}
games-ut2k4mod_pkg_postinst() {
- if [ -n "${MOD_BINS}" ]
+ if [[ -n "${MOD_BINS}" ]]
then
einfo "To play this mod run:"
einfo " ${MOD_BINS}"