Skip to content

Commit

Permalink
Merge pull request #13 from pgdurand/prepV5
Browse files Browse the repository at this point in the history
Prep v5
  • Loading branch information
pgdurand authored Jan 6, 2023
2 parents b6dea5a + 8189dca commit 5224aed
Show file tree
Hide file tree
Showing 19 changed files with 1,526 additions and 127 deletions.
5 changes: 4 additions & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This product includes software developed by:
This software includes software developed by:

The Plealog Team (http://www.plealog.com)
Plealog license 1 is here: http://www.apache.org/licenses/LICENSE-2.0
Expand Down Expand Up @@ -34,3 +34,6 @@ This product includes software developed by:
Biojava license is here: http://www.gnu.org/copyleft/lesser.html
It targets: biojava, bytecode

The Informas Annotation framework
License is here: https://github.com/rmuller/infomas-asl
It targets: eu.informas.annotation package
66 changes: 3 additions & 63 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,76 +217,17 @@
<!-- Compile code and make software dustribution package -->
<target name="makedistrib" depends="makejar">
<!-- Copy the DBMS scripts for Mac, Linux and Windows -->
<copy file="${scripts}/install.sh" todir="${Dscripts}">
<copy file="${scripts}/bdm.sh" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorClass}" />
</filterset>
</copy>
<copy file="${scripts}/UiInstall.sh" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLUIMirrorClass}" />
</filterset>
</copy>
<copy file="${scripts}/query.sh" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLQueryMirrorClass}" />
</filterset>
</copy>
<copy file="${scripts}/annotate.sh" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorAnnot}" />
</filterset>
</copy>
<copy file="${scripts}/info.sh" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorInfo}" />
</filterset>
</copy>
<copy file="${scripts}/delete.sh" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorDelete}" />
</filterset>
</copy>
<copy file="${scripts}/check.sh" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorCheck}" />
</filterset>
</copy>
<copy file="${scripts}/install.bat" todir="${Dscripts}">
<copy file="${scripts}/bdm.bat" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorClass}" />
</filterset>
</copy>
<copy file="${scripts}/UiInstall.bat" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLUIMirrorClass}" />
</filterset>
</copy>
<copy file="${scripts}/query.bat" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLQueryMirrorClass}" />
</filterset>
</copy>
<copy file="${scripts}/annotate.bat" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorAnnot}" />
</filterset>
</copy>
<copy file="${scripts}/info.bat" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorInfo}" />
</filterset>
</copy>
<copy file="${scripts}/delete.bat" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorDelete}" />
</filterset>
</copy>
<copy file="${scripts}/check.bat" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorCheck}" />
</filterset>
</copy>
<copy file="${scripts}/test_bdm.sh" todir="${Dscripts}" />
<!-- Galaxy wrapper to list available DBs -->
<copy file="${scripts}/beedeem_info.xml" todir="${Dconf}/system">
<filterset>
Expand Down Expand Up @@ -316,7 +257,6 @@
<!-- Copy the DBMS Ant installer files -->
<copy file="${scripts}/config-std.properties" tofile="${distrib}/config.properties" />
<copy file="${scripts}/envDBMS" todir="${distrib}" />
<copy file="${scripts}/install-std.txt" tofile="${distrib}/INSTALL.txt" />
<copy file="${scripts}/deploy-std.xml" tofile="${distrib}/deploy.xml">
<filterset>
<filter token="KDBMS_TBALL" value="${apptar}.gz" />
Expand Down
26 changes: 14 additions & 12 deletions scripts/bdm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# -------------------------------------------------------------------
# BeeDeeM starter command for macOS/Linux
# Copyright (c) - Patrick G. Durand, 2007-2022
# Copyright (c) - Patrick G. Durand, 2007-2023
# -------------------------------------------------------------------
# User manual:
# https://pgdurand.gitbooks.io/beedeem/
Expand All @@ -22,40 +22,42 @@
# conf directory. If not set, use ${user.dir}/conf.
# -DKL_LOG_TYPE=none|console|file(default)
#
# KL_WORKING_DIR, KL_CONF_DIR and KL_LOG_FILE can be defined using
# env variables before calling this script. Additional JRE arguments
# Alternatively, you can set these special variables as environment
# variables BEFORE calling this script. Additional JRE arguments
# can also be passed in to this script using env variable KL_JRE_ARGS.
#
# Proxy configuration: update configuration file:
# ${beedeemHome}/conf/system/network.config.

