]> SALOME platform Git repositories - tools/install.git/blob - config_files/xdata-0.5.51.sh
Salome HOME
Add path to common libs into 'LD_LIBRARY_PATH'
[tools/install.git] / config_files / xdata-0.5.51.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : xdata-0.5.51.sh
5 #  Created   : Thu Dec 18 12:01:00 2002
6 #  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
7 #  Project   : SALOME
8 #  Module    : Installation Wizard
9 #  Copyright : 2002-2007 CEA
10 #
11 #  This script is the part of the SALOME installation procedure.
12 #
13 ####################################################################################
14
15 check_version(){
16 # No way to check version!
17 return 0
18 }
19
20 print_env_bin()
21 {
22 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
23 #$DELIM ${PRODUCT_TYPE} $DELIM 
24 export XDATAROOT=\${INSTALL_ROOT}/${PRODUCT}
25 export PATH=\${XDATAROOT}/bin:\${PATH}
26 export PYTHON_VERSION=\`python -c "import sys; print sys.version[:3]"\`
27 export PYTHONPATH=\${XDATAROOT}/lib${PYTHON_LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages/xdata:\${PYTHONPATH}
28 ##
29 EOF
30 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
31 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
32 }
33
34 print_env_src()
35 {
36 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
37 #$DELIM ${PRODUCT_TYPE}_src $DELIM
38 # nothing to do
39 ##
40 EOF
41 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
42 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
43 }
44
45 try_preinstalled(){
46 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
47 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
48 return $?
49 }
50
51 install_source()
52 {
53 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
54 source ${INSTALL_WORK}/$SHRC
55
56 check_jb tar xfz ${SRC_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
57
58 # to generate environment scripts
59 try_preinstalled
60 }
61
62 install_source_and_build()
63 {
64 # install sources
65 install_source
66
67 # build sources
68
69 cd ${PRODUCT_DIR}_SRC
70 makedir ${PRODUCT_DIR}
71
72 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
73   ./configure --prefix=${PRODUCT_DIR} 
74 GCC=`which gcc`
75 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
76 used gcc=$GCC
77 EOF
78 check_job ${PRODUCT_DIR}/MAKE.LOG make
79 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
80 check_job ${PRODUCT_DIR}/MAKECHECK.LOG make check 
81
82 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
83 cd ${PRODUCT_DIR};
84
85 # remove sources and temporary files after building
86 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
87     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
88 fi
89
90 # to generate environment scripts
91 try_preinstalled
92 }
93
94 install_binary()
95 {
96 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
97 source ${INSTALL_WORK}/$SHRC
98
99 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
100
101 # to generate environment scripts
102 try_preinstalled
103 }
104
105 export PROCEDURE=$1;
106 export INSTALL_WORK=$2;
107 export SOURCE_DIR=$3;
108 export INSTALL_ROOT=$4;
109 export PRODUCT_SEQUENCE=$5;
110 export PRODUCT_TYPE=$6;
111 export INSTALL_PRODUCTS=$7;
112 SRC_DIR=$8;
113 shift
114 REMOVE_SRC_TMP=$8;
115 export PRODUCT="xdata-0.5.51"
116 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
117 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
118 source ./common.sh
119 $PROCEDURE