summaryrefslogtreecommitdiff
blob: 7cf658117480f1404adfc39682156e5aedcc7078 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-board/jrisk/jrisk-1.0.8.5.ebuild,v 1.1 2005/12/24 07:09:09 mr_bones_ Exp $

inherit eutils games

DESCRIPTION="The well-known board game, written in java"
HOMEPAGE="http://jrisk.sourceforge.net"
SRC_URI="mirror://sourceforge/jrisk/backup_of_Risk_${PV}.zip"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="jikes"

RDEPEND=">=virtual/jre-1.4"
DEPEND=">=virtual/jdk-1.4
	app-arch/unzip
	>=dev-java/ant-core-1.4.1
	jikes? ( >=dev-java/jikes-1.17 )"

S=${WORKDIR}

src_compile() {
	local antflags="game"

	if use jikes; then
		antflags="${antflags} -Dbuild.compiler=jikes"
	fi
	ant ${antflags} || die "failed to build"
	# change the cd directory of the executable 
	# has to be done after the ant compilation
	sed \
		-e "/dirname/ s:.*:cd \"${GAMES_DATADIR}/${PN}\":" \
		"${S}"/build/game/FlashGUI.sh \
		> "${T}"/jrisk \
		|| die "sed failed"
}

src_install() {
	dogamesbin "${T}"/jrisk || die "dogamesbin failed"

	insinto "${GAMES_DATADIR}/${PN}"
	doins -r build/game/* || die "doins failed"
	rm -f "${D}${GAMES_DATADIR}"/${PN}/*.cmd

	newicon build/game/resources/risk.png ${PN}.png
	make_desktop_entry ${PN} "Risk"

	prepgamesdirs
}