# *** Bank installation scripts of BeeDeeM (conf/scripts) requires BASH 5
BASH_VER=$(bash --version | grep ", version" | cut -d' ' -f4 | cut -d'.' -f1)
if [ "$BASH_VER" -lt "5" ]; then
echo "/!\ ERROR: BeeDeeM requires BASH release 5 (yours is: $BASH_VER)"
exit 1
fi

# *** Application home
KL_APP_HOME=$( cd -P -- "$(dirname -- "$(command -v -- "$0")")" && pwd -P )
# For Conda installation, scripts are in the bin directory, so get correct home
[[ "$KL_APP_HOME" == *bin ]] && KL_APP_HOME=$(dirname "$KL_APP_HOME")

# *** Working directory
if [ ! "$KL_WORKING_DIR" ]; then
KL_WORKING_DIR=@KL_WORKING_DIR@
export KL_WORKING_DIR=@KL_WORKING_DIR@
fi

# *** Configuration directory
if [ ! "$KL_CONF_DIR" ]; then
KL_CONF_DIR=$KL_APP_HOME/conf
export KL_CONF_DIR=$KL_APP_HOME/conf
fi

# *** Optional JRE arguments
# *** Optional JRE arguments (at least RAM specs)
if [ ! "$KL_JRE_ARGS" ]; then
KL_JRE_ARGS="@JAVA_ARGS@"
fi

# *** Java VM
KL_JAVA_ARGS="$KL_JRE_ARGS -DKL_HOME=$KL_APP_HOME -DKL_WORKING_DIR=$KL_WORKING_DIR -DKL_CONF_DIR=$KL_CONF_DIR"

# *** Optional redefinition of log file
if [ ! -z "$KL_LOG_FILE" ]; then
KL_JAVA_ARGS+=" -DKL_LOG_FILE=$KL_LOG_FILE"
fi
KL_JAVA_ARGS="$KL_JRE_ARGS -DKL_HOME=$KL_APP_HOME"

# *** JARs section
KL_JAR_LIST_TMP=`\ls $KL_APP_HOME/bin/*.jar`
Expand Down
37 changes: 21 additions & 16 deletions scripts/deploy-std.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<echo>Installation dir: ${installDir}</echo>
<echo>Working dir : ${workingDir}</echo>
<echo>BioBase dir : ${biobaseRootDir}</echo>
<echo>JVM dir : ${javaDir}</echo>
<echo>Java args : ${javaArgs}</echo>
<input>If ok, press Return key to start the installation...</input>

Expand All @@ -46,7 +45,6 @@
<!-- Removed old installation if any -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${installDir}">
<exclude name="**/*.lic"/>
<exclude name="**/*.dsc"/>
<exclude name="**/*.gd"/>
</fileset>
Expand All @@ -68,24 +66,26 @@
<antcall target="setperms" />
</target>

<!-- ============================================================= -->
<!-- ============================================================= -->
<target name="setperms" if="unixOS">
<chmod dir="${installDir}" perm="ugo+r" type="file" includes="**/*" />
<chmod dir="${installDir}/external" perm="ugo+x" type="file" includes="**/*" />
<chmod dir="${biobaseRootDir}" perm="ugo+r" type="file" includes="**/*" />
<chmod dir="${installDir}" perm="ugo+x" type="dir" includes="**/*" />
<chmod dir="${biobaseRootDir}" perm="ugo+x" type="dir" includes="**/*" />
<chmod dir="${workingDir}" perm="755" type="dir" />
<chmod file="${installDir}/bdm" perm="ugo+x" />
<chmod dir="${installDir}" perm="ugo+r" type="file" includes="**/*" />
<chmod dir="${installDir}/external" perm="ugo+x" type="file" includes="**/*" />
<chmod dir="${installDir}/conf/scripts" perm="ugo+rx" type="file" includes="**/*.sh" />
<chmod dir="${biobaseRootDir}" perm="ugo+r" type="file" includes="**/*" />
<chmod dir="${installDir}" perm="ugo+x" type="dir" includes="**/*" />
<chmod dir="${biobaseRootDir}" perm="ugo+x" type="dir" includes="**/*" />
<chmod dir="${workingDir}" perm="755" type="dir" />
<chmod file="${installDir}/bdm" perm="ugo+rx" />
<chmod file="${installDir}/test_bdm" perm="ugo+rx" />
</target>

<!-- ============================================================= -->
<!-- ============================================================= -->
<target name="copyScripts">
<antcall target="copyScriptsWin" />
<antcall target="copyScriptsUnix" />
</target>

