# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/games-strategy/triplea/triplea-0.4.8.ebuild,v 1.2 2004/07/24 10:34:08 mr_bones_ Exp $ inherit games java-utils java-pkg MY_PV=${PV//\./_} DESCRIPTION="An open source clone of the popular Axis and Allies boardgame" HOMEPAGE="http://triplea.sf.net" SRC_URI="mirror://sourceforge/${PN}/${PN}_source_${MY_PV}.zip" LICENSE="GPL-2" KEYWORDS="x86 amd64 ~ppc" SLOT="0" IUSE="jikes" RDEPEND="|| ( >=virtual/jdk-1.4 >=virtual/jre-1.4 )" DEPEND="${RDEPEND} app-arch/unzip >=dev-java/ant-core-1.4.1 >=dev-java/jgoodies-looks-bin-1.2.0 dev-java/junit jikes? ( >=dev-java/jikes-1.17 )" S="${WORKDIR}/${PN}_${MY_PV}" src_unpack() { unpack ${A} cd "${S}" epatch ${FILESDIR}/${P}.patch cd lib/ rm -f *.jar java-pkg_jar-from jgoodies-looks-bin cd .. cat >"${T}/${PN}" <<-EOF #!/bin/sh cd ${GAMES_DATADIR}/${PN} java -Dtriplea.root=${GAMES_DATADIR}/${PN} -cp \\ triplea.jar:\$(java-config -p jgoodies-looks-bin) \\ games.strategy.engine.framework.GameRunner EOF cat >"${T}/${PN}_ai" <<-EOF #!/bin/sh cd ${GAMES_DATADIR}/${PN} java -Dtriplea.ai=true -Dtriplea.root=${GAMES_DATADIR}/${PN}\\ triplea.jar:\$(java-config -p jgoodies-looks-bin) \\ games.strategy.engine.framework.GameRunner EOF # Repair bad path in .ant.properties (bug #47437) sed -i \ -e "/^junit.jar/s:=.*:=$(java-config -p junit):" \ .ant.properties \ || die "sed .ant.properties failed" # The default savedGames directory is in the install root. This # sets it to use the users home directory. echo "triplea.saveGamesInHomeDir=true" > triplea.properties } src_compile() { local antflags="jar" if use jikes ; then antflags="${antflags} -Dbuild.compiler=jikes" fi ant ${antflags} || die "compile problem" } src_install () { #java-pkg_dojar ${PN}.jar dogamesbin "${T}/${PN}" || die "dogamesbin failed" dogamesbin "${T}/${PN}_ai" || die "dogamesbin failed" dodir "${GAMES_DATADIR}/${PN}" cp -R games/ triplea.jar "${D}${GAMES_DATADIR}/${PN}" || die "cp failed" prepgamesdirs }