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 "${KERNEL_ROOT_DIR}" ]; then
19 check_lib_version VERSION ${KERNEL_ROOT_DIR}/bin/salome
20 if [ "$?" -eq "0" ]; then
21 ver=`cat ${KERNEL_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' `
22 if [ "$ver" = "${VERSION}" ]; then
26 elif [ -n "${KERNEL_SRC_DIR}" ]; then
27 if [ -f ${KERNEL_SRC_DIR}/configure.ac ]; then
28 ver=`grep -E "^VERSION=" ${KERNEL_SRC_DIR}/configure.ac | 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 KERNEL_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
46 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
47 if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
48 export PATH=\${KERNEL_ROOT_DIR}/bin/salome:\${PATH}
49 export LD_LIBRARY_PATH=\${KERNEL_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${LD_LIBRARY_PATH}
50 export PYTHONPATH=\${KERNEL_ROOT_DIR}/bin/salome:\${KERNEL_ROOT_DIR}/lib${LIB_PREFIX}/salome:\${KERNEL_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 KERNEL_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}/KERNELsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
83 # to generate environment scripts
87 install_source_and_build()
89 # remove previously existing sources directory
90 if [ -f $PRODUCT_DIR ] ; then
98 mkdir -p ${PRODUCT_DIR}
100 if [ -e ./build.sh ] ; then
101 cp -f ./build.sh ${INSTALL_ROOT}
106 check_jb build.sh -o -c -d -v 0 -p $INSTALL_ROOT KERNEL
108 # create environment for the built binaries
111 # remove sources and temporary files after building
112 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
113 test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
114 test -d ${INSTALL_ROOT}/"KERNEL_BUILD" && rm -fr ${INSTALL_ROOT}/"KERNEL_BUILD"
117 # to generate environment scripts
123 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
124 source ${INSTALL_WORK}/$SHRC
126 check_jb tar xfz ${SOURCE_DIR}/KERNELbinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
127 check_jb tar xfz ${SRC_DIR}/KERNELsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
129 # The next two symbolic links are created only for Red Hat 9 and Scientific Linux 3.0.5
130 if [ -f /lib/libcrypto.so.0.9.7a ]; then
131 ln -sf /lib/libcrypto.so.0.9.7a ${PRODUCT_DIR}/lib/salome/libcrypto.so.2
133 if [ -f /lib/libssl.so.0.9.7a ]; then
134 ln -sf /lib/libssl.so.0.9.7a ${PRODUCT_DIR}/lib/salome/libssl.so.2
137 # modify all *.la files
138 export KERNEL_ROOT_DIR=${PRODUCT_DIR}
139 modif_la_files ${PRODUCT_DIR}
141 # to generate environment scripts
147 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} ${PRODUCT_DIR}
148 if [ -d ${PRODUCT_DIR} ] ; then
150 version=`cat bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]'`
151 dir="${HOME}/salome_appli_$version"
152 bin/salome/createAppli.sh $dir
153 rm -rf $dir/env.d/*.sh
154 cp -f ${PRODUCT_DIR}/salome.sh $dir/env.d
156 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src ${PRODUCT_SRC_DIR}
160 export INSTALL_WORK=$2;
161 export SOURCE_DIR=$3;
162 export INSTALL_ROOT=$4;
163 export PRODUCT_SEQUENCE=$5;
164 export PRODUCT_TYPE=$6;
165 export INSTALL_PRODUCTS=$7;
169 export PRODUCT="KERNEL_${VERSION}"
170 export PRODUCT_SRC="KERNEL_SRC_${VERSION}"
171 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
172 export PRODUCT_SRC_DIR=${INSTALL_ROOT}/${PRODUCT_SRC}