# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ ECVS_SERVER="cvs.icculus.org:/cvs/cvsroot" ECVS_MODULE="freespace2" ECVS_USER="anonymous" ECVS_PASS="anonymous" inherit cvs games toolchain-funcs flag-o-matic DESCRIPTION="Port of the original FreeSpace 2. Includes FreeSpace 1. Doesn't include data files. Supports demo versions." HOMEPAGE="http://icculus.org/freespace2/" SRC_URI="" LICENSE="FS2" SLOT="0" KEYWORDS="~x86" IUSE="debug demo" DEPEND="|| ( ( x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext ) virtual/x11 ) media-libs/libsdl media-libs/openal virtual/opengl" S="${WORKDIR}/${ECVS_MODULE}" src_compile() { if !(use debug); then ebegin "Disabling debug" append-flags "-DNDEBUG" eend $? fi ebegin "Fixing Makefile" sed -i "s/^CFLAGS=/CFLAGS+=/" Makefile sed -i "s/^CC=.*/CC=$(tc-getCC)/" Makefile sed -i "s/^AR=.*/AR=$(tc-getAR)/" Makefile sed -i "s/^RANLIB=.*/RANLIB=$(tc-getRANLIB)/" Makefile sed -i "/^FS1=/d" Makefile sed -i "/^DEMO=/d" Makefile eend $? einfo "Building FreeSpace 2 ..." FS1=false DEMO=false emake || die "Error building FreeSpace 2!" mv freespace2 freespace2.bin einfo "Building FreeSpace 1 ..." make clean FS1=true DEMO=false emake || die "Error building FreeSpace 1!" mv freespace freespace1.bin if use demo; then einfo "Building FreeSpace 2 Demo ..." make clean FS1=false DEMO=true emake || die "Error building FreeSpace 2 Demo!" mv freespace2_demo freespace2-demo.bin einfo "Building FreeSpace 1 Demo ..." make clean FS1=true DEMO=true emake || die "Error building FreeSpace 1 Demo!" mv freespace_demo freespace1-demo.bin fi } src_install() { dodoc README doc/*.txt dogamesbin freespace2.bin freespace1.bin games_make_wrapper freespace2 "${GAMES_BINDIR}/freespace2.bin" "${GAMES_DATADIR}/freespace2" games_make_wrapper freespace1 "${GAMES_BINDIR}/freespace1.bin" "${GAMES_DATADIR}/freespace1" if use demo; then dogamesbin freespace2-demo.bin freespace1-demo.bin games_make_wrapper freespace2-demo "${GAMES_BINDIR}/freespace2-demo.bin" "${GAMES_DATADIR}/freespace2-demo" games_make_wrapper freespace1-demo "${GAMES_BINDIR}/freespace1-demo.bin" "${GAMES_DATADIR}/freespace1-demo" fi prepgamesdirs } pkg_postinst() { games_pkg_postinst einfo "If you haven't done so already, you need to emerge one of the" einfo "following packages in order to play..." einfo einfo " freespace1-data" einfo " freespace2-data" einfo " silent-threat-data" if use demo; then einfo " freespace1-demo-data" einfo " freespace2-demo-data" else einfo einfo "Demo versions of the game are also available but you must first" einfo "remerge this package with the demo USE flag enabled." fi echo einfo "You can change resolution from 640x480 to 1024x768 if you edit" einfo "each game's configuration file. These are created on the first" einfo "run. The files are..." einfo einfo " ~/.freespace/FreeSpace.ini" einfo " ~/.freespace2/FreeSpace2.ini" if use demo; then einfo " ~/.freespace_demo/FreeSpaceDemo.ini" einfo " ~/.freespace2_demo/FreeSpace2Demo.ini" fi echo einfo "If you have trouble with the sound, check /etc/openalrc." echo }