1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 JAVA_PKG_IUSE="doc source"
8 inherit java-pkg-2 java-pkg-simple
10 DESCRIPTION="JRobin is a 100% pure Java alternative to RRDTool"
11 HOMEPAGE="http://www.jrobin.org/"
12 SRC_URI="https://github.com/OpenNMS/${PN}/archive/${P}-1.tar.gz"
18 RESTRICT="!test? ( test )"
20 RDEPEND=">=virtual/jre-1.6"
21 DEPEND=">=virtual/jdk-1.6
22 test? ( dev-java/asm:4
23 >=dev-java/cglib-3.1:3
26 dev-java/objenesis:0 )"
28 S="${WORKDIR}/${PN}-${P}-1/src"
29 JAVA_SRC_DIR="main/java"
32 find "${WORKDIR}" -name "*.jar" -delete || die
34 # The tests need the resources in this directory for some reason.
35 mkdir -p test/java/target/classes || die
36 cd test/java/target/classes || die
37 ln -snf ../../../../main/resources/* . || die
41 java-pkg-simple_src_compile
42 jar uf "${PN}.jar" -C main/resources . || die
46 java-pkg-simple_src_install
47 java-pkg_dolauncher "${PN}-rrdtool" --main org.jrobin.cmd.RrdCommander
53 local CP=".:${S}/${PN}.jar:$(java-pkg_getjars asm-4,cglib-3,easymock-3.2,junit-4,objenesis)"
54 local TESTS=$(find * -name "*Test.java")
55 TESTS="${TESTS//.java}"
56 TESTS="${TESTS//\//.}"
58 ejavac -cp "${CP}" -d . $(find * -name "*.java")
59 ejunit4 -classpath "${CP}" ${TESTS}
63 elog "The rrdtool executable has been installed as ${PN}-rrdtool to"
64 elog "avoid conflicting with net-analyzer/rrdtool."