]> SALOME platform Git repositories - tools/install.git/blob - config_files/KERNEL_BIN.sh
Salome HOME
Remove HappyDoc dependencies
[tools/install.git] / config_files / KERNEL_BIN.sh
1 #!/bin/sh
2
3 check_version(){
4 if [ -n "${KERNEL_ROOT_DIR}" ]; then
5     check_lib_version VERSION ${KERNEL_ROOT_DIR}/bin/salome
6     if [ "$?" -eq "0" ]; then
7         ver=`cat ${KERNEL_ROOT_DIR}/bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]' ` 
8         if [ "$ver" = "3.2.0b1" ]; then
9             return 0
10         fi
11     fi
12 fi
13 return 1
14 }
15
16 print_env(){
17 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
18 #$DELIM ${PRODUCT_TYPE} $DELIM
19 export KERNEL_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
20 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
21   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
22     export PATH=\${KERNEL_ROOT_DIR}/bin/salome:\${PATH}
23     export LD_LIBRARY_PATH=\${KERNEL_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
24     export PYTHONPATH=\${KERNEL_ROOT_DIR}/bin/salome:\${KERNEL_ROOT_DIR}/lib/salome:\${KERNEL_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
25   fi
26 fi
27 ##
28 EOF
29 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
30 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
31 }
32
33 # looks for the native product and collects it's environment (used by make_env())
34 try_native(){
35 check_version
36 if [ $? -eq 0 ] ; then
37     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
38 #$DELIM ${PRODUCT_TYPE} $DELIM
39 export KERNEL_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
40 if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
41   if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
42     export PATH=\${KERNEL_ROOT_DIR}/bin/salome:\${PATH}
43     export LD_LIBRARY_PATH=\${KERNEL_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
44     export PYTHONPATH=\${KERNEL_ROOT_DIR}/bin/salome:\${KERNEL_ROOT_DIR}/lib/salome:\${KERNEL_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
45   fi
46 fi
47 ##
48 EOF
49     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
50     return 0
51 fi
52 return 1;
53 }
54
55 try_preinstalled(){
56 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
57 return $?
58 }
59
60 install_source()
61 {
62 return 1
63 }
64
65 install_binary()
66 {
67 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
68 source ${INSTALL_WORK}/$SHRC
69
70 check_jb tar xfz ${SOURCE_DIR}/KERNELbinariesV3.2.0b1.tar.gz -C ${INSTALL_ROOT}
71
72 # The next two symbolic links are created only for Red Hat 9 and Scientific Linux 3.0.5
73 if [ -f /lib/libcrypto.so.0.9.7a ]; then
74     ln -sf /lib/libcrypto.so.0.9.7a ${PRODUCT_DIR}/lib/salome/libcrypto.so.2
75 fi
76 if [ -f /lib/libssl.so.0.9.7a ]; then
77     ln -sf /lib/libssl.so.0.9.7a ${PRODUCT_DIR}/lib/salome/libssl.so.2
78 fi
79
80 # modify all *.la files
81 export KERNEL_ROOT_DIR=${PRODUCT_DIR}
82 modif_la_files ${PRODUCT_DIR}
83
84 print_env
85 }
86
87 pickup_env()
88 {
89 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE} ${PRODUCT_DIR}
90 cd ${PRODUCT_DIR}
91 version=`cat bin/salome/VERSION | awk -F: '{print $2}' | tr -d '[:space:]'`
92 dir="${HOME}/salome_appli_$version"
93 bin/salome/createAppli.sh $dir
94 rm -rf mkdir $dir/env.d/*.sh
95 cp -f ${PRODUCT_DIR}/salome.sh $dir/env.d
96 }
97
98 export PROCEDURE=$1;
99 export INSTALL_WORK=$2;
100 export SOURCE_DIR=$3;
101 export INSTALL_ROOT=$4;
102 export PRODUCT_SEQUENCE=$5;
103 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="KernelBin" ; fi
104 export PRODUCT="KERNEL_3.2.0b1"
105 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
106 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
107 source ./common.sh
108 $PROCEDURE