Merge remote-tracking branch 'remotes/PPed72/net-p2p/deluge_fix_live_ebuild'
[gentoo.git] / dev-java / bsh / bsh-2.0_beta4-r4.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=4
6
7 JAVA_PKG_IUSE="doc source"
8
9 inherit java-pkg-2 eutils java-ant-2
10
11 MY_PV=${PV/_beta/b}
12 MY_DIST=${PN}-${MY_PV}-src.jar
13
14 DESCRIPTION="BeanShell: A small embeddable Java source interpreter"
15 HOMEPAGE="http://www.beanshell.org"
16 SRC_URI="http://www.beanshell.org/${MY_DIST} mirror://gentoo/beanshell-icon.png"
17
18 LICENSE="LGPL-2.1"
19 SLOT="0"
20 KEYWORDS="amd64 ppc64 x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-macos"
21 IUSE="bsf readline"
22 # some tests fail but ant doesn't fail
23 RESTRICT="test"
24
25 RDEPEND=">=virtual/jdk-1.4
26         java-virtuals/servlet-api:3.0
27         readline? ( dev-java/libreadline-java:0 )"
28 DEPEND="${RDEPEND}
29         bsf? ( dev-java/bsf:2.3 )"
30
31 S=${WORKDIR}/BeanShell-${MY_PV}
32
33 src_unpack() {
34         jar xf "${DISTDIR}"/${MY_DIST} || die "failed to unpack"
35 }
36
37 java_prepare() {
38         find "${WORKDIR}" -name '*.jar' -delete || die
39
40         epatch "${FILESDIR}/bsh${MY_PV}-build.patch"
41         use readline && epatch "${FILESDIR}/bsh2-readline.patch"
42
43         java-pkg_jar-from --into lib servlet-api-3.0
44         use readline && java-pkg_jar-from --into lib libreadline-java
45         use bsf && java-pkg_jar-from --into lib --build-only bsf-2.3
46 }
47
48 src_compile() {
49         eant $(use bsf && echo -Dexclude-bsf=) jarall $(use_doc)
50 }
51
52 src_test() {
53         eant test
54 }
55
56 src_install() {
57         java-pkg_newjar "dist/${MY_P}.jar" "${PN}.jar"
58
59         java-pkg_dolauncher bsh-console --main bsh.Console
60         java-pkg_dolauncher bsh-interpreter --main bsh.Interpreter
61
62         use doc && java-pkg_dojavadoc javadoc
63         use source && java-pkg_dosrc src/bsh
64
65         newicon "${DISTDIR}"/beanshell-icon.png beanshell.png
66
67         make_desktop_entry bsh-console "BeanShell Prompt" beanshell
68 }