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