# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit java-pkg eutils DESCRIPTION="BeanShell: A small embeddable Java source interpreter" HOMEPAGE="http://www.beanshell.org" SRC_URI="http://www.beanshell.org/${P/_beta/b}-src.jar mirror://gentoo/beanshell-icon.png" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~x86 ~amd64 ~ppc" IUSE="doc gnome jikes junit kde readline" DEPEND="${RDEPEND} >=dev-java/ant-core-1.5.4" RDEPEND=">=virtual/jdk-1.4 =dev-java/bsf-2.3* =tomecat-5* readline? ( dev-java/libreadline-java )" S=${WORKDIR}/BeanShell src_unpack() { # Extract the sources cd ${WOKDIR} jar -xf ${A} # Apply the build patch cd ${S} epatch ${FILESDIR}/bsh2-build.patch # Copy the needed files cp ${FILESDIR}/bsh.Console ${FILESDIR}/bsh.Interpreter # Patch with readline if required if use readline ; then # Apply the patch epatch ${FILESDIR}/bsh2-readline.patch # Update the classpath local ADD_CLASSPATH=":\`java-config -p libreadline-java\`" sed -e "s:__ADD_CLASSPATH__:${ADD_CLASSPATH}:" \ -i bsh.Console \ -i bsh.Interpreter fi } src_compile() { local classpath="bsf-2.3,tomcat-5" use readline && classpath="${classpath},libreadline-java" classpath=`java-config -p ${classpath}` local antflags="jarall" use doc && antflags="${antflags} javadoc" use jikes && antflags="${antflags} -Dbuild.compiler=jikes" ant -Dclasspath=${classpath} ${antflags} || die "Compile Failed!" } src_install() { java-pkg_dojar ${S}/dist/${P/_beta/b}.jar dobin bsh.Console bsh.Interpreter use doc && dohtml -r javadoc/* if use gnome || use kde ; then insinto /usr/share/icons/hicolor/scalable/apps doins ${DISTDIR}/beanshell-icon.png beanshell.png make_desktop_entry bsh.Console "BeanShell Prompt" fi }