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