<!-- ============================================================= -->
<!-- ============================================================= -->
<target name="prepareScript">
<copy file="${installDir}/scripts/${kscript}.${kext}" tofile="${installDir}/${kscript}.tmp">
<filterset>
Expand All @@ -108,7 +108,7 @@
<delete file="${installDir}/${kscript}.tmp"/>
</target>

<!-- ============================================================= -->
<!-- ============================================================= -->
<target name="copyScriptsWin" if="winOS">
<!-- Copy and configure the KDBMS starter script (Windows) -->
<antcall target="prepareScript">
Expand All @@ -128,13 +128,18 @@
<delete file="${installDir}/conf/dbms.tmp"/>
</target>

<!-- ============================================================= -->
<!-- ============================================================= -->
<target name="copyScriptsUnix" if="unixOS">
<!-- Copy and configure the KDBMS starter script (Unix) -->
<antcall target="prepareScript">
<param name="kscript" value="bdm"/>
<param name="kext" value="sh"/>
</antcall>
<!-- Copy and configure the KDBMS test script (Unix) -->
<antcall target="prepareScript">
<param name="kscript" value="test_bdm"/>
<param name="kext" value="sh"/>
</antcall>
<!-- Copy and configure the KDBMS main config file-->
<copy file="${installDir}/scripts/dbms.config" todir="${installDir}/conf">
<filterset>
Expand All @@ -143,7 +148,7 @@
</copy>
</target>

<!-- ============================================================= -->
<!-- ============================================================= -->
<target name="updateWinPath" if="winOS">
<path id="distribClass.path">
<fileset dir="${installDir}/bin">
Expand All @@ -160,7 +165,7 @@
</java>
</target>

<!-- ============================================================= -->
<!-- ============================================================= -->
<target name="updateUnixPath" if="unixOS">
<copy file="${sourceF}" tofile="${targetF}"/>
</target>
Expand Down
11 changes: 2 additions & 9 deletions scripts/envDBMS
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@

# Provide here the path to the home directory of an
# Oracle JRE release 1.7 or above
#
JAVA_HOME=/usr/local/jre1.7 [update as needed]

export JAVA_HOME

# Provide here the path to the home directory of a Ant
# 1.6.5 or above. By default, DBMS installer will use its
# 1.9 or above. By default, DBMS installer will use its
# own Ant.
#
ANT_HOME=$PWD/ant
export ANT_HOME

PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
PATH=$ANT_HOME/bin:$PATH

export PATH

62 changes: 62 additions & 0 deletions scripts/test_bdm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash

# =================================================
# Test script for BeeDeeM legacy installer.
# To be used directly on the command-line.
# DO NOT use for Singularity/Docker installations.
#
# How to?
#
# Step 1: install BeeDeeM as stated at:
# https://pgdurand.gitbook.io/beedeem/installation/installation#legacy-installation
#
# Step 2: run test as follows:
# ./test_bdm.sh
# --
# P. Durand (SeBiMER, Ifremer), last updated on Jan 2023
# =================================================

# == TEST 1 ===========================================
echo "*** TEST 1: Start simple bank installation"
# set log mode to console (otherwise default is a log file located in KL_WORKING_DIR
export KL_LOG_TYPE=console
# Set the bank to install
# This is a '.dsc' file located in BeeDeeM installation path at ${beedeem-home}/conf/descriptors
DESCRIPTOR="SwissProt_human"
# start BeeDeeM with 'install' command
./bdm install -desc ${DESCRIPTOR}
# check whether command succeeded or not
if [ $? -eq 0 ]; then
echo "TEST 1: SUCCESS"
else
echo "TEST 1: FAILED."
exit 1
fi

# == TEST 2 ===========================================
echo "*** TEST 2: list installed bank"
# reset log mode to file
export KL_LOG_TYPE=file
# start BeeDeeM with 'info' command
./bdm info -d all -f txt
if [ $? -eq 0 ]; then
echo "TEST 2: SUCCESS"
else
echo "TEST 2: FAILED. Review log file in: @KL_WORKING_DIR@"
exit 1
fi

# == TEST 3 ===========================================
# Change default log file name to something else
export KL_LOG_FILE=query.log
SW_ENTRY="ZZZ3_HUMAN"
echo "*** TEST 3: query bank for entry: $SW_ENTRY"
# start BeeDeeM with 'query' command
./bdm query -d protein -f txt -i $SW_ENTRY
if [ $? -eq 0 ]; then
echo "TEST 3: SUCCESS"
else
echo "TEST 3: FAILED. Review log file: @KL_WORKING_DIR@"
exit 1
fi

Loading

0 comments on commit 5224aed

Please sign in to comment.