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 if [ -f ${CALCULATOR_SRC_DIR}/configure.in.base ]; then
28 ver=`grep -E "^VERSION=" ${CALCULATOR_SRC_DIR}/configure.in.base | awk -F= '{print $NF}' | tr -d '[:space:]' `
29 if [ "$ver" = "${VERSION}" ]; then
39 if test `uname -m` = "x86_64" ; then
45 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
46 #$DELIM ${PRODUCT_TYPE} $DELIM
47 export CALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
48 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
49 if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
50 export PATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
51 export LD_LIBRARY_PATH=\${CALCULATOR_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
52 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}
57 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
58 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
62 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
63 #$DELIM ${PRODUCT_TYPE}_src $DELIM
64 export CALCULATOR_SRC_DIR=\${INSTALL_ROOT}/${PRODUCT_SRC}
68 (test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
69 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
73 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
74 try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
80 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
81 source ${INSTALL_WORK}/$SHRC
83 check_jb tar xfz ${SOURCE_DIR}/CALCULATORsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
85 # to generate environment scripts
89 install_source_and_build()
95 mkdir -p ${PRODUCT_DIR}
97 if [ -e ./build.sh ] ; then
98 cp -f ./build.sh ${INSTALL_ROOT}
103 check_jb build.sh -o -b -d -v 0 -p $INSTALL_ROOT CALCULATOR
107 # remove sources and temporary files after building
108 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
109 test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
110 test -d ${INSTALL_ROOT}/"CALCULATOR_BUILD" && rm -fr ${INSTALL_ROOT}/"CALCULATOR_BUILD"
113 # to generate environment scripts
119 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
120 source ${INSTALL_WORK}/$SHRC
122 check_jb tar xfz ${SOURCE_DIR}/CALCULATORbinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
123 check_jb tar xfz ${SRC_DIR}/CALCULATORsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
125 # modify all *.la files
126 export CALCULATOR_ROOT_DIR=${PRODUCT_DIR}
127 modif_la_files ${PRODUCT_DIR}
129 cd ${PRODUCT_DIR}/bin/salome
130 sed -e "s%export KERNEL_ROOT_DIR=.*%export KERNEL_ROOT_DIR=${KERNEL_ROOT_DIR}%g" runAppli > _runAppli
131 sed -e "s%export CALCULATOR_ROOT_DIR=.*%export CALCULATOR_ROOT_DIR=${CALCULATOR_ROOT_DIR}%g" _runAppli > runAppli
135 # to generate environment scripts
140 export INSTALL_WORK=$2;
141 export SOURCE_DIR=$3;
142 export INSTALL_ROOT=$4;
143 export PRODUCT_SEQUENCE=$5;
144 export PRODUCT_TYPE=$6;
145 export INSTALL_PRODUCTS=$7;
149 export PRODUCT="CALCULATOR_${VERSION}"
150 export PRODUCT_SRC="CALCULATOR_SRC_${VERSION}"
151 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
152 export PRODUCT_SRC_DIR=${INSTALL_ROOT}/${PRODUCT_SRC}