]> SALOME platform Git repositories - tools/install.git/blob - config_files/HELLO_SRC.sh
Salome HOME
ec9a03d5b5048b6c1557cbc4b105957cb8a71f39
[tools/install.git] / config_files / HELLO_SRC.sh
1 #!/bin/sh
2
3 check_version(){
4 if [ -n "${HELLO_SRC_DIR}" ]; then
5     if [ -f ${HELLO_SRC_DIR}/bin/VERSION ]; then
6         ver=`cat ${HELLO_SRC_DIR}/bin/VERSION | awk -F: '{print $NF}' | tr -d '[:space:]' ` 
7         if [ "$ver" = "3.2.0" ]; then
8             return 0
9         fi
10     fi
11 fi
12 return 1
13 }
14
15 print_env(){
16 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
17 #$DELIM ${PRODUCT_TYPE} $DELIM
18 export HELLO_SRC_DIR=\${INSTALL_ROOT}/${PRODUCT}
19 ##
20 EOF
21 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
22 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
23 }
24
25 # looks for the native product and collects it's environment (used by make_env())
26 try_native(){
27 check_version
28 if [ $? -eq 0 ] ; then
29     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
30 #$DELIM ${PRODUCT_TYPE} $DELIM
31 export HELLO_SRC_DIR=${HELLO_SRC_DIR}
32 ##
33 EOF
34     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
35     return 0
36 fi
37 return 1;
38 }
39
40 try_preinstalled(){
41 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
42 return $?
43 }
44
45 install_source()
46 {
47 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
48 source ${INSTALL_WORK}/$SHRC
49
50 check_jb tar xfz ${SOURCE_DIR}/HELLOsourcesV3.2.0.tar.gz -C ${INSTALL_ROOT}
51
52 print_env
53 }
54
55 install_binary()
56 {
57 return 1
58 }
59
60 export PROCEDURE=$1;
61 export INSTALL_WORK=$2;
62 export SOURCE_DIR=$3;
63 export INSTALL_ROOT=$4;
64 export PRODUCT_SEQUENCE=$5;
65 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="HelloSrc" ; fi
66 export PRODUCT="HELLO_SRC_3.2.0"
67 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
68 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
69 source ./common.sh
70 $PROCEDURE