]> SALOME platform Git repositories - tools/install.git/blob - config_files/SUPERV_SRC.sh
Salome HOME
Update for version 2.2.2
[tools/install.git] / config_files / SUPERV_SRC.sh
1 #!/bin/sh
2
3 check_version(){
4 if [ -n "${SUPERV_SRC_DIR}" ]; then
5     check_lib_version VERSION ${SUPERV_SRC_DIR}/bin
6     if [ "$?" -eq "0" ]; then
7         ver=`cat ${SUPERV_SRC_DIR}/bin/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' ` 
8         if [ "$ver" = "2.2.2" ]; then
9             return 0
10         fi
11     fi
12 fi
13 return 1
14 }
15
16 print_env(){
17 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
18 #$DELIM ${PRODUCT_TYPE} $DELIM
19 export SUPERV_SRC_DIR=\${INSTALL_ROOT}/${PRODUCT}
20 ##
21 EOF
22 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
23 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
24 }
25
26 # looks for the native product and collects it's environment (used by make_env())
27 try_native(){
28 check_version
29 if [ $? -eq 0 ] ; then
30     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
31 #$DELIM ${PRODUCT_TYPE} $DELIM
32 export SUPERV_SRC_DIR=${SUPERV_SRC_DIR}
33 ##
34 EOF
35     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
36     return 0
37 fi
38 return 1;
39 }
40
41 try_preinstalled(){
42 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
43 return $?
44 }
45
46 install_source()
47 {
48 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
49 source ${INSTALL_WORK}/$SHRC
50
51 check_jb tar xfz ${SOURCE_DIR}/SUPERVsourcesV2.2.2.tar.gz -C ${INSTALL_ROOT}
52
53 print_env
54 }
55
56 install_binary()
57 {
58 return 1
59 }
60
61 export PROCEDURE=$1;
62 export INSTALL_WORK=$2;
63 export SOURCE_DIR=$3;
64 export INSTALL_ROOT=$4;
65 export PRODUCT_SEQUENCE=$5;
66 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="SupervSrc" ; fi
67 export PRODUCT="SUPERV_SRC_2.2.2"
68 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
69 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
70 source ./common.sh
71 $PROCEDURE