# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games MY_PV=${PV/_/} F=${PN}_${MY_PV}_linux.tar.gz SDK=${PN}_${MY_PV}_sdk.zip DESCRIPTION="Multiplayer FPS based on the QFusion engine" HOMEPAGE="http://www.warsow.net/" SRC_URI="http://ftp.club-internet.fr/pub/games/nofrag/${PN}/${F} http://ftp.club-internet.fr/pub/games/nofrag/${PN}/${SDK}" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="dedicated sdl" UIRDEPEND="media-libs/jpeg net-misc/curl >=media-libs/libsdl-1.2.8-r1 >=media-libs/sdl-sound-1.0.1-r1 virtual/opengl || ( ( x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext ) virtual/x11 )" UIDEPEND="( x11-proto/xf86dgaproto x11-proto/xf86vidmodeproto )" RDEPEND="sdl? ( ${UIRDEPEND} ) !sdl? ( !dedicated? ( ${UIRDEPEND} ) )" DEPEND="${RDEPEND} sdl? ( ${UIDEPEND} ) !sdl? ( !dedicated? ( ${UIDEPEND} ) ) !games-fps/warsow-bin app-arch/unzip" S=${WORKDIR}/source/source012 SDATA=${WORKDIR}/${PN} dir=${GAMES_DATADIR}/${PN} src_unpack() { unpack ${A} cd "${S}" # Make fs_usehomedir default to 1, so the game will write to ~/.warsow/ # Make fs_basepath default to correct path sed -i qcommon/files.c \ -e 's:"fs_usehomedir", "0":"fs_usehomedir", "1":' \ -e "s:\"fs_basepath\", \"\.\":\"fs_basepath\", \"${dir}\":" \ || die "sed files.c failed" # Remove pre-compiled binaries, because they are compiled in src_compile() rm "${SDATA}"/{${PN}{,.x86_64},wswBrowser,wsw_server{,.x86_64}} # Remove pre-compiled libraries, because they are compiled in src_compile() rm "${SDATA}"/basewsw/*.so # Remove copy of licence rm "${SDATA}"/docs/gnu.txt } src_compile() { local makeopts="game" if use sdl || ! use dedicated ; then # Compile client makeopts="${makeopts} client cgame ui" fi if use dedicated ; then # Compile server makeopts="${makeopts} ded" fi emake BINDIR=release ${makeopts} || die "emake failed" cp -r release/basewsw "${SDATA}" || die "cp basewsw failed" } src_install() { cd "${SDATA}" if use sdl || ! use dedicated ; then # Install client-only components dogamesbin "${S}/release/${PN}.i386" \ || die "dogamesbin sdl failed" make_desktop_entry ${PN} "Warsow" fi if use dedicated ; then # Install server-only components dogamesbin "${S}/release/wsw_server.i386" \ || die "dogamesbin dedicated failed" fi # Install common components dodoc docs/* && rm -r docs insinto "${dir}" doins -r * || die "doins -r failed" prepgamesdirs }