]> SALOME platform Git repositories - tools/install.git/blob - config_files/NETGENPLUGIN_BIN.sh
Salome HOME
2458e4708d9ae5d37a892744cfcfbf4c6fb2398e
[tools/install.git] / config_files / NETGENPLUGIN_BIN.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : NETGENPLUGIN_BIN.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-2007 CEA
10 #
11 #  This script is the part of the SALOME installation procedure.
12 #
13 ####################################################################################
14
15 VERSION="3.2.5"
16
17 check_version(){
18 if [ -n "${NETGENPLUGIN_ROOT_DIR}" ]; then
19     check_lib_version VERSION ${NETGENPLUGIN_ROOT_DIR}/bin/salome
20     if [ "$?" -eq "0" ]; then
21         ver=`cat ${NETGENPLUGIN_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' ` 
22         if [ "$ver" = "${VERSION}" ]; then
23             return 0
24         fi
25     fi
26   return 0
27 fi
28 return 1
29 }
30
31 print_env(){
32 if test `uname -m` = "x86_64" ; then
33 export LIB_PREFIX=64
34 else
35 export LIB_PREFIX=""
36 fi
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${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
43     export PYTHONPATH=\${NETGENPLUGIN_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${NETGENPLUGIN_ROOT_DIR}/lib${LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
44   fi
45 fi
46 ##
47 EOF
48 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
49 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
50 }
51
52 # looks for the native product and collects it's environment (used by make_env())
53 try_native(){
54 check_version
55 if test `uname -m` = "x86_64" ; then
56 export LIB_PREFIX=64
57 else
58 export LIB_PREFIX=""
59 fi
60 if [ $? -eq 0 ] ; then
61     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
62 #$DELIM ${PRODUCT_TYPE} $DELIM
63 export NETGENPLUGIN_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
64 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
65   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
66     export LD_LIBRARY_PATH=\${NETGENPLUGIN_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
67     export PYTHONPATH=\${NETGENPLUGIN_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${NETGENPLUGIN_ROOT_DIR}/lib${LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
68   fi
69 fi
70 ##
71 EOF
72     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
73     return 0
74 fi
75 return 1;
76 }
77
78 try_preinstalled(){
79 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
80 return $?
81 }
82
83 install_source()
84 {
85 return 1
86 }
87
88 install_binary()
89 {
90 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
91 source ${INSTALL_WORK}/$SHRC
92
93 check_jb tar xfz ${SOURCE_DIR}/NETGENPLUGINbinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
94
95 # modify all *.la files
96 export NETGENPLUGIN_ROOT_DIR=${PRODUCT_DIR}
97 modif_la_files ${PRODUCT_DIR}
98
99 print_env
100 }
101
102 export PROCEDURE=$1;
103 export INSTALL_WORK=$2;
104 export SOURCE_DIR=$3;
105 export INSTALL_ROOT=$4;
106 export PRODUCT_SEQUENCE=$5;
107 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="NETGENPLUGINbin" ; fi
108 export PRODUCT="NETGENPLUGIN_${VERSION}"
109 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
110 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
111 source ./common.sh
112 $PROCEDURE