]> SALOME platform Git repositories - tools/install.git/blob - config_files/LIGHT_BIN.sh
Salome HOME
Remove HappyDoc dependencies
[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 ]; then
6         ver=`cat ${LIGHT_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $NF}' | tr -d '[:space:]' ` 
7         if [ "$ver" = "3.2.0b1" ]; 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}/LIGHTbinariesV3.2.0b1.tar.gz -C ${INSTALL_ROOT}
66
67 # modify all *.la files
68 export LIGHT_ROOT_DIR=${PRODUCT_DIR}
69 modif_la_files ${PRODUCT_DIR}
70
71 print_env
72 }
73
74 export PROCEDURE=$1;
75 export INSTALL_WORK=$2;
76 export SOURCE_DIR=$3;
77 export INSTALL_ROOT=$4;
78 export PRODUCT_SEQUENCE=$5;
79 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="LIGHTBin" ; fi
80 export PRODUCT="LIGHT_3.2.0b1"
81 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
82 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
83 source ./common.sh
84 $PROCEDURE