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