# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # http://bugs.gentoo.org/show_bug.cgi?id=111566 inherit versionator eutils autotools games MY_PV="$(get_version_component_range 3-5)" MY_PV="$(replace_all_version_separators '_' ${MY_PV})" 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}_mp_edition.zip" LICENSE="as-is" SLOT="0" KEYWORDS="~x86" IUSE="" RDEPEND=">=media-libs/smpeg-0.4.4-r6 >=media-libs/jpeg-6b-r5 >=media-libs/libogg-1.1.2 >=media-libs/libpng-1.2.8 >=media-libs/libsdl-1.2.8-r1 >=media-libs/libvorbis-1.1.0 >=media-libs/sdl-image-1.2.3-r1 >=media-libs/sdl-mixer-1.2.6 >=media-libs/tiff-3.7.3 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} dir=${GAMES_DATADIR}/${PN} statedir=${GAMES_STATEDIR}/${PN} src_unpack() { unpack ${A} cd "${S}" find . -name CVS -type d | xargs rm -r # This is redundant with the ${statedir} links in src_install(), # but may be useful in future cd "${S}"/src/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 ../src emake -j1 || die } src_install() { for gametype in {client,server}; do newgamesbin src/sauer_${gametype} sauer_${gametype}.bin || die games_make_wrapper sauer_${gametype} sauer_${gametype}.bin "${dir}" done make_desktop_entry sauer_client "Sauerbraten" cd "${S}"/${PN} insinto "${dir}" doins -r data packages || die dohtml -r docs/* || die cd "${S}" dodoc *.txt src/*.txt || die # Links to ${statedir} dodir "${statedir}" for filename in {autoexec.cfg,config.cfg,servers.cfg}; do touch "${D}${statedir}/${filename}" || die dosym "${statedir}/${filename}" "${dir}/${filename}" || die fperms 660 "${statedir}/${filename}" || die done prepgamesdirs }