# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit autotools eutils versionator games DATE=${PV} MY_PV=${DATE:0:4}_${DATE:4:2}_${DATE:6:2} EDITION="normalmap" DESCRIPTION="3D game engine (redesign of Cube) and FPS/RPG game" HOMEPAGE="http://www.sauerbraten.org/" # The map rotation patch only applies to version 20060611 SRC_URI="mirror://sourceforge/${PN}/${PN}_${MY_PV}_${EDITION}_edition_linux.tar.gz mirror://sourceforge/${PN}/map_rotation_patch.zip" LICENSE="as-is ZLIB" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="" RDEPEND=">=media-libs/libsdl-1.2.8-r1 >=media-libs/sdl-image-1.2.3-r1 >=media-libs/sdl-mixer-1.2.6 media-libs/libpng virtual/opengl || ( ( media-libs/mesa x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext ) virtual/x11 )" DEPEND="${RDEPEND} >=sys-devel/automake-1.7 app-arch/unzip" S=${WORKDIR}/${PN}/src dir=${GAMES_DATADIR}/${PN} statedir=${GAMES_STATEDIR}/${PN} src_unpack() { unpack ${A} find "${WORKDIR}" -name CVS -type d | xargs rm -r if [[ -e data ]] ; then # Copy patch to correct place cp -r data/* ${PN}/data || die "cp patch failed" fi cd "${S}"/engine sed -i command.cpp main.cpp serverbrowser.cpp \ -e "s:autoexec.cfg:${statedir}/autoexec.cfg:" \ -e "s:config.cfg:${statedir}/config.cfg:" \ -e "s:servers.cfg:${statedir}/servers.cfg:" \ || die # Followed compilation instructions at # http://www.pyrocpu.com/index.php?page=phx&px=NjU= cd "${S}"/enet export WANT_AUTOMAKE="1.7" export WANT_AUTOCONF="2.5" eautoreconf chmod g+x configure } src_compile() { cd enet egamesconf || die "egamesconf enet failed" emake || die "emake enet failed" cd "${S}" emake -j1 || die "emake failed" } src_install() { local doc ext exe f gametype for gametype in client server ; do if [[ ${gametype} = "server" ]] ; then ext="-ded" fi exe=${PN}${ext} mv "sauer_${gametype}" "${exe}" newgamesbin "${exe}" "${exe}.bin" \ || die "newgamesbin failed" games_make_wrapper "${exe}" "${exe}.bin" "${dir}" done make_desktop_entry ${PN} "Sauerbraten" cd "${WORKDIR}"/${PN} insinto "${dir}" doins -r data packages || die " doins data packages failed" for doc in $(find -name \*.txt) ; do if [[ $(basename "${doc}") != "Frames.txt" ]] ; then dodoc "${doc}" fi done dohtml -r docs/*.html || die "dohtml failed" dodir "${statedir}" for f in {autoexec,config,servers}.cfg ; do touch "${D}${statedir}/${f}" || die "touch ${f} failed" fperms 660 "${statedir}/${f}" || die "fperms ${f} failed" done prepgamesdirs }