summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2016-10-11 23:27:44 +0100
committerJames Le Cuirot <chewi@gentoo.org>2016-10-11 23:29:37 +0100
commit084125792256c6117509431b3a2ab5ef6066d80a (patch)
tree7a0bf9f41761ac9973b9afd209622827cceecb34 /games-strategy/triplea/triplea-1.8.0.9-r1.ebuild
parentdev-java/upnplib: New package, needed by games-strategy/triplea (diff)
downloadgentoo-084125792256c6117509431b3a2ab5ef6066d80a.tar.gz
gentoo-084125792256c6117509431b3a2ab5ef6066d80a.tar.bz2
gentoo-084125792256c6117509431b3a2ab5ef6066d80a.zip
games-strategy/triplea: Libs (#596468), drop games eclass, fix paths
It's hard to see how this ever worked as it built against bundled libraries but did not install them. It turns out many aren't needed so we now unbundle them all except Apache Derby, which was last-rited. The server tried to write under /usr/share and ${PWD} by default, which is bad and bad. I have made it write under ~/.triplea. Package-Manager: portage-2.3.1
Diffstat (limited to 'games-strategy/triplea/triplea-1.8.0.9-r1.ebuild')
-rw-r--r--games-strategy/triplea/triplea-1.8.0.9-r1.ebuild81
1 files changed, 81 insertions, 0 deletions
diff --git a/games-strategy/triplea/triplea-1.8.0.9-r1.ebuild b/games-strategy/triplea/triplea-1.8.0.9-r1.ebuild
new file mode 100644
index 000000000000..0cf68a68a96e
--- /dev/null
+++ b/games-strategy/triplea/triplea-1.8.0.9-r1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils java-pkg-2 java-ant-2 versionator
+
+MY_PV=$(replace_all_version_separators _)
+DESCRIPTION="An open source clone of the popular Axis and Allies boardgame"
+HOMEPAGE="http://triplea.sourceforge.net/"
+SRC_URI="mirror://sourceforge/triplea/${PN}_${MY_PV}_source_code_only.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="test" # Needs X11 maybe use virtualx.eclass
+
+RDEPEND="dev-java/apple-java-extensions-bin:0
+ dev-java/commons-httpclient:3
+ dev-java/oracle-javamail:0
+ dev-java/osgi-core-api:0
+ dev-java/upnplib:0"
+DEPEND="${RDEPEND}
+ >=virtual/jdk-1.7
+ app-arch/unzip
+ test? ( dev-java/ant-junit:0 )"
+RDEPEND="${RDEPEND}
+ >=virtual/jre-1.7"
+
+S=${WORKDIR}/${PN}_${MY_PV}
+
+JAVA_ANT_REWRITE_CLASSPATH="true"
+EANT_GENTOO_CLASSPATH="apple-java-extensions-bin,commons-httpclient-3,oracle-javamail,osgi-core-api,upnplib"
+
+java_prepare() {
+ # Use ~/.triplea, not ~/triplea.
+ # Don't write server files under /usr/share or ${PWD}.
+ # Fix to build against our packaged upnplib.
+ epatch "${FILESDIR}"/{paths,upnplib}.patch
+
+ # Remove packaged or unneeded libs. Unfortunately Apache Derby was
+ # last-rited due to packaging issues. See bug #561410.
+ find lib/* ! -name "derby-*.jar" -delete || die
+ rm -r old/ || die
+}
+
+src_compile() {
+ eant
+ echo "triplea.saveGamesInHomeDir=true" > data/triplea.properties || die
+ # The only target creating this is zip which does unjar etc
+ jar cf ${PN}.jar -C classes . || die
+}
+
+src_test() {
+ java-pkg-2_src_test
+}
+
+src_install() {
+ insinto /usr/share/${PN}
+ doins -r assets data dice_servers maps
+
+ java-pkg_dojar ${PN}.jar
+ java-pkg_newjar lib/derby-*.jar derby.jar
+
+ java-pkg_dolauncher ${PN} \
+ --main games.strategy.engine.framework.GameRunner \
+ --java_args "-Xmx256m"
+ java-pkg_dolauncher ${PN}-server -pre "${FILESDIR}"/mkdir.sh \
+ --main games.strategy.engine.lobby.server.LobbyServer \
+ --java_args "-server -Xmx64m -Dtriplea.lobby.port=3303 -Dtriplea.lobby.console=true"
+
+ newicon icons/triplea_icon.png ${PN}.png
+ newicon icons/triplea_icon.png ${PN}-server.png
+ make_desktop_entry ${PN} TripleA
+ make_desktop_entry ${PN}-server TripleA-server
+
+ dodoc changelog.txt TripleA_RuleBook.pdf
+ docinto html
+ dodoc -r doc/* readme.html
+}