]> SALOME platform Git repositories - tools/install.git/blob - config_files/HELLO.sh
Salome HOME
1) getSize() just returns required size that read from XML now;
[tools/install.git] / config_files / HELLO.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-2007 CEA
10 #
11 #  This script is the part of the SALOME installation procedure.
12 #
13 ####################################################################################
14
15 VERSION="3.2.7"
16
17 check_version(){
18 if [ -n "${HELLO_ROOT_DIR}" ]; then
19     if [ -f ${HELLO_ROOT_DIR}/bin/salome/VERSION ]; then
20         ver=`cat ${HELLO_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $NF}' | tr -d '[:space:]' ` 
21         if [ "$ver" = "${VERSION}" ]; then
22             return 0
23         fi
24     fi
25 elif [ -n "${HELLO_SRC_DIR}" ]; then
26     if [ -f ${HELLO_SRC_DIR}/configure.in.base ]; then
27         ver=`grep -E "^VERSION=" ${HELLO_SRC_DIR}/configure.in.base | awk -F= '{print $NF}' | tr -d '[:space:]' ` 
28         if [ "$ver" = "${VERSION}" ]; then
29             return 0
30         fi
31     fi
32 fi
33 return 1
34 }
35
36 print_env_bin(){
37 if test `uname -m` = "x86_64" ; then
38 export LIB_PREFIX=64
39 else
40 export LIB_PREFIX=""
41 fi
42 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
43 #$DELIM ${PRODUCT_TYPE} $DELIM
44 export HELLO_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
45 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
46   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
47     export PATH=\${HELLO_ROOT_DIR}/bin/salome:\${PATH}
48     export LD_LIBRARY_PATH=\${HELLO_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
49     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}
50   fi
51 fi
52 ##
53 EOF
54 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
55 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
56 }
57
58 print_env_src(){
59 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
60 #$DELIM ${PRODUCT_TYPE}_src $DELIM
61 export HELLO_SRC_DIR=\${INSTALL_ROOT}/${PRODUCT_SRC}
62 ##
63 EOF
64
65 (test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
66 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
67 }
68
69 try_preinstalled(){
70 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
71 try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
72 return $?
73 }
74
75 install_source()
76 {
77 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
78 source ${INSTALL_WORK}/$SHRC
79
80 check_jb tar xfz ${SOURCE_DIR}/HELLOsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
81
82 # to generate environment scripts
83 try_preinstalled
84 }
85
86 install_source_and_build()
87 {
88 # install sources
89 install_source
90
91 # build sources
92 mkdir -p ${PRODUCT_DIR}
93
94 if [ -e ./build.sh ] ; then
95     cp -f ./build.sh ${INSTALL_ROOT}
96 fi
97
98 CUR_DIR=`pwd`
99 cd ${INSTALL_ROOT}
100 check_jb build.sh -o -b -d -v 0 -p $INSTALL_ROOT HELLO
101
102 cd $CUR_DIR
103
104 # remove sources and temporary files after building
105 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
106     test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
107     test -d ${INSTALL_ROOT}/"HELLO_BUILD" && rm -fr ${INSTALL_ROOT}/"HELLO_BUILD"
108 fi
109
110 # to generate environment scripts
111 try_preinstalled
112 }
113
114 install_binary()
115 {
116 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
117 source ${INSTALL_WORK}/$SHRC
118
119 check_jb tar xfz ${SOURCE_DIR}/HELLObinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
120 check_jb tar xfz ${SRC_DIR}/HELLOsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
121
122 # modify all *.la files
123 export HELLO_ROOT_DIR=${PRODUCT_DIR}
124 modif_la_files ${PRODUCT_DIR}
125
126 cd ${PRODUCT_DIR}/bin/salome
127 sed -e "s%export KERNEL_ROOT_DIR=.*%export KERNEL_ROOT_DIR=${KERNEL_ROOT_DIR}%g" runAppli > _runAppli
128 sed -e "s%export HELLO_ROOT_DIR=.*%export HELLO_ROOT_DIR=${HELLO_ROOT_DIR}%g"    _runAppli > runAppli
129 rm -f _runAppli
130 chmod a+x runAppli
131
132 # to generate environment scripts
133 try_preinstalled
134 }
135
136 export PROCEDURE=$1;
137 export INSTALL_WORK=$2;
138 export SOURCE_DIR=$3;
139 export INSTALL_ROOT=$4;
140 export PRODUCT_SEQUENCE=$5;
141 export PRODUCT_TYPE=$6;
142 export INSTALL_PRODUCTS=$7;
143 SRC_DIR=$8;
144 shift
145 REMOVE_SRC_TMP=$8;
146 export PRODUCT="HELLO_${VERSION}"
147 export PRODUCT_SRC="HELLO_SRC_${VERSION}"
148 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
149 export PRODUCT_SRC_DIR=${INSTALL_ROOT}/${PRODUCT_SRC}
150 source ./common.sh
151 $PROCEDURE