# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=2 inherit eutils games toolchain-funcs DESCRIPTION="free multiplayer/singleplayer first person shooter (major redesign of the Cube FPS)" HOMEPAGE="http://sauerbraten.org/" SRC_URI="mirror://sourceforge/sauerbraten/sauerbraten_2008_06_20_ctf_edition_linux.tar.bz2 mirror://sourceforge/sauerbraten/patch_${PV//./_}_linux.tar.bz2 " LICENSE="ZLIB" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="dedicated" DEPEND="media-libs/libsdl[X,opengl] media-libs/sdl-mixer media-libs/sdl-image[png] net-libs/enet virtual/opengl" S="${WORKDIR}/${PN}" src_prepare() { find . -name CVS -print0 | xargs -0 rm -rf # use system enet library instead rm -rf src/enet epatch "${FILESDIR}/${PN}-no-bundled-enet.patch" || die "epatch failed" } src_compile() { cd src emake \ $(use dedicated && echo server) \ CXX="$(tc-getCXX)" \ CXXOPTFLAGS="${CXXFLAGS}" \ || die "emake failed" } src_install() { pushd src exeinto "$(games_get_libdir)"/${PN} use dedicated || doexe sauer_client doexe sauer_server popd insinto "${GAMES_DATADIR}"/${PN} doins -r data packages || die local x for x in client server ; do newgamesbin "${FILESDIR}"/wrapper ${PN}-${x} || die sed -i \ -e "s:@GENTOO_GAMESDIR@:${GAMES_DATADIR}/${PN}:g" \ -e "s:@GENTOO_EXEC@:$(games_get_libdir)/${PN}/sauer_${x}:g" \ "${D}/${GAMES_BINDIR}"/${PN}-${x} done pushd "${D}/${GAMES_BINDIR}"; mv ${PN}-client ${PN}; popd dohtml -r README.html docs make_desktop_entry ${PN} prepgamesdirs }