# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: inherit eutils games DESCRIPTION="Alien Arena 2006 is the ultimate freeware deathmatch game!" HOMEPAGE="http://red.planetarena.org/" SRC_URI="http://www.planetquake.com/cor/codered/files/${P}-x86.run" LICENSE="GPL" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="dedicated opengl amd64" RESTRICT="mirror nostrip" DEPEND="sys-libs/glibc" RDEPEND="dedicated? ( app-misc/screen ) !dedicated? ( virtual/opengl ) opengl? ( virtual/opengl ) amd64? ( >=app-emulation/emul-linux-x86-xlibs-1.0-r1 )" S=${WORKDIR} dir=${GAMES_PREFIX_OPT}/${PN} Ddir=${D}/${dir} pkg_setup() { games_pkg_setup } src_unpack() { unpack_makeself ${P}-x86.run } src_install() { cd ${S} exeinto ${dir} doexe bin/Linux/x86/glibc-2.1/AlienArena || die "doexe failed" tar -xf alienarena-2006-data.tar.bz2 || die "untar failed" rm alienarena-2006-* insinto ${dir} doins -r arena botinfo data1 || die "doins failed" insinto ${dir} if use amd64 ; then doins -r engine/x86_64/* else doins -r engine/x86/* fi chmod g+rx "${Ddir}" # chmod g+x "${Ddir}/arena/*.so" "${Ddir}/data1/*.so" # chmod g+w "${Ddir}/arena/*.cfg" "${Ddir}/data1/*.cfg" dodoc README.txt || die "doins failed" doicon alienarena.xpm games_make_wrapper Alienarena ./Alienarena "${dir}" "${dir}" if use dedicated ; then exeinto ${dir} doexe bin/Linux/x86/glibc-2.1/AlienArenaDedicated || die "doexe failed" games_make_wrapper Alienarena-ded ./Alienarena-ded ${dir} newinitd ${S}/Alienarena-ded.rc Alienarena-ded || die "newinitd failed" dosed "s:GAMES_USER_DED:${GAMES_USER_DED}:" /etc/init.d/Alienarena dosed "s:GENTOO_DIR:${GAMES_BINDIR}:" /etc/init.d/Alienarena newconfd ${S}/Alienarena-ded.conf.d Alienarena-ded || die "newconfd failed" fi prepgamesdirs make_desktop_entry alienarena "Alien Arena 2006" alienarena.xpm } pkg_postinst() { games_pkg_postinst einfo "To play the game run:" einfo " Alienarena" if use dedicated; then echo einfo "To start a dedicated server run:" einfo " /etc/init.d/Alienarena-ded start" echo einfo "To run the dedicated server at boot, type:" einfo " rc-update add Alienarena-ded default" echo einfo "The dedicated server is started under the ${GAMES_USER_DED} user account" fi if use amd64; then echo einfo "If you are running an amd64 system and using ALSA, you must have" einfo "ALSA 32-bit emulation enabled in your kernel for this to function properly." fi }