]> SALOME platform Git repositories - tools/install.git/blob - config_files/Numeric-22.0.sh
Salome HOME
Remove HappyDoc dependencies
[tools/install.git] / config_files / Numeric-22.0.sh
1 #!/bin/sh
2
3 check_version(){
4 ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null`
5 if [ "$ver" == "22.0" ]; then
6    return 0
7 fi
8 return 1
9 }
10
11 print_env(){
12 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
13 #$DELIM ${PRODUCT_TYPE} $DELIM
14 export PYTHONPATH=\${INSTALL_ROOT}/${PRODUCT}/lib/python\${PYTHON_VERSION}/site-packages/Numeric:\${PYTHONPATH}
15 ##
16 EOF
17 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
18 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
19 }
20
21 # looks for the native product and collects it's environment (used by make_env())
22 try_native(){
23 numpath=`python -c "import Numeric; print Numeric.__file__" 2>/dev/null`
24 if [ -n "${numpath}" ] ; then
25     numpath=`dirname ${numpath}`
26     ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null | awk -F. '{v=0;for(i=1;i<=NF;i++)v=v*100+$i;print v}'`
27     if [ $ver -ge 2200 ] ; then
28         tmp="${numpath} ${numpath} \${PYTHONPATH} ${PYTHONPATH}";  
29         pythonpath=`sort_path ${tmp}`
30         cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
31 #$DELIM ${PRODUCT_TYPE} $DELIM
32 export PYTHONPATH=${pythonpath}
33 ##
34 EOF
35         make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
36         if [ $ver -eq 2200 ] ; then
37             return 0
38         else
39             return 2
40         fi
41     fi
42 fi
43 return 1
44 }
45
46 try_preinstalled(){
47 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
48 return $?
49 }
50
51 install_source()
52 {
53 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
54 source ${INSTALL_WORK}/$SHRC
55
56 makedir ${PRODUCT_DIR}
57
58 check_jb tar xfz ${SOURCE_DIR}/Numeric-22.0.tar.gz -C ${INSTALL_WORK}
59 cd ${PRODUCT_WORK}
60
61 check_job ${PRODUCT_DIR}/INSTALL.LOG python setup.py install --prefix=${PRODUCT_DIR}
62
63 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
64 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
65 print_env
66 }
67
68 install_binary()
69 {
70 check_jb tar xfz ${SOURCE_DIR}/Numeric-22.0.tar.gz -C ${INSTALL_ROOT}
71
72 print_env
73 }
74
75 export PROCEDURE=$1;
76 export INSTALL_WORK=$2;
77 export SOURCE_DIR=$3;
78 export INSTALL_ROOT=$4;
79 export PRODUCT_SEQUENCE=$5;
80 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="numeric" ; fi
81 export PRODUCT="Numeric-22.0"
82 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
83 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
84 source ./common.sh
85 $PROCEDURE