]> SALOME platform Git repositories - tools/install.git/blob - config_files/HELLO_BIN.sh
Salome HOME
Process *.la files for SALOME binaries
[tools/install.git] / config_files / HELLO_BIN.sh
1 #!/bin/sh
2
3 check_version(){
4 if [ -n "${HELLO_ROOT_DIR}" ]; then
5     if [ -f ${HELLO_ROOT_DIR}/bin/salome/VERSION ]; then
6         ver=`cat ${HELLO_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $NF}' | tr -d '[:space:]' ` 
7         if [ "$ver" = "2.2.6" ]; 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 HELLO_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
19 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
20   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
21     export PATH=\${HELLO_ROOT_DIR}/bin/salome:\${PATH}
22     export LD_LIBRARY_PATH=\${HELLO_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
23     export PYTHONPATH=\${HELLO_ROOT_DIR}/bin/salome:\${HELLO_ROOT_DIR}/lib/salome:\${HELLO_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
24   fi
25 fi
26 ##
27 EOF
28 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
29 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
30 }
31
32 # looks for the native product and collects it's environment (used by make_env())
33 try_native(){
34 check_version
35 if [ $? -eq 0 ] ; then
36     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
37 #$DELIM ${PRODUCT_TYPE} $DELIM
38 export HELLO_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
39 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
40   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
41     export PATH=\${HELLO_ROOT_DIR}/bin/salome:\${PATH}
42     export LD_LIBRARY_PATH=\${HELLO_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
43     export PYTHONPATH=\${HELLO_ROOT_DIR}/bin/salome:\${HELLO_ROOT_DIR}/lib/salome:\${HELLO_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
44   fi
45 fi
46 ##
47 EOF
48     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
49     return 0
50 fi
51 return 1;
52 }
53
54 try_preinstalled(){
55 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
56 return $?
57 }
58
59 install_source()
60 {
61 return 1
62 }
63
64 install_binary()
65 {
66 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
67 source ${INSTALL_WORK}/$SHRC
68
69 check_jb tar xfz ${SOURCE_DIR}/HELLObinariesV2.2.6.tar.gz -C ${INSTALL_ROOT}
70
71 # modify all *.la files
72 modif_la_files ${PRODUCT_DIR}/lib/salome
73
74 print_env
75 }
76
77 export PROCEDURE=$1;
78 export INSTALL_WORK=$2;
79 export SOURCE_DIR=$3;
80 export INSTALL_ROOT=$4;
81 export PRODUCT_SEQUENCE=$5;
82 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="HelloBin" ; fi
83 export PRODUCT="HELLO_2.2.6"
84 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
85 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
86 source ./common.sh
87 $PROCEDURE