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