#!/bin/sh

# Source functions library
. /opt/rh/rh-java-common/root/usr/share/java-utils/java-functions

# Source system prefs
if [ -f /opt/rh/devtoolset-4/root/etc/jython.conf ] ; then
  . /opt/rh/devtoolset-4/root/etc/jython.conf
fi

# Source user prefs
if [ -f $HOME/.jythonrc ] ; then
  . $HOME/.jythonrc
fi

# Configuration
MAIN_CLASS=org.python.util.jython
FLAGS=-Dpython.home=/opt/rh/devtoolset-4/root/usr/share/jython
BASE_JARS="jython/jython guava jnr-constants jnr-ffi jnr-netdb jnr-posix jffi jline/jline jansi/jansi antlr32/antlr-runtime objectweb-asm5/asm-5 objectweb-asm5/asm-commons-5 objectweb-asm5/asm-util-5 commons-compress icu4j netty/netty-buffer netty/netty-codec netty/netty-common netty/netty-handler netty/netty-transport"

# Set parameters
set_jvm
set_classpath $BASE_JARS
set_options $BASE_OPTIONS

# Let's start
run "$@"
