]> SALOME platform Git repositories - tools/install.git/blob - config_files/MED_BIN.sh
Salome HOME
Update for version 2.2.2
[tools/install.git] / config_files / MED_BIN.sh
1 #!/bin/sh
2
3 check_version(){
4 if [ -n "${MED_ROOT_DIR}" ]; then
5     check_lib_version VERSION ${MED_ROOT_DIR}/bin/salome
6     if [ "$?" -eq "0" ]; then
7         ver=`cat ${MED_ROOT_DIR}/bin/salome/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 MED_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
20 export PATH=\${MED_ROOT_DIR}/bin/salome:\${PATH}
21 export LD_LIBRARY_PATH=\${MED_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
22 export PYTHONPATH=\${MED_ROOT_DIR}/bin/salome:\${MED_ROOT_DIR}/lib/salome:\${MED_ROOT_DIR}/lib/python2.2/site-packages/salome:\${MED_ROOT_DIR}/lib/python2.2/site-packages/salome/shared_modules:\${PYTHONPATH}
23 ##
24 EOF
25 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
26 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
27 }
28
29 # looks for the native product and collects it's environment (used by make_env())
30 try_native(){
31 check_version
32 if [ $? -eq 0 ] ; then
33     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
34 #$DELIM ${PRODUCT_TYPE} $DELIM
35 export MED_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
36 export PATH=\${MED_ROOT_DIR}/bin/salome:\${PATH}
37 export LD_LIBRARY_PATH=\${MED_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
38 export PYTHONPATH=\${MED_ROOT_DIR}/bin/salome:\${MED_ROOT_DIR}/lib/salome:\${MED_ROOT_DIR}/lib/python2.2/site-packages/salome:\${MED_ROOT_DIR}/lib/python2.2/site-packages/salome/shared_modules:\${PYTHONPATH}
39 ##
40 EOF
41     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
42     return 0
43 fi
44 return 1;
45 }
46
47 try_preinstalled(){
48 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
49 return $?
50 }
51
52 install_source()
53 {
54 return 1
55 }
56
57 install_binary()
58 {
59 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
60 source ${INSTALL_WORK}/$SHRC
61
62 check_jb tar xfz ${SOURCE_DIR}/MEDbinariesV2.2.2.tar.gz -C ${INSTALL_ROOT}
63
64 print_env
65 }
66
67 export PROCEDURE=$1;
68 export INSTALL_WORK=$2;
69 export SOURCE_DIR=$3;
70 export INSTALL_ROOT=$4;
71 export PRODUCT_SEQUENCE=$5;
72 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="MedBin" ; fi
73 export PRODUCT="MED_2.2.2"
74 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
75 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
76 source ./common.sh
77 $PROCEDURE