# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games MY_PN="alienarena" RUN_FILE="${MY_PN}-2007-x86.run" DESCRIPTION="The ultimate freeware deathmatch fragfest!" HOMEPAGE="http://red.planetarena.org/" SRC_URI="ftp://ftp.planetmirror.com/pub/moddb/2006/08/${RUN_FILE} http://www.forsakenweb.com/gamepage/loaders/games/${RUN_FILE} http://www.alienarena.org/downloads/${RUN_FILE}" LICENSE="free-noncomm" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="opengl sdl" RESTRICT="strip" UIRDEPEND="media-libs/jpeg virtual/glu virtual/opengl sdl? ( >=media-libs/libsdl-1.2.8-r1 ) || ( ( x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext x11-libs/libXxf86dga x11-libs/libXxf86vm ) virtual/x11 ) amd64? ( app-emulation/emul-linux-x86-sdl )" RDEPEND="opengl? ( ${UIRDEPEND} ) sdl? ( ${UIRDEPEND} ) !games-fps/alienarena" DEPEND="${RDEPEND}" S=${WORKDIR} dir=${GAMES_PREFIX_OPT}/${MY_PN} QA_EXECSTACK="${dir:1}/crded ${dir:1}/crx ${dir:1}/crx.sdl" src_unpack() { unpack_makeself ${RUN_FILE} unpack ./*.bz2 local cpu_dir="x86" use amd64 && cpu_dir="x86_64" # Set up this directory to look like the install directory cp -rf engine/${cpu_dir}/* . || die cp -rf bin/Linux/${cpu_dir}/glibc-2.1/* . || die cp AlienArena{,.sdl} sed -i AlienArena.sdl -e "s:crx:crx.sdl:" \ || die "sed AlienArena.sdl failed" } src_install() { local icon=${MY_PN}.xpm doicon "${icon}" || die # Always install the dedicated executable exeinto "${dir}" doexe "${WORKDIR}"/AlienArenaDedicated \ || die "doexe AlienArenaDedicated failed" games_make_wrapper ${MY_PN}-ded ./AlienArenaDedicated "${dir}" if use opengl || use sdl ; then # SDL implies OpenGL games_make_wrapper ${MY_PN} ./AlienArena "${dir}" "${dir}" if use sdl ; then games_make_wrapper ${MY_PN}-sdl ./AlienArena.sdl "${dir}" "${dir}" # Distinguish between OpenGL and SDL versions make_desktop_entry ${MY_PN} "Alien Arena (OpenGL)" "${icon}" make_desktop_entry ${MY_PN}-sdl "Alien Arena (SDL)" "${icon}" else make_desktop_entry ${MY_PN} "Alien Arena" "${icon}" fi fi # Install insinto "${dir}" exeinto "${dir}" doins -r arena botinfo data1 *.txt || die "doins -r failed" doexe AlienArena* crded crx crx.sdl || die "doexe failed" if $(diff -q "${D}/${dir}"/{arena,data1}/gamei386.so) ; then # Replace duplicate file with symlink dosym "${dir}"/{arena,data1}/gamei386.so || die "dosym failed" fi prepgamesdirs } pkg_postinst() { games_pkg_postinst if use sdl ; then elog "To play the game, run: ${MY_PN} or ${MY_PN}-sdl" echo fi }