]> SALOME platform Git repositories - tools/install.git/blob - config_files/HXX2SALOME.sh
Salome HOME
d5f16b5d30aa8cb1b6a9f721fefdbbe6d8fc176f
[tools/install.git] / config_files / HXX2SALOME.sh
1 #!/bin/sh
2
3 check_version(){
4 # No way to check version!
5 return 0
6 }
7
8 print_env(){
9 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
10 #$DELIM ${PRODUCT_TYPE} $DELIM
11 export HXX2SALOME_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}/bin
12 export PATH=\${HXX2SALOME_ROOT_DIR}:\${PATH}
13 ##
14 EOF
15 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
16 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
17 }
18
19 # looks for the native product and collects it's environment (used by make_env())
20 try_native(){
21 HXX2SALOME_ROOT_DIR="`find_in_path hxx2salome ${PATH}`"
22 if [ -n "${adir}" ] ; then
23     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
24 #$DELIM ${PRODUCT_TYPE} $DELIM
25 export HXX2SALOME_ROOT_DIR=${HXX2SALOME_ROOT_DIR}
26 export PATH=\${HXX2SALOME_ROOT_DIR}:\${PATH}
27 ##
28 EOF
29     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
30     return 0
31 fi
32 return 1;
33 }
34
35 try_preinstalled(){
36 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
37 return $?
38 }
39
40 install_source()
41 {
42 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
43 source ${INSTALL_WORK}/$SHRC
44
45 makedir ${PRODUCT_DIR}
46
47 check_jb tar xfz ${SOURCE_DIR}/HXX2SALOME.tar.gz -C ${INSTALL_WORK}
48 cd ${PRODUCT_WORK}
49 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
50 -------------------
51 Build configure...
52 -------------------
53 EOF
54 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./build_configure
55 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
56 -------------------
57 Configure...
58 -------------------
59 EOF
60 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR}
61
62 GCC=`which gcc`
63 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
64 used gcc=$GCC
65 EOF
66 check_job ${PRODUCT_DIR}/MAKE.LOG make
67
68 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
69
70 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
71 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
72
73 print_env
74 }
75
76 install_binary()
77 {
78 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
79 source ${INSTALL_WORK}/$SHRC
80
81 check_jb tar xfz ${SOURCE_DIR}/HXX2SALOME.tar.gz -C ${INSTALL_ROOT}
82
83 print_env
84 }
85
86 pickup_env()
87 {
88 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE} ${PRODUCT_DIR}
89 }
90
91 export PROCEDURE=$1;
92 export INSTALL_WORK=$2;
93 export SOURCE_DIR=$3;
94 export INSTALL_ROOT=$4;
95 export PRODUCT_SEQUENCE=$5;
96 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="HXX2SALOME" ; fi
97 export PRODUCT="HXX2SALOME"
98 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
99 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
100 source ./common.sh
101 $PROCEDURE