gentoo/dev-java/jline/jline-2.7.ebuild

63 lines
1.8 KiB
Bash

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=2
COMMIT="28d037f"
JAVA_PKG_IUSE="source test"
inherit java-pkg-2 java-ant-2
DESCRIPTION="A Java library for handling console input"
HOMEPAGE="http://jline.sourceforge.net/"
SRC_URI="https://github.com/jline/jline2/tarball/${P} -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
IUSE=""
DEPEND=">=virtual/jdk-1.5
>=dev-java/jansi-1.8
>=dev-java/jansi-native-1.4
test? ( dev-java/ant-junit
>=dev-java/hamcrest-core-1.1 )"
RDEPEND=">=virtual/jre-1.5"
S="${WORKDIR}/${PN}-jline2-${COMMIT}"
java_prepare() {
# we don't support maven for building yet. this build.xml was generated by:
# - mvn ant:ant
# - tweak build.xml to not load properties from home dir
# - tweak the test target to match the test cases
# - change maven.repo.local from ~/.maven to "lib" in .properties
# - removed manifest
# - change classpath definitions to "*.jar"
cp "${FILESDIR}/maven-build.xml" build.xml || die
cp "${FILESDIR}/maven-build.properties" . || die
java-ant_ignore-system-classes
mkdir lib && cd lib || die
java-pkg_jar-from jansi
java-pkg_jar-from jansi-native
}
src_compile() {
# precompiled javadocs (needs maven to generate)
# -Dmaven.build.finalName is needed to override the one defined in the
# build.xml, which because it was generated with 2.7, defaults to
# jline-2.7 -Dessa
eant package -Dmaven.build.finalName=${P}
}
src_test() {
use test && java-pkg_jar-from --build-only junit
use test && java-pkg_jar-from --build-only hamcrest-core
ANT_TASKS="ant-junit" eant test -Djunit.present=true
}
src_install() {
java-pkg_newjar target/jline-${PV}.ja
use doc && java-pkg_dojavadoc ../apidocs
use source && java-pkg_dosrc src/main/java
}