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