]> SALOME platform Git repositories - tools/install.git/blob - config_files/LIGHT_BIN.sh
Salome HOME
Update for version 3.0.0
[tools/install.git] / config_files / LIGHT_BIN.sh
1 #!/bin/sh
2
3 check_version(){
4 if [ -n "${LIGHT_ROOT_DIR}" ]; then
5     if [ -f ${LIGHT_ROOT_DIR}/bin/salome/VERSION ];
6         ver=`cat ${LIGHT_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $NF}' | tr -d '[:space:]' ` 
7         if [ "$ver" = "0.1" ]; then
8             return 0
9         fi
10     fi
11 fi
12 return 1
13 }
14
15 print_env(){
16 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
17 #$DELIM ${PRODUCT_TYPE} $DELIM
18 export LIGHT_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
19 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
20   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
21     export LD_LIBRARY_PATH=\${LIGHT_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
22   fi
23 fi
24 ##
25 EOF
26 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
27 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
28 }
29
30 # looks for the native product and collects it's environment (used by make_env())
31 try_native(){
32 check_version
33 if [ $? -eq 0 ] ; then
34     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
35 #$DELIM ${PRODUCT_TYPE} $DELIM
36 export LIGHT_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
37 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
38   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
39     export LD_LIBRARY_PATH=\${LIGHT_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
40   fi
41 fi
42 ##
43 EOF
44     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
45     return 0
46 fi
47 return 1;
48 }
49
50 try_preinstalled(){
51 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
52 return $?
53 }
54
55 install_source()
56 {
57 return 1
58 }
59
60 install_binary()
61 {
62 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
63 source ${INSTALL_WORK}/$SHRC
64
65 check_jb tar xfz ${SOURCE_DIR}/LIGHTbinariesV0.1.tar.gz -C ${INSTALL_ROOT}
66
67 print_env
68 }
69
70 export PROCEDURE=$1;
71 export INSTALL_WORK=$2;
72 export SOURCE_DIR=$3;
73 export INSTALL_ROOT=$4;
74 export PRODUCT_SEQUENCE=$5;
75 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="LIGHTBin" ; fi
76 export PRODUCT="LIGHT_0.1"
77 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
78 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
79 source ./common.sh
80 $PROCEDURE