]> SALOME platform Git repositories - tools/install.git/blob - config_files/PYHELLO_BIN.sh
Salome HOME
Remove HappyDoc dependencies
[tools/install.git] / config_files / PYHELLO_BIN.sh
1 #!/bin/sh
2
3 check_version(){
4 if [ -n "${PYHELLO_ROOT_DIR}" ]; then
5     if [ -f ${PYHELLO_ROOT_DIR}/bin/salome/VERSION ]; then
6         ver=`cat ${PYHELLO_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $NF}' | tr -d '[:space:]' ` 
7         if [ "$ver" = "3.2.0b1" ]; 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 PYHELLO_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
19 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
20   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
21     export PATH=\${PYHELLO_ROOT_DIR}/bin/salome:\${PATH}
22     export PYTHONPATH=\${PYHELLO_ROOT_DIR}/bin/salome:\${PYHELLO_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
23   fi
24 fi
25 ##
26 EOF
27 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
28 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
29 }
30
31 # looks for the native product and collects it's environment (used by make_env())
32 try_native(){
33 check_version
34 if [ $? -eq 0 ] ; then
35     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
36 #$DELIM ${PRODUCT_TYPE} $DELIM
37 export PYHELLO_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
38 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
39   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
40     export PATH=\${PYHELLO_ROOT_DIR}/bin/salome:\${PATH}
41     export PYTHONPATH=\${PYHELLO_ROOT_DIR}/bin/salome:\${PYHELLO_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
42   fi
43 fi
44 ##
45 EOF
46     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
47     return 0
48 fi
49 return 1;
50 }
51
52 try_preinstalled(){
53 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
54 return $?
55 }
56
57 install_source()
58 {
59 return 1
60 }
61
62 install_binary()
63 {
64 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
65 source ${INSTALL_WORK}/$SHRC
66
67 check_jb tar xfz ${SOURCE_DIR}/PYHELLObinariesV3.2.0b1.tar.gz -C ${INSTALL_ROOT}
68
69 # modify all *.la files
70 export PYHELLO_ROOT_DIR=${PRODUCT_DIR}
71 modif_la_files ${PRODUCT_DIR}
72
73 print_env
74 }
75
76 export PROCEDURE=$1;
77 export INSTALL_WORK=$2;
78 export SOURCE_DIR=$3;
79 export INSTALL_ROOT=$4;
80 export PRODUCT_SEQUENCE=$5;
81 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="PyHelloBin" ; fi
82 export PRODUCT="PYHELLO_3.2.0b1"
83 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
84 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
85 source ./common.sh
86 $PROCEDURE