3 ####################################################################################
4 # File : CALCULATOR_BIN.sh
5 # Created : Thu Dec 18 12:01:00 2002
6 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 # Module : Installation Wizard
9 # Copyright : 2002-2007 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
18 if [ -n "${CALCULATOR_ROOT_DIR}" ]; then
19 check_lib_version VERSION ${CALCULATOR_ROOT_DIR}/bin/salome
20 if [ "$?" -eq "0" ]; then
21 ver=`cat ${CALCULATOR_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' `
22 if [ "$ver" = "${VERSION}" ]; then
26 elif [ -n "${CALCULATOR_SRC_DIR}" ]; then
27 check_salome_src_version CALCULATOR_SRC_DIR $VERSION
28 if [ $? -eq 0 ] ; then return 0 ; fi
36 if test `uname -m` = "x86_64" ; then
42 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
43 #$DELIM ${PRODUCT_TYPE} $DELIM
44 export CALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
45 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
46 if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
47 export PATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
48 export LD_LIBRARY_PATH=\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
49 export PYTHONPATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
54 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
55 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
59 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
60 #$DELIM ${PRODUCT_TYPE}_src $DELIM
61 export CALCULATOR_SRC_DIR=\${INSTALL_ROOT}/${PRODUCT_SRC}
65 (test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
66 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
70 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
71 try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
77 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
78 source ${INSTALL_WORK}/$SHRC
80 check_jb tar xfz ${SOURCE_DIR}/CALCULATORsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
82 # to generate environment scripts
86 install_source_and_build()
92 mkdir -p ${PRODUCT_DIR}
94 if [ -e ./build.sh ] ; then
95 cp -f ./build.sh ${INSTALL_ROOT}
100 check_jb build.sh -o -b -d -v 0 -p $INSTALL_ROOT CALCULATOR
104 # remove sources and temporary files after building
105 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
106 test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
107 test -d ${INSTALL_ROOT}/"CALCULATOR_BUILD" && rm -fr ${INSTALL_ROOT}/"CALCULATOR_BUILD"
110 # to generate environment scripts
116 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
117 source ${INSTALL_WORK}/$SHRC
119 check_jb tar xfz ${SOURCE_DIR}/CALCULATORbinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
120 check_jb tar xfz ${SRC_DIR}/CALCULATORsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
122 # modify all *.la files
123 export CALCULATOR_ROOT_DIR=${PRODUCT_DIR}
124 modif_la_files ${PRODUCT_DIR}
126 cd ${PRODUCT_DIR}/bin/salome
127 sed -e "s%export KERNEL_ROOT_DIR=.*%export KERNEL_ROOT_DIR=${KERNEL_ROOT_DIR}%g" runAppli > _runAppli
128 sed -e "s%export CALCULATOR_ROOT_DIR=.*%export CALCULATOR_ROOT_DIR=${CALCULATOR_ROOT_DIR}%g" _runAppli > runAppli
132 # to generate environment scripts
137 export INSTALL_WORK=$2;
138 export SOURCE_DIR=$3;
139 export INSTALL_ROOT=$4;
140 export PRODUCT_SEQUENCE=$5;
141 export PRODUCT_TYPE=$6;
142 export INSTALL_PRODUCTS=$7;
146 export PRODUCT="CALCULATOR_${VERSION}"
147 export PRODUCT_SRC="CALCULATOR_SRC_${VERSION}"
148 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
149 export PRODUCT_SRC_DIR=${INSTALL_ROOT}/${PRODUCT_SRC}