# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/games-action/armagetronad/Attic/armagetronad-0.2.8.1.ebuild,v 1.3 2006/05/01 02:51:37 mr_bones_ Exp $ inherit flag-o-matic games DESCRIPTION="A Tron clone in 3D" HOMEPAGE="http://armagetronad.net/" GLSRC="http://beta.armagetronad.net/fetch.php/PreResource/moviesounds_fq.zip linguas_es? ( http://beta.armagetronad.net/fetch.php/PreResource/spanishvoices.zip ) http://beta.armagetronad.net/fetch.php/PreResource/moviepack.zip" SRC_URI="mirror://sourceforge/armagetronad/${P}.src.tar.bz2 videos? ( opengl? ( ${GLSRC} ) !dedicated? ( ${GLSRC} ) )" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~ppc ~x86" IUSE="debug dedicated krawall opengl linguas_es videos" GLDEPS="|| ( x11-libs/libX11 virtual/x11 ) virtual/glu virtual/opengl videos? ( app-arch/unzip ) media-libs/libsdl media-libs/sdl-image media-libs/jpeg media-libs/libpng" RDEPEND=">=dev-libs/libxml2-2.6.12 sys-libs/zlib opengl? ( ${GLDEPS} ) !dedicated? ( ${GLDEPS} )" DEPEND="${RDEPEND}" aabuild() { mkdir "${S}/$1" cd "${S}/$1" ln -s "${S}/configure" . use debug && DEBUGLEVEL=3 || DEBUGLEVEL=0 export DEBUGLEVEL CODELEVEL=0 egamesconf \ --srcdir="${S}" \ --docdir="/usr/share/doc" \ --disable-binreloc \ $(use_enable krawall) \ --disable-useradd \ --disable-restoreold \ --disable-games \ --enable-uninstall="emerge --clean =${CATEGORY}/${PF}" \ "${@:2}" || die "egamesconf $1 failed" emake || die "emake $1 failed" } src_compile() { filter-flags -fno-exceptions if use opengl || ! use dedicated ; then aabuild client --enable-glout --disable-initscripts --enable-desktop fi if use dedicated ; then aabuild server --disable-glout --enable-initscripts --disable-desktop fi } src_install() { if [ -d "${S}/server" ]; then cd "${S}/server" emake DESTDIR="${D}" armabindir=${GAMES_BINDIR} install || die "emake server install failed" DedHOME="$(eval echo ~${GAMES_USER_DED})" dodir "${DedHOME}" dosym "${GAMES_STATEDIR}/${PN}-dedicated" "${DedHOME}/.${PN}" for dir in ${GAMES_DATADIR} ${GAMES_SYSCONFDIR}; do mv ${D}/${dir}/${PN}-dedicated ${D}/${dir}/${PN} dosym ${dir}/${PN} ${dir}/${PN}-dedicated done fi if [ -d "${S}/client" ]; then cd "${S}/client" emake DESTDIR="${D}" armabindir=${GAMES_BINDIR} install || die "emake client install failed" if use videos ; then cd "${WORKDIR}" insinto ${GAMES_DATADIR}/${PN} doins -r moviepack moviesounds || die "copying files failed" if use linguas_es ; then doins -r ArmageTRON/moviesounds || die "copying spanish moviesounds failed" fi fi fi mv "${D}"/usr/share/doc/{${PN},${PF}} rm -fr "${D}"/etc/init.d "${D}"/usr/share/doc/${PN}-dedicated dodir /usr/sbin dosym ${GAMES_DATADIR}/${PN}/scripts/rcd_server \ /usr/sbin/${PN}-dedicated-init einfo "Adjusting dedicated server configuration" sed -i -e "s,^\(user=\).*$,\1${GAMES_USER_DED},; s,^#\(VARDIR=/.*\)$,\\1," \ ${D}/${GAMES_SYSCONFDIR}/${PN}/rc.config \ || ewarn "adjustments for rc.config FAILED; the defaults may not be suited for your system!" prepgamesdirs }