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