# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games eutils DESCRIPTION="RTS written in Java" HOMEPAGE="http://www.oddlabs.com/tribaltrouble.php" LICENSE="Oddlabs software license" SRC_URI="http://download.oddlabs.com/TribalTroubleSetup.sh" KEYWORDS="~x86 ~amd64" IUSE="java" SLOT="0" RESTRICT="nostrip nomirror" DEPEND="virtual/opengl java? ( >=dev-java/sun-jdk-1.5.0.02-r1 ) java? ( sys-apps/sed )" dir="${GAMES_PREFIX_OPT}/${PN}" Ddir="${D}/${dir}" src_unpack() { sh ${DISTDIR}"/TribalTroubleSetup.sh" &> /dev/null || die "Unpacking game failed" if use java; then cd tribaltrouble sed 's@JAVA=jre1.5.0_04/bin/java@JAVA=${JAVA_HOME}/bin/java@g' tribaltrouble > tribaltrouble.temp mv tribaltrouble.temp tribaltrouble chmod +x tribaltrouble #cd ../ fi } src_install() { cd ${WORKDIR}/tribaltrouble dodir ${dir} mv license.txt LICENSE dodoc LICENSE || die "dodoc failed" dohtml Manual.html ReadMe.html || die "dohtml failed" insinto ${dir} doins loader.jar || die "doins failed" exeinto ${dir} doexe tribaltrouble || die "doexe failed" cp -R gamedata ${Ddir} || die "cp failed" if use java; then einfo "Using system JRE" else cp -R "jre1.5.0_04" ${Ddir} || die "cp failed" fi insinto /usr/share/pixmaps/ doins ${FILESDIR}/tribaltrouble.png #insinto /usr/share/applications/ #doins ${FILESDIR}/tribaltrouble.desktop echo -e "#!/bin/bash\ncd ${dir}\n./${PN}" > tribaltrouble exeinto /usr/games/bin doexe tribaltrouble || die "doexe failed" prepgamesdirs make_desktop_entry tribaltrouble "Tribal Trouble" tribaltrouble.png } pkg_postinst() { games_pkg_postinst }