3 ####################################################################################
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 "${MED_ROOT_DIR}" ]; then
19 check_lib_version VERSION ${MED_ROOT_DIR}/bin/salome
20 if [ "$?" -eq "0" ]; then
21 ver=`cat ${MED_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' `
22 if [ "$ver" = "${VERSION}" ]; then
26 elif [ -n "${MED_SRC_DIR}" ]; then
27 if [ -f ${MED_SRC_DIR}/configure.in.base ]; then
28 ver=`grep -E "^VERSION=" ${MED_SRC_DIR}/configure.in.base | awk -F= '{print $NF}' | tr -d '[:space:]' `
29 if [ "$ver" = "${VERSION}" ]; then
38 if test `uname -m` = "x86_64" ; then
43 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
44 #$DELIM ${PRODUCT_TYPE} $DELIM
45 export MED_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
46 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
47 if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
48 export PATH=\${MED_ROOT_DIR}/bin/salome:\${PATH}
49 export LD_LIBRARY_PATH=\${MED_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
50 export PYTHONPATH=\${MED_ROOT_DIR}/bin/salome:\${MED_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${MED_ROOT_DIR}/lib${LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
55 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
56 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
60 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
61 #$DELIM ${PRODUCT_TYPE}_src $DELIM
62 export MED_SRC_DIR=\${INSTALL_ROOT}/${PRODUCT_SRC}
66 (test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
67 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
71 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
72 try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
78 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
79 source ${INSTALL_WORK}/$SHRC
81 check_jb tar xfz ${SOURCE_DIR}/MEDsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
83 # to generate environment scripts
87 install_source_and_build()
93 mkdir -p ${PRODUCT_DIR}
95 if [ -e ./build.sh ] ; then
96 cp -f ./build.sh ${INSTALL_ROOT}
101 if [ $MED_WITH_GUI == "FALSE" ] ; then
102 check_jb build.sh -o -b -w -d -v 0 -p $INSTALL_ROOT MED
104 check_jb build.sh -o -b -d -v 0 -p $INSTALL_ROOT MED
109 # remove sources and temporary files after building
110 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
111 test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
112 test -d ${INSTALL_ROOT}/"MED_BUILD" && rm -fr ${INSTALL_ROOT}/"MED_BUILD"
115 # to generate environment scripts
121 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
122 source ${INSTALL_WORK}/$SHRC
123 if [ $MED_WITH_GUI == "FALSE" ] ; then
124 check_jb tar xfz ${SOURCE_DIR}/MEDWOGUIbinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
126 check_jb tar xfz ${SOURCE_DIR}/MEDbinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
128 check_jb tar xfz ${SRC_DIR}/MEDsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
130 # modify all *.la files
131 export MED_ROOT_DIR=${PRODUCT_DIR}
132 modif_la_files ${PRODUCT_DIR}
134 # to generate environment scripts
139 export INSTALL_WORK=$2;
140 export SOURCE_DIR=$3;
141 export INSTALL_ROOT=$4;
142 export PRODUCT_SEQUENCE=$5;
143 export PRODUCT_TYPE=$6;
144 export INSTALL_PRODUCTS=$7;
148 if [ $# == 9 ] ; then MED_WITH_GUI="FALSE" ; else MED_WITH_GUI="TRUE" ; fi
149 export PRODUCT="MED_${VERSION}"
150 export PRODUCT_SRC="MED_SRC_${VERSION}"
151 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
152 export PRODUCT_SRC_DIR=${INSTALL_ROOT}/${PRODUCT_SRC}