# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games DESCRIPTION="ManiaDrive is a clone of Trackmania: 3D, stunts and skills!" HOMEPAGE="http://maniadrive.raydium.org/" SRC_URI="http://easynews.dl.sourceforge.net/sourceforge/maniadrive/ManiaDrive-${PV}-linux-i386.tar.gz http://easynews.dl.sourceforge.net/sourceforge/maniadrive/ManiaDrive-${PV}-src.tar.gz http://freeway.raydium.org/data/stable_mirrors/ode.tar.gz http://snaps.php.net/php5.2-latest.tar.gz" LICENSE="GPL" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="media-libs/openal virtual/glu media-libs/jpeg media-libs/libvorbis media-libs/glew" S="${WORKDIR}/ManiaDrive-${PV}-src" src_unpack() { unpack ManiaDrive-${PV}-linux-i386.tar.gz unpack ManiaDrive-${PV}-src.tar.gz #copy ode and php tarballs in raydium directory cp ${PORTAGE_TMPDIR}/portage/${PF}/distdir/ode.tar.gz ${S}/raydium/ cp ${PORTAGE_TMPDIR}/portage/${PF}/distdir/php5.2-latest.tar.gz ${S}/raydium/php-latest.tar.gz #delete binary files rm ${WORKDIR}/ManiaDrive-${PV}-linux-i386/game/*.static #copy game data in build directory cp ${WORKDIR}/ManiaDrive-${PV}-linux-i386/game/* ${S}/ -R cd ${S} epatch "${FILESDIR}/${P}-no-download.patch" epatch "${FILESDIR}/${P}-ocomp-fix.patch" epatch "${FILESDIR}/${P}-remove-openal-test.patch" } src_compile() { ./configure --no-download || die "Configure failed!" emake || die "Make failed!" # the Makefile compile only the engine(raydium). # we can compile the game binaries with the ocomp script (static using ode) ./ocomp.sh mania_drive.c ./ocomp.sh mania_server.c ./ocomp.sh mania2.c } src_install() { dodir ${GAMES_DATADIR}/${PN} cp ${WORKDIR}/ManiaDrive-${PV}-linux-i386/game/* ${D}/${GAMES_DATADIR}/${PN}/ -R cp ${S}/mania_drive ${D}/${GAMES_DATADIR}/${PN}/ -R cp ${S}/mania_server ${D}/${GAMES_DATADIR}/${PN}/ -R cp ${S}/mania2 ${D}/${GAMES_DATADIR}/${PN}/ -R dodoc ${WORKDIR}/ManiaDrive-${PV}-linux-i386/README echo "#!/bin/sh cd ${GAMES_DATADIR}/${PN} ./mania_drive" > mania_drive.sh echo "#!/bin/sh cd ${GAMES_DATADIR}/${PN} ./mania_server" > mania_server.sh echo "#!/bin/sh cd ${GAMES_DATADIR}/${PN} ./mania2" > mania2.sh newgamesbin mania_drive.sh mania_drive newgamesbin mania_server.sh mania_server newgamesbin mania2.sh mania2 }