# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit versionator eutils autotools games DATE=$(get_version_component_range 3-3) MY_PV=${DATE:0:4}_${DATE:4:2}_${DATE:6:2} EDITION="shader" DESCRIPTION="Landscape-style engine that pretends to be an indoor first person shooter engine" HOMEPAGE="http://www.sauerbraten.org/" SRC_URI="mirror://sourceforge/${PN}/${PN}_${MY_PV}_${EDITION}_edition_linux.tar.gz mirror://sourceforge/${PN}/${PN}_${MY_PV}_${EDITION}_edition_win32_linux_PATCH.zip" LICENSE="as-is" 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 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} cd "${S}" find -name CVS -type d | xargs rm -r # Apply patch cp "${WORKDIR}"/physics.cpp "${S}"/engine/ || die "cp patch failed" 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 emake || die cd "${S}" emake -j1 || die } src_install() { local ext exe gametype for gametype in {client,server} ; do if [[ ${gametype} = "client" ]] ; then ext="" else 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" rm -r data packages for doc in $(find -name *.txt) ; do dodoc "${doc}" rm "${doc}" 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 }