CDS detector added
Former-commit-id: 93fac7a70052d06c2a12bf8af59820c653edd31b Former-commit-id: 0869fdad0f550941a0f78f1e4c57f4fcdb3f6076
This commit is contained in:
65
scripts/check_port.sh
Executable file
65
scripts/check_port.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/csh -f
|
||||
#
|
||||
# check unix tools version and port installation
|
||||
#
|
||||
|
||||
set HERE = `dirname $0`
|
||||
set ORG_HOME = $HERE/..
|
||||
set LIB = $HERE/lib
|
||||
set ORG_PORTNAME = `$ORG_HOME/config/guess_port`
|
||||
|
||||
set path = ($path $ORG_HOME/ports/$ORG_PORTNAME/bin)
|
||||
|
||||
@ nerr = 0
|
||||
|
||||
# gnu gawk version >= 4.0.1
|
||||
|
||||
set ref = 4.0.1
|
||||
$LIB/check_version.sh 'gawk --version | head -1 | awk '"'"'{print $3}'"'" $ref
|
||||
@ nerr += $status
|
||||
|
||||
# gnu make version >= 3.81
|
||||
|
||||
set ref = 3.81
|
||||
$LIB/check_version.sh 'make --version | head -1 | awk '"'"'{print $3}'"'" $ref
|
||||
@ nerr += $status
|
||||
|
||||
# (gnu) tar version >= 1.15
|
||||
|
||||
set ref = 1.15
|
||||
$LIB/check_version.sh 'tar --version | head -1 | awk '"'"'{print $NF}'"'" $ref
|
||||
@ nerr += $status
|
||||
|
||||
# gcc version >= 3.4.6
|
||||
|
||||
set ref = 3.4.6
|
||||
$LIB/check_version.sh 'gcc --version | head -1 | awk '"'"'{print $NF}'"'" $ref
|
||||
@ nerr += $status
|
||||
|
||||
# check errors
|
||||
|
||||
if ($nerr > 0) then
|
||||
echo "[0;31m* invalid unix tools version(s)[m"
|
||||
exit 2
|
||||
endif
|
||||
|
||||
# check binaries architecture
|
||||
|
||||
set prog = $ORG_HOME/ports/$ORG_PORTNAME/bin/blastp
|
||||
|
||||
if (-e $prog) then
|
||||
echo -n "+ checking port compilation"
|
||||
($prog -h) >& /dev/null
|
||||
set Stat = $status
|
||||
if ($Stat != 0) then
|
||||
echo "[0;31m Wrong architecture[m"
|
||||
exit 2
|
||||
else
|
||||
echo "[0;32m OK[m"
|
||||
endif
|
||||
else
|
||||
echo "+ port not yet compiled"
|
||||
endif
|
||||
|
||||
exit 0
|
||||
|
159
scripts/csh_init.sh
Normal file
159
scripts/csh_init.sh
Normal file
@ -0,0 +1,159 @@
|
||||
#
|
||||
# csh setup
|
||||
# usage: should normaly be sourced from other csh scripts as :
|
||||
# usage: source `dirname $0`/csh_setup.csh
|
||||
#
|
||||
|
||||
if ($?ORG_SOURCED == 0) then
|
||||
|
||||
setenv ORG_SOURCED 1
|
||||
setenv ORG_VERSION 1
|
||||
|
||||
# --------------------------------------
|
||||
# adapt one of these if needed
|
||||
# --------------------------------------
|
||||
#
|
||||
# o AwkCmd : name of awk command (on some system should be 'gawk')
|
||||
#
|
||||
# o Verbose : default verbosity (may be changed by -v option)
|
||||
#
|
||||
|
||||
setenv AwkCmd "gawk"
|
||||
setenv Verbose 0
|
||||
|
||||
# --------------------------------------
|
||||
# don't change hereafter (normally)
|
||||
# --------------------------------------
|
||||
|
||||
# ORG_HOME : the absolute path to the ORG.Annot home directory
|
||||
# note: should be set before usually, the following will work
|
||||
# only for scripts located in /scripts
|
||||
|
||||
if ($?ORG_HOME == 0) setenv ORG_HOME `dirname $0`/..
|
||||
setenv ORG_HOME `cd $ORG_HOME && pwd -P`
|
||||
|
||||
setenv ORG_PORTNAME `$ORG_HOME/config/guess_port` # The architecture running
|
||||
# the ORG.Annot instance
|
||||
|
||||
setenv BIN_DIR "$ORG_HOME/ports/$ORG_PORTNAME/bin" # Directory containing
|
||||
# binaries for this port
|
||||
|
||||
setenv SCRIPT_DIR "$ORG_HOME/scripts" # Directory containing
|
||||
# scripts utilities
|
||||
|
||||
setenv PROG_DIR `dirname $0` # Directory containing
|
||||
setenv PROG_DIR `cd $PROG_DIR && pwd -P` # the main script file
|
||||
|
||||
setenv LIB_DIR "$PROG_DIR/../lib" # Directory containing
|
||||
setenv LIB_DIR `cd $LIB_DIR && pwd -P` # the main script libraries
|
||||
|
||||
setenv CALL_DIR `pwd -P` # Directory from where the
|
||||
# main script is called
|
||||
|
||||
setenv DATA_DIR "$ORG_HOME/data" # Directory containing reference data
|
||||
# for the annotation
|
||||
|
||||
setenv IR_DATA_DIR "$DATA_DIR/ir" # Directory containing data related to
|
||||
# IRs detection
|
||||
|
||||
setenv TRNA_DATA_DIR "$DATA_DIR/trna" # Directory containing data related to
|
||||
# tRNAs detection
|
||||
|
||||
setenv RRNA_DATA_DIR "$DATA_DIR/rrna" # Directory containing data related to
|
||||
# rRNAs detection
|
||||
|
||||
setenv CDS_DATA_DIR "$DATA_DIR/cds" # Directory containing data related to
|
||||
# CDSs detection
|
||||
|
||||
# setup the LC_ALL environment variable (for Linux mostly)
|
||||
# so the GNU tools (like sort) will work properly
|
||||
|
||||
setenv LANG C
|
||||
setenv LC_ALL C
|
||||
|
||||
endif
|
||||
|
||||
# --------------------------------------
|
||||
# path should be set each time
|
||||
# --------------------------------------
|
||||
|
||||
set path = ($SCRIPT_DIR $BIN_DIR $path)
|
||||
|
||||
# --------------------------------------
|
||||
# alias should be sourced each time
|
||||
# --------------------------------------
|
||||
|
||||
alias Debug 'if ($Verbose) echo "# "\!:* >> /dev/stderr'
|
||||
|
||||
alias Notify 'echo "# "\!:* >> /dev/stderr'
|
||||
|
||||
alias Error 'echo "[0;31m# Error "\!:2-*"[m" >> /dev/stderr; Exit \!:1'
|
||||
|
||||
alias Exit 'set Stat = \!:1; Debug "<--- $0 [$Stat]"; exit \!:1'
|
||||
|
||||
alias Stop 'Exit $Stat'
|
||||
|
||||
alias GetStatus 'set Stat = $status; Debug "status: $Stat"'
|
||||
|
||||
alias Exec 'Debug "execute: \!:*"; \!:* ; GetStatus'
|
||||
|
||||
alias OnError 'if ($Stat != 0)'
|
||||
|
||||
alias OnSuccess 'if ($Stat == 0)'
|
||||
|
||||
alias Usage 'egrep "^# *usage:" $0 | sed -e "s/^# *//1"'
|
||||
|
||||
alias ExitUsage 'Usage; Exit 1'
|
||||
|
||||
alias Abort 'Error \!:1 "\!:2-* [abort]"'
|
||||
|
||||
alias CheckAbort 'GetStatus; OnError eval Abort \!:*'
|
||||
|
||||
alias NeedArg 'if ($#Argv < \!:1) eval ExitUsage'
|
||||
|
||||
alias Shift 'shift Argv'
|
||||
|
||||
alias NeedFile 'if (! -e \!:1) eval Error 5 "\!:1 : file not found"'
|
||||
|
||||
alias NeedDir 'if (! -d \!:1) eval Error 5 "\!:1 : directory not found"'
|
||||
|
||||
alias Cat 'awk '"'"'{print "# " $0}'"'"' \!:*'
|
||||
|
||||
alias AssignUndef 'if ($?\!:1 == 0) set \!:1=\!:2-*'
|
||||
|
||||
# --------------------------------------
|
||||
# reset Stat each time
|
||||
# --------------------------------------
|
||||
|
||||
set Stat = 0
|
||||
|
||||
# --------------------------------------
|
||||
# process arguments to catch -v and -h
|
||||
# and setup Argv, Argn (leave argv, argn untouched)
|
||||
# Opts contains any standard option used (-v)
|
||||
# --------------------------------------
|
||||
|
||||
set Argv = ()
|
||||
set Opts = ()
|
||||
@ Argn = 0
|
||||
foreach arg ($argv)
|
||||
switch ("$arg")
|
||||
case "-v":
|
||||
setenv Verbose 1
|
||||
set Opts = ($Opts $arg)
|
||||
breaksw
|
||||
case "-h":
|
||||
egrep "^# *usage:" $0 | sed -e "s/^# *//1" >> /dev/stderr
|
||||
kill $$ # exit will not work from sourced file
|
||||
breaksw
|
||||
default:
|
||||
set Argv = ($Argv "$arg")
|
||||
@ Argn ++
|
||||
endsw
|
||||
end
|
||||
|
||||
# --------------------------------------
|
||||
# notification for debug
|
||||
# --------------------------------------
|
||||
|
||||
Debug "---> $0"
|
51
scripts/lib/check_version.sh
Executable file
51
scripts/lib/check_version.sh
Executable file
@ -0,0 +1,51 @@
|
||||
#!/bin/csh -f
|
||||
#
|
||||
# check (gnu) software version
|
||||
#
|
||||
# usage: check_version.sh cmd version
|
||||
#
|
||||
#
|
||||
set HERE = `dirname $0`
|
||||
set ORG_HOME = $HERE/../..
|
||||
set ORG_PORTNAME = `$ORG_HOME/config/guess_port`
|
||||
|
||||
set path = ($path $ORG_HOME/ports/$ORG_PORTNAME/bin)
|
||||
|
||||
if ($#argv != 2) then
|
||||
egrep "^# *usage:" $0 | sed -e 's/^# *//1'
|
||||
exit 1
|
||||
endif
|
||||
|
||||
set name = `echo "$1" | awk '{print $1}'`
|
||||
|
||||
echo -n "+ checking $name"
|
||||
|
||||
set ok = `which $name`
|
||||
|
||||
if ($status != 0) then
|
||||
echo ""
|
||||
echo "* $name : command not found"
|
||||
echo "* please consider installing $name from src/_unix_tools_"
|
||||
exit 1
|
||||
endif
|
||||
|
||||
set num = `eval "$1" | tr -d -C '[0-9].'`
|
||||
|
||||
echo -n " version $num"
|
||||
|
||||
awk -v NUM=$num -v REF=$2 -f $HERE/version.awk
|
||||
|
||||
if ($status != 0) then
|
||||
echo ""
|
||||
echo "[0;31m* $name version $num (should be >= $2)[m"
|
||||
echo "[0;31m* please consider installing $name from src/_unix_tools_[m"
|
||||
exit 2
|
||||
endif
|
||||
|
||||
echo " (>= $2) [0;32mOK[m"
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
18
scripts/lib/version.awk
Normal file
18
scripts/lib/version.awk
Normal file
@ -0,0 +1,18 @@
|
||||
#
|
||||
# check version number
|
||||
#
|
||||
# -v NUM=<curversion>
|
||||
# -v REF=<minversion>
|
||||
#
|
||||
|
||||
BEGIN {
|
||||
na = split(NUM, a, "\\.")
|
||||
nb = split(REF, b, "\\.")
|
||||
n = (na < nb ? na : nb)
|
||||
for (i = 1 ; i <= n ; i++) {
|
||||
if (a[i] < b[i]) exit(1)
|
||||
if (a[i] > b[i]) exit(0)
|
||||
}
|
||||
|
||||
exit(n > 0 ? 0 : 2)
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
#!/bin/csh
|
||||
#
|
||||
# a sample script to show how to retrieve proper path for port
|
||||
#
|
||||
|
||||
set ORG_HOME = `dirname $0`/..
|
||||
|
||||
set PORTNAME = `$ORG_HOME/config/guess_port`
|
||||
|
||||
set path = ($path $ORG_HOME/ports/$PORTNAME/bin)
|
||||
|
||||
#
|
||||
|
||||
which aragorn
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user