]> SALOME platform Git repositories - tools/install.git/blob - config_files/PYCALCULATOR_SRC.sh
Salome HOME
63c1ad178c0fc11a00f6e1a181dd2305cee9660e
[tools/install.git] / config_files / PYCALCULATOR_SRC.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : PYCALCULATOR_SRC.sh
5 #  Created   : Thu Dec 18 12:01:00 2002
6 #  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
7 #  Project   : SALOME
8 #  Module    : Installation Wizard
9 #  Copyright : 2002-2006 CEA
10 #
11 #  This script is the part of the SALOME installation procedure.
12 #
13 ####################################################################################
14
15 check_version(){
16 if [ -n "${PYCALCULATOR_SRC_DIR}" ]; then
17     check_lib_version VERSION ${PYCALCULATOR_SRC_DIR}/bin
18     if [ "$?" -eq "0" ]; then
19         ver=`cat ${PYCALCULATOR_SRC_DIR}/bin/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' ` 
20         if [ "$ver" = "3.2.4" ]; then
21             return 0
22         fi
23     fi
24 fi
25 return 1
26 }
27
28 print_env(){
29 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
30 #$DELIM ${PRODUCT_TYPE} $DELIM
31 export PYCALCULATOR_SRC_DIR=\${INSTALL_ROOT}/${PRODUCT}
32 ##
33 EOF
34 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
35 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
36 }
37
38 # looks for the native product and collects it's environment (used by make_env())
39 try_native(){
40 check_version
41 if [ $? -eq 0 ] ; then
42     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
43 #$DELIM ${PRODUCT_TYPE} $DELIM
44 export PYCALCULATOR_SRC_DIR=${PYCALCULATOR_SRC_DIR}
45 ##
46 EOF
47     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
48     return 0
49 fi
50 return 1;
51 }
52
53 try_preinstalled(){
54 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
55 return $?
56 }
57
58 install_source()
59 {
60 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
61 source ${INSTALL_WORK}/$SHRC
62
63 check_jb tar xfz ${SOURCE_DIR}/PYCALCULATORsourcesV3.2.4.tar.gz -C ${INSTALL_ROOT}
64
65 print_env
66 }
67
68 install_binary()
69 {
70 return 1
71 }
72
73 export PROCEDURE=$1;
74 export INSTALL_WORK=$2;
75 export SOURCE_DIR=$3;
76 export INSTALL_ROOT=$4;
77 export PRODUCT_SEQUENCE=$5;
78 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="PyCalculatorSrc" ; fi
79 export PRODUCT="PYCALCULATOR_SRC_3.2.4"
80 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
81 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
82 source ./common.sh
83 $PROCEDURE