# Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ MY_P="${P/-/-r}" S="${WORKDIR}/${MY_P}" DESCRIPTION="The Icculus linux port of ID's quake2 engine" SRC_URI="http://icculus.org/quake2/files/${MY_P}.tar.gz" HOMEPAGE="http://icculus.org/quake2/" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="svga X sdl arts aalib opengl" DEPEND="svga? ( media-libs/svgalib ) X? ( virtual/x11 ) sdl? ( media-libs/libsdl ) arts? ( kde-base/arts ) aalib? ( media-libs/aalib ) opengl? ( virtual/opengl )" src_unpack() { unpack ${A} || die cp ${FILESDIR}/Makefile ${S}/ } src_compile() { if [ `use sdl` ] ; then BUILD_SDL=YES ; BUILD_SDLQUAKE2=YES else BUILD_SDL=NO ; BUILD_SDLQUAKE2=NO fi use X \ && BUILD_X11=YES \ || BUILD_X11=NO use opengl && opengl=1 if [[ (${opengl}) && ${BUILD_X11} == 'YES' ]]; then BUILD_GLX=YES; else BUILD_GLX=NO; fi use svga \ && BUILD_SVGA=YES \ || BUILD_SVGA=NO if [[ ${BUILD_SDL} == 'YES' && ${opengl} ]]; then BUILD_SDLGL=YES else BUILD_SDLGL=NO fi use arts \ && BUILD_ARTS=YES \ || BUILD_ARTS=NO # Commented out because I can't get it to build with aalib- possibly broken. # -Mike use aalib \ && BUILD_AA=YES \ || BUILD_AA=NO if [[ ${BUILD_SDL} == 'NO' && ${BUILD_X11} == 'NO' \ && ${BUILD_SVGA} == 'NO' \ && ${BUILD_AA} == 'NO' ]]; then einfo "You do realize, of course, that you need to enable something" einfo "to display quake2 with? Try SDL or SVGA or X." die; fi BUILD_SDL=${BUILD_SDL} \ BUILD_SDLQUAKE2=${BUILD_SDLQUAKE2} \ BUILD_X11=${BUILD_X11} \ BUILD_GLX=${BUILD_GLX} \ BUILD_SVGA=${BUILD_SVGA} \ BUILD_SDLGL=${BUILD_SDLGL} \ BUILD_ARTS=${BUILD_ARTS} \ BUILD_AA=${BUILD_AA} \ make build_release || die } src_install() { dodir /usr/share/games/quake2 dodir /usr/share/games/quake2/ctf dodir /usr/share/games/quake2/baseq2 exeinto /usr/share/games/quake2 doexe releasei386/ref_*.so releasei386/q2ded releasei386/quake2 newbin ${FILESDIR}/quake2.start quake2 newbin ${FILESDIR}/q2ded.start q2ded if [[ -r releasei386/sdlquake2 ]]; then doexe releasei386/sdlquake2 newbin ${FILESDIR}/sdlquake2.start sdlquake2 fi exeinto /usr/share/games/quake2/ctf doexe releasei386/ctf/gamei386.so exeinto /usr/share/games/quake2/baseq2 doexe releasei386/gamei386.so newdoc readme.txt ID-readme.txt dodoc ${FILESDIR}/README-postinstall } pkg_postinst() { einfo einfo "Go read /usr/share/doc/${P}/README-postinstall.gz right now!" einfo "It's important- This install is just the engine, you still need" einfo "the data paks. Go read." einfo }