#! /bin/sh
#------------------------------------------------------------------------------
#$Author: andrius $
#$Date: 2017-12-06 07:35:22 -0500 (Wed, 06 Dec 2017) $
#$Revision: 119 $
#$URL: svn://www.crystallography.net/smiles-scripts/branches/use-system-dependencies/tests/cases/cdkrecharge_016.sh $
#------------------------------------------------------------------------------
#*
#   Run a test to see how the 'cdkrecharge' script works in its installation
#   directory
#**

TMP_DIR="${TMPDIR}"

BASENAME=$(basename $0 .sh)

set -ue
## set -x

test -z "${TMP_DIR}" && TMP_DIR="/tmp"
TMP_DIR="${TMP_DIR}/tmp-${BASENAME}-$$"
mkdir "${TMP_DIR}"

# To make the trap portable between bash and dash, we need to trap
# "signal" 0 ("EXIT") and rely on it for the cleanup:
## trap "rm -rf '${TMP_DIR}'" 0 1 2 3 15
trap "rm -rf '${TMP_DIR}'" EXIT
trap "exit 1" HUP INT QUIT TERM

## set -x

mkdir ${TMP_DIR}/bin
mkdir ${TMP_DIR}/share
mkdir ${TMP_DIR}/share/java

cp bin/cdkrecharge ${TMP_DIR}/bin
cp jars/*.jar      ${TMP_DIR}/share/java

cd ${TMP_DIR}
export CLASSPATH=

./bin/cdkrecharge --smiles 'c1ccccc1'
