]> SALOME platform Git repositories - tools/install.git/blob - config_files/msg2qm.sh
Salome HOME
Update for version 3.0.0
[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 rm -rf ${PRODUCT_WORK}
68
69 print_env
70 }
71
72 install_binary()
73 {
74 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
75 source ${INSTALL_WORK}/$SHRC
76
77 check_jb tar xfz ${SOURCE_DIR}/msg2qm.tar.gz -C ${INSTALL_ROOT}
78
79 print_env
80 }
81
82 export PROCEDURE=$1;
83 export INSTALL_WORK=$2;
84 export SOURCE_DIR=$3;
85 export INSTALL_ROOT=$4;
86 export PRODUCT_SEQUENCE=$5;
87 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="msg2qm" ; fi
88 export PRODUCT="msg2qm"
89 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
90 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
91 source ./common.sh
92 $PROCEDURE