]> SALOME platform Git repositories - tools/install.git/blob - config_files/CALCULATOR_BIN.sh
Salome HOME
Increment version number: 3.2.3
[tools/install.git] / config_files / CALCULATOR_BIN.sh
1 #!/bin/sh
2
3 check_version(){
4 if [ -n "${CALCULATOR_ROOT_DIR}" ]; then
5     check_lib_version VERSION ${CALCULATOR_ROOT_DIR}/bin/salome
6     if [ "$?" -eq "0" ]; then
7         ver=`cat ${CALCULATOR_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' ` 
8         if [ "$ver" = "3.2.3" ]; then
9             return 0
10         fi
11     fi
12 fi
13 return 1
14 }
15
16 print_env(){
17
18 if test `uname -m` = "x86_64" ; then
19 export LIB_PREFIX=64
20 else
21 export LIB_PREFIX=""
22 fi
23
24 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
25 #$DELIM ${PRODUCT_TYPE} $DELIM
26 export CALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
27 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
28   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
29     export PATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
30     export LD_LIBRARY_PATH=\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
31     export PYTHONPATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
32   fi
33 fi
34 ##
35 EOF
36 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
37 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
38 }
39
40 # looks for the native product and collects it's environment (used by make_env())
41 try_native(){
42 check_version
43 if test `uname -m` = "x86_64" ; then
44 export LIB_PREFIX=64
45 else
46 export LIB_PREFIX=""
47 fi
48 if [ $? -eq 0 ] ; then
49     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
50 #$DELIM ${PRODUCT_TYPE} $DELIM
51 export CALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
52 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
53   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
54     export PATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
55     export LD_LIBRARY_PATH=\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
56     export PYTHONPATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
57   fi
58 fi
59 ##
60 EOF
61     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
62     return 0
63 fi
64 return 1;
65 }
66
67 try_preinstalled(){
68 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
69 return $?
70 }
71
72 install_source()
73 {
74 return 1
75 }
76
77 install_binary()
78 {
79 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
80 source ${INSTALL_WORK}/$SHRC
81
82 check_jb tar xfz ${SOURCE_DIR}/CALCULATORbinariesV3.2.3.tar.gz -C ${INSTALL_ROOT}
83
84 # modify all *.la files
85 export CALCULATOR_ROOT_DIR=${PRODUCT_DIR}
86 modif_la_files ${PRODUCT_DIR}
87
88 cd ${PRODUCT_DIR}/bin/salome
89 sed -e "s%export KERNEL_ROOT_DIR=.*%export KERNEL_ROOT_DIR=${KERNEL_ROOT_DIR}%g"             runAppli > _runAppli
90 sed -e "s%export CALCULATOR_ROOT_DIR=.*%export CALCULATOR_ROOT_DIR=${CALCULATOR_ROOT_DIR}%g" _runAppli > runAppli
91 rm -f _runAppli
92 chmod a+x runAppli
93
94 print_env
95 }
96
97 export PROCEDURE=$1;
98 export INSTALL_WORK=$2;
99 export SOURCE_DIR=$3;
100 export INSTALL_ROOT=$4;
101 export PRODUCT_SEQUENCE=$5;
102 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="CalculatorBin" ; fi
103 export PRODUCT="CALCULATOR_3.2.3"
104 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
105 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
106 source ./common.sh
107 $PROCEDURE