]> SALOME platform Git repositories - tools/install.git/blob - config_files/omniORB-4.0.7.sh
Salome HOME
1) remove required size calculations for each product: just read its from XML and...
[tools/install.git] / config_files / omniORB-4.0.7.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : omniORB-4.0.7.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 {
17 if [ -z "${OMNIORBDIR}" ]; then
18    #echo "OMNIORBDIR doesn't set"
19    return 1
20 fi
21 python_version="`python -c 'import sys; print sys.version[:3]'`"
22 check_lib_version libomniORB4.so.0.6 ${OMNIORBDIR}/lib
23 if [ "$?" -ne "0" ]; then
24    return 1
25 fi
26 check_lib_version _omnipymodule.so.2.6 ${OMNIORBDIR}/lib/python${python_version}/site-packages
27 if [ "$?" -ne "0" ]; then
28    return 1
29 fi
30 check_lib_version libCOSNotify4.so.0.1 ${OMNIORBDIR}/lib
31 if [ "$?" -ne "0" ]; then
32    return 1
33 fi
34 check_lib_version notifd ${OMNIORBDIR}/bin
35 if [ "$?" -ne "0" ]; then
36    return 1
37 fi
38 return 0
39 }
40
41 print_env_bin()
42 {
43
44 if test `uname -m` = "x86_64" ; then
45 export OMNI_LIB_PREFIX="64"
46 fi
47
48 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
49 #$DELIM ${PRODUCT_TYPE} $DELIM
50 export OMNIORBDIR=\${INSTALL_ROOT}/${PRODUCT}
51 export OMNIORB_CONFIG=\${OMNIORBDIR}/.omniORB.cfg
52 export PYTHONPATH=\${OMNIORBDIR}/lib${OMNI_LIB_PREFIX}:\${OMNIORBDIR}/lib${OMNI_LIB_PREFIX}/python\${PYTHON_VERSION}/site-packages:\${PYTHONPATH}
53 export PATH=\$OMNIORBDIR/bin:\$PATH
54 export LD_LIBRARY_PATH=\$OMNIORBDIR/lib:\$LD_LIBRARY_PATH 
55 ##
56 EOF
57 if [ $PROCEDURE != "try_preinstalled" ] && [ -w ${PRODUCT_DIR} ] ; then
58     cat > ${PRODUCT_DIR}/.omniORB.cfg <<EOF
59 InitRef = NameService=corbaname::`hostname`:2810
60 EOF
61 fi
62 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
63 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
64 }
65
66 print_env_src()
67 {
68 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
69 #$DELIM ${PRODUCT_TYPE}_src $DELIM
70 # nothing to do
71 ##
72 EOF
73 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
74 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
75 }
76
77 try_preinstalled(){
78 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
79 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
80 return $?
81 }
82
83 install_source()
84 {
85 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
86 source ${INSTALL_WORK}/$SHRC
87
88 makedir ${PRODUCT_DIR}_SRC
89 # unpack
90 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}_SRC
91 check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.7.tar.gz -C ${PRODUCT_DIR}_SRC
92 check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${PRODUCT_DIR}_SRC
93
94 # apply patches for 64-bit platforms
95 if test `uname -m` = "x86_64" ; then
96     if [ -f patches/omniORB-4.0.7-lib64.patch ] ; then
97         cp patches/omniORB-4.0.7-lib64.patch ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
98         ( cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC ; patch -p1 < omniORB-4.0.7-lib64.patch )
99     fi
100     if [ -f patches/omniORBpy-2.7-lib64.patch ] ; then
101         cp patches/omniORBpy-2.7-lib64.patch ${PRODUCT_DIR}_SRC/omniORBpy-2.7_SRC
102         ( cd ${PRODUCT_DIR}_SRC/omniORBpy-2.7_SRC ; patch -p1 < omniORBpy-2.7-lib64.patch )
103     fi
104     if [ -f patches/omniNotify-2.1-lib64.patch ] ; then
105         cp patches/omniNotify-2.1-lib64.patch ${PRODUCT_DIR}_SRC/omniNotify-2.1_SRC
106         ( cd ${PRODUCT_DIR}_SRC/omniNotify-2.1_SRC ; patch -p1 < omniNotify-2.1-lib64.patch )
107     fi
108 fi
109
110 # to generate environment scripts
111 try_preinstalled
112 }
113
114 install_source_and_build()
115 {
116 # install sources
117 install_source
118
119 # build sources
120 makedir ${PRODUCT_DIR}
121 # install omniORB
122 cd ${PRODUCT_DIR}_SRC/omniORB-4.0.7_SRC
123 mkdir build
124 cd build
125
126 check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORB.LOG \
127     ../configure --prefix=${PRODUCT_DIR}
128
129 GCC=`which gcc`
130 cat >> ${PRODUCT_DIR}/MAKE_OMNIORB.LOG <<EOF
131 used gcc=$GCC
132 EOF
133 check_job ${PRODUCT_DIR}/MAKE_OMNIORB.LOG make
134 check_job ${PRODUCT_DIR}/INSTALL_OMNIORB.LOG make install
135
136 if test `uname -m` = "x86_64" ; then
137 cd ${PRODUCT_DIR}/lib; ln -s ../lib64/python2.4 .
138 fi
139
140 # install omniORBpy
141 cd ${PRODUCT_DIR}_SRC/omniORBpy-2.7_SRC
142 mkdir build
143 cd build
144
145 check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORBPY.LOG \
146     ../configure --prefix=${PRODUCT_DIR}
147
148 GCC=`which gcc`
149 cat >> ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG <<EOF
150 used gcc=$GCC
151 EOF
152 check_job ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG make
153 check_job ${PRODUCT_DIR}/INSTALL_OMNIORBPY.LOG make install
154
155 # install omniNotify
156 cd ${PRODUCT_DIR}_SRC/omniNotify-2.1_SRC
157
158 mkdir build
159 cd build
160
161 check_job ${PRODUCT_DIR}/CONFIGURE_OMNINOTIFY.LOG \
162     ../configure --prefix=${PRODUCT_DIR}
163
164 GCC=`which gcc`
165 cat >> ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG <<EOF
166 used gcc=$GCC
167 EOF
168 check_job ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG make
169 check_job ${PRODUCT_DIR}/INSTALL_OMNINOTIFY.LOG make install
170
171 cd ${PRODUCT_DIR}/bin
172 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidl > _omniidl
173 mv -f _omniidl omniidl
174 chmod a+x omniidl
175 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidlrun.py > _omniidlrun.py
176 mv -f _omniidlrun.py omniidlrun.py
177 chmod a+x omniidlrun.py
178
179 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
180 cd ${PRODUCT_DIR}
181
182 # remove sources and temporary files after building
183 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
184     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
185 fi
186
187 # to generate environment scripts
188 try_preinstalled
189 }
190
191 install_binary()
192 {
193 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
194 source ${INSTALL_WORK}/$SHRC
195
196 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
197
198 ln -sf ${PRODUCT_DIR} ${INSTALL_ROOT}/omni
199
200 cd ${PRODUCT_DIR}/bin
201 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidl > _omniidl
202 mv -f _omniidl omniidl
203 chmod a+x omniidl
204 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidlrun.py > _omniidlrun.py
205 mv -f _omniidlrun.py omniidlrun.py
206 chmod a+x omniidlrun.py
207
208 # to generate environment script for sources
209 try_preinstalled
210 }
211
212 export PROCEDURE=$1;
213 export INSTALL_WORK=$2;
214 export SOURCE_DIR=$3;
215 export INSTALL_ROOT=$4;
216 export PRODUCT_SEQUENCE=$5;
217 export PRODUCT_TYPE=$6;
218 export INSTALL_PRODUCTS=$7;
219 shift
220 REMOVE_SRC_TMP=$8;
221 export PRODUCT="omniORB-4.0.7"
222 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
223 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
224 source ./common.sh
225 $PROCEDURE