void-packages/srcpkgs/beanshell/template

43 lines
1.1 KiB
Bash

# Template file for 'beanshell'
pkgname=beanshell
version=2.1.1
revision=1
hostmakedepends="openjdk8 apache-ant"
depends="virtual?java-runtime"
short_desc="BeanShell - Simple Java Scripting"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="Apache-2.0"
homepage="https://beanshell.github.io/"
distfiles="https://github.com/beanshell/beanshell/releases/download/${version}/bsh-${version}-src.zip"
checksum=2248387ceaa319840434a3547a8b2fec12f95a8418ee039ce5ff5726053a139c
do_build() {
source /etc/profile.d/jdk.sh
source /etc/profile.d/apache-ant.sh
ant jarall
# Source: Debian
cat >bsh.sh <<-'EOF'
#!/bin/sh
if [ "$1" = "-classpath" ]; then
CLASSPATH="$2"
shift 2
fi
: "${CLASSPATH:=.}"
_jl=
if [ -f /usr/share/java/jline.jar ]; then
CLASSPATH="${CLASSPATH}:/usr/share/java/jline.jar"
_jl=jline.ConsoleRunner
fi
CLASSPATH="${CLASSPATH}:/usr/share/java/bsh.jar"
export CLASSPATH
exec /usr/bin/java ${_jl:+jline.ConsoleRunner} bsh.Interpreter "$@"
EOF
}
do_install() {
vinstall dist/bsh-${version}.jar 644 usr/share/java
ln -s bsh-${version}.jar ${DESTDIR}/usr/share/java/bsh.jar
vbin bsh.sh bsh
}