# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games MY_PV=${PV/_beta/-beta.} MY_PN="quake4" DESCRIPTION="Sequel to Quake 2, an id 3D first-person shooter" HOMEPAGE="http://www.quake4game.com/" FILE_STEM="${MY_PN}-linux-${MY_PV}.x86.run" SRC_URI="mirror://idsoftware/${MY_PN}/linux/${FILE_STEM}.gz" LICENSE="QUAKE4" SLOT="0" KEYWORDS="-* ~amd64 ~x86" IUSE="alsa cdinstall dedicated opengl" RESTRICT="nomirror nostrip" UIDEPEND="media-libs/libsdl virtual/opengl || ( ( x11-libs/libXext x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp ) virtual/x11 )" RDEPEND="sys-libs/glibc amd64? ( app-emulation/emul-linux-x86-sdl app-emulation/emul-linux-x86-xlibs ) alsa? ( >=media-libs/alsa-lib-1.0.6 ) cdinstall? ( games-fps/quake4-data ) opengl? ( x86? ( ${UIDEPEND} ) ) !dedicated? ( x86? ( ${UIDEPEND} ) )" S=${WORKDIR} dir=${GAMES_PREFIX_OPT}/${MY_PN} GAMES_CHECK_LICENSE="yes" src_unpack() { unpack ${FILE_STEM}.gz unpack_makeself ${FILE_STEM} } src_install() { insinto "${dir}" exeinto "${dir}" doins *.txt README q4icon.bmp us/version.info # CHANGES doins -r pb || die "doins pb" doexe openurl.sh || die "openurl.sh" local arch_dir="x86" use amd64 && arch_dir="x86_64" doexe bin/Linux/${arch_dir}/{*.x86,*.so*} \ || die "doexe exes/libs" insinto "${dir}"/q4base if use dedicated ; then doins q4base/* || die "doins q4base dedicated" games_make_wrapper ${MY_PN}-ded ./q4ded.x86 "${dir}" "${dir}" else doins q4base/*.pk4 || die "doins q4base" fi doins us/q4base/* || die "installing us/q4base" # Default installation is the client if use opengl || ! use dedicated ; then games_make_wrapper ${MY_PN} ./${MY_PN}.x86 "${dir}" "${dir}" newicon q4icon.bmp ${MY_PN}.bmp || die "newicon failed" make_desktop_entry ${MY_PN} "Quake IV" /usr/share/pixmaps/${MY_PN}.bmp fi prepgamesdirs } pkg_postinst() { games_pkg_postinst if ! use cdinstall ; then einfo "You need to copy pak001.pk4 through pak012.pk4, along with" einfo "zpak*.pk4 from either your installation media or your hard drive" einfo "to ${dir}/q4base before running the game." echo fi }