# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/games-strategy/landeseternelles/landeseternelles-1.5,v 1 2007/08/15 15:51:03 bouleetbil@frogdev.info Exp $ inherit eutils games #var name SOURCESNAME="Sources_Client_1_5.zip" NAMEGAME="LandesEternellesLinux" NAMEMUSIC="music.zip" NAMEEXE="el.x86.linux.bin" DESCRIPTION="Aventure game" HOMEPAGE="http://www.landes-eternelles.com/" ALLGAME_URI="http://www.landes-eternelles.com/client/${NAMEGAME}-1.5.tgz" GAME_URI="http://www.landes-eternelles.com/client/${SOURCESNAME}" SOUND_URI="http://www.landes-eternelles.com/client/${NAMEMUSIC}" SRC_URI="${GAME_URI} ${SOUND_URI} ${ALLGAME_URI}" LICENSE="QTPL" SLOT="0" KEYWORDS="~amd64 ~ppc ~x86" IUSE="debug -64bit" #dir S=${WORKDIR}/${NAMEGAME} DIRSOURCE=${WORKDIR}/sources DEPEND="media-libs/libsdl media-libs/sdl-image media-libs/sdl-mixer media-libs/sdl-ttf media-libs/sdl-net media-libs/sdl-gfx media-libs/openal media-libs/cal3d media-libs/freealut media-gfx/imagemagick" #media-gfx/imagemagick is for convert ico to png src_unpack(){ #for game unpack ${NAMEGAME}"-1.5.tgz" || die "unpack failed" #for source unpack ${SOURCESNAME} || die "unpack failed" #for music unpack ${NAMEMUSIC} || die "unpack failed" } src_compile() { cd ${DIRSOURCE} #sed -i "s:OPTIONS = :OPTIONS = -DDATA_DIR=${GAMES_DATADIR}/${NAMEGAME}/ :" Makefile.linux || die "sed failed" # Build for amd64 if use amd64 ; then sed -i "s:#FEATURES += X86_64:FEATURES += X86_64:" make.defaults || die "sed failed" else if use 64bit ; then sed -i "s:#FEATURES += X86_64:FEATURES += X86_64:" make.defaults || die "sed failed" fi fi sed -i "s:OPTIONS = :OPTIONS = -DUSE_ACTOR_DEFAULTS -Wall :" Makefile.linux || die "sed failed" # Add debugging options if use debug ; then sed -i "s:OPTIONS = :OPTIONS = -DMEMORY_DEBUG -ggdb :" Makefile.linux || die "sed failed" fi sed -i -e 's/CXX=g++/CXX=gcc/' Makefile.linux || die "sed failed" #test for gcc don't work in emerge sed -i "s:ifndef CC: :" Makefile.linux || die "sed failed" sed -i "s:endif: :" Makefile.linux || die "sed failed" sed -i "s:ifndef CXX: :" Makefile.linux || die "sed failed" sed -i "s:ifndef LINK: :" Makefile.linux || die "sed failed" #for use cflag of gentoo sed -i "s:CFLAGS=\$(PLATFORM) \$(CWARN) -O0 -ggdb -pipe \$(OPTIONS):CFLAGS=${CFLAGS} \${OPTIONS}:" Makefile.linux || die "sed failed" sed -i "s:CXXFLAGS=\$(PLATFORM) \$(CXXWARN) -O0 -ggdb -pipe \$(OPTIONS):CXXFLAGS=${CXXFLAGS} \${OPTIONS}:" Makefile.linux || die "sed failed" sed -i "s:-pipe: :" Makefile.linux || die "sed failed" #for don't confuse with FEATURES of emerge echo FEATURES = "" > Makefile sed -e 's/lopenal/lopenal -l alut/' \ Makefile.linux >> Makefile \ || die "sed failed" emake || die "make failed" #Make Link echo "cd ${GAMES_DATADIR}/${NAMEGAME}/ && ./${NAMEEXE}" > ${WORKDIR}/${NAMEGAME}.sh #create png for icone convert elc.ico elc.png } src_install() { einfo "Installing ${NAMEGAME}..." dobin ${WORKDIR}/${NAMEGAME}.sh #for game cd ${S} #delete binary rm ${NAMEEXE} #copy the exe compile cp ${DIRSOURCE}/${NAMEEXE} ${NAMEEXE} insinto ${GAMES_DATADIR}/${NAMEGAME} doins -r * #todo map editor to compile ?? #for music cd ${WORKDIR} insinto ${GAMES_DATADIR}/${NAMEGAME}/music doins -r music/* newgamesbin ${NAMEGAME}.sh ${NAMEGAME}.sh || die "newgamesbin failed" doicon "${DIRSOURCE}/elc.png" || die "doicon failed" make_desktop_entry ${NAMEGAME}.sh ${NAMEGAME} elc.png || die "make_desktop_entry failed" } pkg_postinst() { games_pkg_postinst chmod 775 ${GAMES_DATADIR}/${NAMEGAME}/${NAMEEXE} einfo "for launch ${NAMEGAME}" einfo "$ ${NAMEGAME}.sh" }