]> SALOME platform Git repositories - tools/install.git/blob - config_files/GHS3DPRLPLUGIN.sh
Salome HOME
Add path to common libs into 'LD_LIBRARY_PATH'
[tools/install.git] / config_files / GHS3DPRLPLUGIN.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : GHS3DPRLPLUGIN_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="4.0.0"
16
17 check_version(){
18 if [ -n "${GHS3DPRLPLUGIN_ROOT_DIR}" ]; then
19     if [ -f ${GHS3DPRLPLUGIN_ROOT_DIR}/bin/salome/VERSION ]; then
20         ver=`cat ${GHS3DPRLPLUGIN_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $NF}' | tr -d '[:space:]' ` 
21         if [ "$ver" = "${VERSION}" ]; then
22             return 0
23         fi
24     fi
25 elif [ -n "${GHS3DPRLPLUGIN_SRC_DIR}" ]; then
26   check_salome_src_version GHS3DPRLPLUGIN_SRC_DIR $VERSION
27   if [ $? -eq 0 ] ; then return 0 ; fi
28   return 1
29 fi
30 return 1
31 }
32
33 print_env_bin(){
34 if test `uname -m` = "x86_64" ; then
35 export LIB_PREFIX=64
36 else
37 export LIB_PREFIX=""
38 fi
39 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
40 #$DELIM ${PRODUCT_TYPE} $DELIM
41 export GHS3DPRLPLUGIN_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
42 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
43   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
44     export PATH=\${GHS3DPRLPLUGIN_ROOT_DIR}/bin/salome:\${PATH}
45     export PYTHONPATH=\${GHS3DPRLPLUGIN_ROOT_DIR}/bin/salome:\${GHS3DPRLPLUGIN_ROOT_DIR}/lib${LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
46   fi
47 fi
48 ##
49 EOF
50 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
51 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
52 }
53
54 print_env_src(){
55 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF 
56 #$DELIM ${PRODUCT_TYPE}_src $DELIM
57 export GHS3DPRLPLUGIN_SRC_DIR=\${INSTALL_ROOT}/${PRODUCT_SRC}
58 ##
59 EOF
60
61 (test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
62 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
63 }
64
65 try_preinstalled(){
66 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
67 try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
68 return $?
69 }
70
71 install_source()
72 {
73 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
74 source ${INSTALL_WORK}/$SHRC
75
76 check_jb tar xfz ${SOURCE_DIR}/GHS3DPRLPLUGINsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
77
78 # to generate environment scripts
79 try_preinstalled
80 }
81
82 install_source_and_build()
83 {
84 # install sources
85 install_source
86
87 # build sources
88 mkdir -p ${PRODUCT_DIR}
89
90 if [ -e ./build.sh ] ; then
91     cp -f ./build.sh ${INSTALL_ROOT}
92 fi
93
94 CUR_DIR=`pwd`
95 cd ${INSTALL_ROOT}
96 check_jb build.sh -o -b -d -v 0 -p $INSTALL_ROOT GHS3DPRLPLUGIN
97
98 cd $CUR_DIR
99
100 # remove sources and temporary files after building
101 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
102     test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
103     test -d ${INSTALL_ROOT}/"GHS3DPRLPLUGIN_BUILD" && rm -fr ${INSTALL_ROOT}/"GHS3DPRLPLUGIN_BUILD"
104 fi
105
106 # to generate environment scripts
107 try_preinstalled
108 }
109
110 install_binary()
111 {
112 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
113 source ${INSTALL_WORK}/$SHRC
114
115 check_jb tar xfz ${SOURCE_DIR}/GHS3DPRLPLUGINbinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
116 check_jb tar xfz ${SRC_DIR}/GHS3DPRLPLUGINsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
117
118 # modify all *.la files
119 export GHS3DPRLPLUGIN_ROOT_DIR=${PRODUCT_DIR}
120 modif_la_files ${PRODUCT_DIR}
121
122 # to generate environment scripts
123 try_preinstalled
124 }
125
126 export PROCEDURE=$1;
127 export INSTALL_WORK=$2;
128 export SOURCE_DIR=$3;
129 export INSTALL_ROOT=$4;
130 export PRODUCT_SEQUENCE=$5;
131 export PRODUCT_TYPE=$6;
132 export INSTALL_PRODUCTS=$7;
133 SRC_DIR=$8;
134 shift
135 REMOVE_SRC_TMP=$8;
136 export PRODUCT="GHS3DPRLPLUGIN_${VERSION}"
137 export PRODUCT_SRC="GHS3DPRLPLUGIN_SRC_${VERSION}"
138 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
139 export PRODUCT_SRC_DIR=${INSTALL_ROOT}/${PRODUCT_SRC}
140 source ./common.sh
141 $PROCEDURE