# 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/" SRC_URI="mirror://sourceforge/${PN}/${PN}_${MY_PV}_${EDITION}_edition_linux.tar.gz" LICENSE="as-is ZLIB" SLOT="0" KEYWORDS="~x86" 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 || ( ( x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext ) virtual/x11 )" DEPEND="${RDEPEND} >=sys-devel/automake-1.7" 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 cd "${S}"/engine local f for f in {autoexec,config,servers}.cfg ; do sed -i {command,main,serverbrowser}.cpp \ -e "s:${f}:${statedir}/${f}:" \ || die "sed cfg ${f} failed" done # 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 f newgamesbin sauer_client ${PN}.bin || die "newgamesbin client failed" games_make_wrapper ${PN} ${PN}.bin "${dir}" make_desktop_entry ${PN} "Sauerbraten" newgamesbin sauer_server ${PN}-ded.bin || die "newgamesbin ded failed" games_make_wrapper ${PN}-ded ${PN}-ded.bin "${dir}" 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 }