]> SALOME platform Git repositories - tools/install.git/blob - config_files/GEOM_BIN.sh
Salome HOME
1e7e7b41ccbf65ecfad285a90f917f981527226c
[tools/install.git] / config_files / GEOM_BIN.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : GEOM_BIN.sh
5 #  Created   : Thu Dec 18 12:01:00 2002
6 #  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
7 #  Project   : SALOME
8 #  Module    : Installation Wizard
9 #  Copyright : 2002-2006 CEA
10 #
11 #  This script is the part of the SALOME installation procedure.
12 #
13 ####################################################################################
14
15 check_version(){
16 if [ -n "${GEOM_ROOT_DIR}" ]; then
17     check_lib_version VERSION ${GEOM_ROOT_DIR}/bin/salome
18     if [ "$?" -eq "0" ]; then
19         ver=`cat ${GEOM_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' ` 
20         if [ "$ver" = "3.2.4" ]; then
21             return 0
22         fi
23     fi
24 fi
25 return 1
26 }
27
28 print_env(){
29 if test `uname -m` = "x86_64" ; then
30 export LIB_PREFIX=64
31 else
32 export LIB_PREFIX=""
33 fi
34 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
35 #$DELIM ${PRODUCT_TYPE} $DELIM
36 export GEOM_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
37 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
38   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
39     export PATH=\${GEOM_ROOT_DIR}/bin/salome:\${PATH}
40     export LD_LIBRARY_PATH=\${GEOM_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
41     export PYTHONPATH=\${GEOM_ROOT_DIR}/bin/salome:\${GEOM_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${GEOM_ROOT_DIR}/lib${LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
42   fi
43 fi
44 ##
45 EOF
46 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
47 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
48 }
49
50 # looks for the native product and collects it's environment (used by make_env())
51 try_native(){
52 check_version
53 if test `uname -m` = "x86_64" ; then
54 export LIB_PREFIX=64
55 else
56 export LIB_PREFIX=""
57 fi
58 if [ $? -eq 0 ] ; then
59     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
60 #$DELIM ${PRODUCT_TYPE} $DELIM
61 export GEOM_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
62 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
63   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
64     export PATH=\${GEOM_ROOT_DIR}/bin/salome:\${PATH}
65     export LD_LIBRARY_PATH=\${GEOM_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
66     export PYTHONPATH=\${GEOM_ROOT_DIR}/bin/salome:\${GEOM_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${GEOM_ROOT_DIR}/lib${LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
67   fi
68 fi
69 ##
70 EOF
71     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
72     return 0
73 fi
74 return 1;
75 }
76
77 try_preinstalled(){
78 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
79 return $?
80 }
81
82 install_source()
83 {
84 return 1
85 }
86
87 install_binary()
88 {
89 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
90 source ${INSTALL_WORK}/$SHRC
91
92 check_jb tar xfz ${SOURCE_DIR}/GEOMbinariesV3.2.4.tar.gz -C ${INSTALL_ROOT}
93
94 # modify all *.la files
95 export GEOM_ROOT_DIR=${PRODUCT_DIR}
96 modif_la_files ${PRODUCT_DIR}
97
98 print_env
99 }
100
101 export PROCEDURE=$1;
102 export INSTALL_WORK=$2;
103 export SOURCE_DIR=$3;
104 export INSTALL_ROOT=$4;
105 export PRODUCT_SEQUENCE=$5;
106 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="GeomBin" ; fi
107 export PRODUCT="GEOM_3.2.4"
108 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
109 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
110 source ./common.sh
111 $PROCEDURE