]> SALOME platform Git repositories - tools/install.git/blob - config_files/PYCALCULATOR_BIN.sh
Salome HOME
Version number : 2.2.8
[tools/install.git] / config_files / PYCALCULATOR_BIN.sh
1 #!/bin/sh
2
3 check_version(){
4 if [ -n "${PYCALCULATOR_ROOT_DIR}" ]; then
5     check_lib_version VERSION ${PYCALCULATOR_ROOT_DIR}/bin/salome
6     if [ "$?" -eq "0" ]; then
7         ver=`cat ${PYCALCULATOR_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' ` 
8         if [ "$ver" = "2.2.8" ]; 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 PYCALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
20 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
21   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
22     export PATH=\${PYCALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
23     export PYTHONPATH=\${PYCALCULATOR_ROOT_DIR}/bin/salome:\${PYCALCULATOR_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
24   fi
25 fi
26 ##
27 EOF
28 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
29 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
30 }
31
32 # looks for the native product and collects it's environment (used by make_env())
33 try_native(){
34 check_version
35 if [ $? -eq 0 ] ; then
36     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
37 #$DELIM ${PRODUCT_TYPE} $DELIM
38 export PYCALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
39 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
40   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
41     export PATH=\${PYCALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
42     export PYTHONPATH=\${PYCALCULATOR_ROOT_DIR}/bin/salome:\${PYCALCULATOR_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
43   fi
44 fi
45 ##
46 EOF
47     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
48     return 0
49 fi
50 return 1;
51 }
52
53 try_preinstalled(){
54 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
55 return $?
56 }
57
58 install_source()
59 {
60 return 1
61 }
62
63 install_binary()
64 {
65 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
66 source ${INSTALL_WORK}/$SHRC
67
68 check_jb tar xfz ${SOURCE_DIR}/PYCALCULATORbinariesV2.2.8.tar.gz -C ${INSTALL_ROOT}
69
70 # modify all *.la files
71 export PYCALCULATOR_ROOT_DIR=${PRODUCT_DIR}
72 modif_la_files ${PRODUCT_DIR}/lib/salome
73
74 print_env
75 }
76
77 export PROCEDURE=$1;
78 export INSTALL_WORK=$2;
79 export SOURCE_DIR=$3;
80 export INSTALL_ROOT=$4;
81 export PRODUCT_SEQUENCE=$5;
82 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="PyCalculatorBin" ; fi
83 export PRODUCT="PYCALCULATOR_2.2.8"
84 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
85 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
86 source ./common.sh
87 $PROCEDURE