]> SALOME platform Git repositories - tools/install.git/blob - config_files/omniORB-4.0.5.sh
Salome HOME
Update for Salome 3.2.6
[tools/install.git] / config_files / omniORB-4.0.5.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : omniORB-4.0.5.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.5 ${OMNIORBDIR}/lib
23 if [ "$?" -ne "0" ]; then
24    return 1
25 fi
26 check_lib_version _omnipymodule.so.2.4 ${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()
42 {
43 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
44 #$DELIM ${PRODUCT_TYPE} $DELIM
45 export OMNIORBDIR=\${INSTALL_ROOT}/${PRODUCT}
46 export OMNIORB_CONFIG=\${OMNIORBDIR}/.omniORB.cfg
47 export PYTHONPATH=\${OMNIORBDIR}/lib:\${OMNIORBDIR}/lib/python\${PYTHON_VERSION}/site-packages:\${PYTHONPATH}
48 export PATH=\$OMNIORBDIR/bin:\$PATH
49 export LD_LIBRARY_PATH=\$OMNIORBDIR/lib:\$LD_LIBRARY_PATH 
50 ##
51 EOF
52 cat > ${PRODUCT_DIR}/.omniORB.cfg <<EOF
53 InitRef = NameService=corbaname::`hostname`:2810
54 EOF
55 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
56 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
57 }
58
59 # looks for the native product and collects it's environment (used by make_env())
60 try_native(){
61 check_version
62 if [ $? -eq 0 ] ; then
63     python_version="`python -c 'import sys; print sys.version[:3]'`"
64     tmp="\${OMNIORBDIR}/bin ${OMNIORBDIR}/bin \${PATH} ${PATH}";  
65     path=`sort_path ${tmp}`
66     tmp="\${OMNIORBDIR}/lib ${OMNIORBDIR}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
67     ld_library_path=`sort_path ${tmp}`
68     tmp="\${OMNIORBDIR}/lib:\${OMNIORBDIR}/lib/python\${PYTHON_VERSION}/site-packages ${OMNIORBDIR}/lib:${OMNIORBDIR}/lib/python${python_version}/site-packages \${PYTHONPATH} ${PYTHONPATH}";  
69     pythonpath=`sort_path ${tmp}`
70     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
71 #$DELIM ${PRODUCT_TYPE} $DELIM
72 export OMNIORBDIR=${OMNIORBDIR}
73 export OMNIORB_CONFIG=\${OMNIORBDIR}/.omniORB.cfg
74 export PYTHONPATH=${pythonpath}
75 export PATH=${path}
76 export LD_LIBRARY_PATH=${ld_library_path}
77 ##
78 EOF
79     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
80     return 0
81 fi
82 return 1;
83 }
84
85 try_preinstalled(){
86 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
87 return $?
88 }
89
90 install_source()
91 {
92 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
93 source ${INSTALL_WORK}/$SHRC
94
95 makedir ${PRODUCT_DIR}
96
97 check_jb tar xfz ${SOURCE_DIR}/omniORB-4.0.5.tar.gz -C ${INSTALL_WORK}
98 check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.5.tar.gz -C ${INSTALL_WORK}
99 check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${INSTALL_WORK}
100
101 # install omniORB
102 cd ${INSTALL_WORK}/omniORB-4.0.5
103 mkdir build
104 cd build
105
106 check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORB.LOG \
107     ../configure --prefix=${PRODUCT_DIR}
108
109 GCC=`which gcc`
110 cat >> ${PRODUCT_DIR}/MAKE_OMNIORB.LOG <<EOF
111 used gcc=$GCC
112 EOF
113 check_job ${PRODUCT_DIR}/MAKE_OMNIORB.LOG make
114 check_job ${PRODUCT_DIR}/INSTALL_OMNIORB.LOG make install
115
116 # install omniORBpy
117 cd ${INSTALL_WORK}/omniORBpy-2.5
118 mkdir build
119 cd build
120
121 check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORBPY.LOG \
122     ../configure --prefix=${PRODUCT_DIR}
123
124 GCC=`which gcc`
125 cat >> ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG <<EOF
126 used gcc=$GCC
127 EOF
128 check_job ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG make
129 check_job ${PRODUCT_DIR}/INSTALL_OMNIORBPY.LOG make install
130
131 # install omniNotify
132 cd ${INSTALL_WORK}/omniNotify
133 mkdir build
134 cd build
135
136 check_job ${PRODUCT_DIR}/CONFIGURE_OMNINOTIFY.LOG \
137     ../configure --prefix=${PRODUCT_DIR}
138
139 GCC=`which gcc`
140 cat >> ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG <<EOF
141 used gcc=$GCC
142 EOF
143 check_job ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG make
144 check_job ${PRODUCT_DIR}/INSTALL_OMNINOTIFY.LOG make install
145
146 cd ${PRODUCT_DIR}/bin
147 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidl > _omniidl
148 mv -f _omniidl omniidl
149 chmod a+x omniidl
150 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidlrun.py > _omniidlrun.py
151 mv -f _omniidlrun.py omniidlrun.py
152 chmod a+x omniidlrun.py
153
154 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
155 cd ${PRODUCT_DIR}
156 rm -fr ${INSTALL_WORK}/omniORB-4.0.5
157 rm -fr ${INSTALL_WORK}/omniORBpy-2.5
158 rm -fr ${INSTALL_WORK}/omniNotify
159 print_env
160 }
161
162 install_binary()
163 {
164 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
165 source ${INSTALL_WORK}/$SHRC
166
167 check_jb tar xfz ${SOURCE_DIR}/omniORB-4.0.5.tar.gz -C ${INSTALL_ROOT}
168
169 ln -sf ${PRODUCT_DIR} ${INSTALL_ROOT}/omni
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 print_env
180 }
181
182 export PROCEDURE=$1;
183 export INSTALL_WORK=$2;
184 export SOURCE_DIR=$3;
185 export INSTALL_ROOT=$4;
186 export PRODUCT_SEQUENCE=$5;
187 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="omni" ; fi
188 export PRODUCT="omniORB-4.0.5"
189 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
190 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
191 source ./common.sh
192 $PROCEDURE