]> SALOME platform Git repositories - tools/install.git/blob - config_files/GUI_BIN.sh
Salome HOME
Remove HappyDoc dependencies
[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.2.0b1" ]; 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.2.0b1.tar.gz -C ${INSTALL_ROOT}
75
76 # modify all *.la files
77 export GUI_ROOT_DIR=${PRODUCT_DIR}
78 modif_la_files ${PRODUCT_DIR}
79
80 print_env
81 }
82
83 export PROCEDURE=$1;
84 export INSTALL_WORK=$2;
85 export SOURCE_DIR=$3;
86 export INSTALL_ROOT=$4;
87 export PRODUCT_SEQUENCE=$5;
88 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="GUIBin" ; fi
89 export PRODUCT="GUI_3.2.0b1"
90 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
91 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
92 source ./common.sh
93 $PROCEDURE