]> SALOME platform Git repositories - tools/install.git/blob - config_files/HXX2SALOME.sh
Salome HOME
1) getSize() just returns required size that read from XML now;
[tools/install.git] / config_files / HXX2SALOME.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : HXX2SALOME.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 # No way to check version!
19 return 0
20 }
21
22 print_env_bin(){
23 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
24 #$DELIM ${PRODUCT_TYPE} $DELIM
25 export HXX2SALOME_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}/bin
26 export PATH=\${HXX2SALOME_ROOT_DIR}:\${PATH}
27 ##
28 EOF
29 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
30 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
31 }
32
33 print_env_src()
34 {
35 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
36 #$DELIM ${PRODUCT_TYPE}_src $DELIM
37 # nothing to do
38 ##
39 EOF
40 (test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
41 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
42 }
43
44 try_preinstalled(){
45 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
46 try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
47 return $?
48 }
49
50 install_source()
51 {
52 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
53 source ${INSTALL_WORK}/$SHRC
54 # unpack
55 check_jb tar xfz ${SOURCE_DIR}/HXX2SALOMEsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
56
57 # to generate environment scripts
58 try_preinstalled
59 }
60
61 install_source_and_build()
62 {
63 # install sources
64 install_source
65
66 # build sources
67 makedir ${PRODUCT_DIR}
68 cd ${PRODUCT_SRC_DIR}
69 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
70 -------------------
71 Build configure...
72 -------------------
73 EOF
74 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./build_configure
75 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
76 -------------------
77 Configure...
78 -------------------
79 EOF
80 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR}
81
82 GCC=`which gcc`
83 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
84 used gcc=$GCC
85 EOF
86 check_job ${PRODUCT_DIR}/MAKE.LOG make
87
88 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
89
90 #du -sk ${PRODUCT_SRC_DIR} > ${PRODUCT_DIR}/size.log
91 cd ${PRODUCT_DIR};
92
93 # remove sources and temporary files after building
94 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
95     test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
96 fi
97
98 # to generate environment scripts
99 try_preinstalled
100 }
101
102 install_binary()
103 {
104 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
105 source ${INSTALL_WORK}/$SHRC
106
107 check_jb tar xfz ${SOURCE_DIR}/HXX2SALOMEbinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
108
109 # to generate environment scripts
110 try_preinstalled
111 }
112
113 export PROCEDURE=$1;
114 export INSTALL_WORK=$2;
115 export SOURCE_DIR=$3;
116 export INSTALL_ROOT=$4;
117 export PRODUCT_SEQUENCE=$5;
118 export PRODUCT_TYPE=$6;
119 export INSTALL_PRODUCTS=$7;
120 shift
121 REMOVE_SRC_TMP=$8;
122 export PRODUCT="HXX2SALOME_${VERSION}"
123 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
124 export PRODUCT_SRC_DIR=${INSTALL_ROOT}/"HXX2SALOME_SRC_${VERSION}"
125 source ./common.sh
126 $PROCEDURE