--- /dev/null
+#!/bin/sh
+
+check_version(){
+if [ -n "${CALCULATOR_ROOT_DIR}" ]; then
+ check_lib_version VERSION ${CALCULATOR_ROOT_DIR}/bin/salome
+ if [ "$?" -eq "0" ]; then
+ ver=`cat ${CALCULATOR_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' `
+ if [ "$ver" = "2.2.5" ]; then
+ return 0
+ fi
+ fi
+fi
+return 1
+}
+
+print_env(){
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
+#$DELIM ${PRODUCT_TYPE} $DELIM
+export CALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
+ export PYTHONPATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${CALCULATOR_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
+##
+EOF
+(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+}
+
+# looks for the native product and collects it's environment (used by make_env())
+try_native(){
+check_version
+if [ $? -eq 0 ] ; then
+ cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
+#$DELIM ${PRODUCT_TYPE} $DELIM
+export CALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
+ export PYTHONPATH=\${CALCULATOR_ROOT_DIR}/bin/salome:\${CALCULATOR_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
+##
+EOF
+ make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+ return 0
+fi
+return 1;
+}
+
+try_preinstalled(){
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+return $?
+}
+
+install_source()
+{
+return 1
+}
+
+install_binary()
+{
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+check_jb tar xfz ${SOURCE_DIR}/CALCULATORbinariesV2.2.5.tar.gz -C ${INSTALL_ROOT}
+
+print_env
+}
+
+export PROCEDURE=$1;
+export INSTALL_WORK=$2;
+export SOURCE_DIR=$3;
+export INSTALL_ROOT=$4;
+export PRODUCT_SEQUENCE=$5;
+if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="CALCULATORBin" ; fi
+export PRODUCT="CALCULATOR_2.2.5"
+export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
+export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
+source ./common.sh
+$PROCEDURE
--- /dev/null
+#!/bin/sh
+
+check_version(){
+if [ -n "${CALCULATOR_SRC_DIR}" ]; then
+ check_lib_version VERSION ${CALCULATOR_SRC_DIR}/bin
+ if [ "$?" -eq "0" ]; then
+ ver=`cat ${CALCULATOR_SRC_DIR}/bin/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' `
+ if [ "$ver" = "2.2.5" ]; then
+ return 0
+ fi
+ fi
+fi
+return 1
+}
+
+print_env(){
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
+#$DELIM ${PRODUCT_TYPE} $DELIM
+export CALCULATOR_SRC_DIR=\${INSTALL_ROOT}/${PRODUCT}
+##
+EOF
+(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+}
+
+# looks for the native product and collects it's environment (used by make_env())
+try_native(){
+check_version
+if [ $? -eq 0 ] ; then
+ cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
+#$DELIM ${PRODUCT_TYPE} $DELIM
+export CALCULATOR_SRC_DIR=${CALCULATOR_SRC_DIR}
+##
+EOF
+ make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+ return 0
+fi
+return 1;
+}
+
+try_preinstalled(){
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+return $?
+}
+
+install_source()
+{
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+check_jb tar xfz ${SOURCE_DIR}/CALCULATORsourcesV2.2.5.tar.gz -C ${INSTALL_ROOT}
+
+print_env
+}
+
+install_binary()
+{
+return 1
+}
+
+export PROCEDURE=$1;
+export INSTALL_WORK=$2;
+export SOURCE_DIR=$3;
+export INSTALL_ROOT=$4;
+export PRODUCT_SEQUENCE=$5;
+if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="CALCULATORSrc" ; fi
+export PRODUCT="CALCULATOR_SRC_2.2.5"
+export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
+export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
+source ./common.sh
+$PROCEDURE