]> SALOME platform Git repositories - tools/install.git/blob - config_files/omniORB-4.1.0.sh
Salome HOME
Add path to common libs into 'LD_LIBRARY_PATH'
[tools/install.git] / config_files / omniORB-4.1.0.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : omniORB-4.1.0.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.1.0 ${OMNIORBDIR}/lib
23 if [ "$?" -ne "0" ]; then
24    return 1
25 fi
26 check_lib_version _omnipymodule.so.3.0 ${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-3.0.tar.gz -C ${PRODUCT_DIR}_SRC
92 check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${PRODUCT_DIR}_SRC
93
94 # to generate environment scripts
95 try_preinstalled
96 }
97
98 install_source_and_build()
99 {
100 # install sources
101 install_source
102
103 # build sources
104 makedir ${PRODUCT_DIR}
105 # install omniORB
106 cd ${PRODUCT_DIR}_SRC/omniORB-4.1.0_SRC
107 mkdir build
108 cd build
109
110 if [ -e /etc/redhat-release ] ; then
111     grep -e "Red Hat" /etc/redhat-release > /dev/null
112     if [ $? == 0 ] ; then is_redhat=1 ; fi
113 fi
114
115 if [ "X$is_redhat" == "X1" ] ; then
116     check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORB.LOG ../configure --prefix=${PRODUCT_DIR} --disable-ipv6
117 else
118     check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORB.LOG ../configure --prefix=${PRODUCT_DIR}
119 fi
120
121 GCC=`which gcc`
122 cat >> ${PRODUCT_DIR}/MAKE_OMNIORB.LOG <<EOF
123 used gcc=$GCC
124 EOF
125 check_job ${PRODUCT_DIR}/MAKE_OMNIORB.LOG make
126 check_job ${PRODUCT_DIR}/INSTALL_OMNIORB.LOG make install
127
128 if test `uname -m` = "x86_64" ; then
129 cd ${PRODUCT_DIR}/lib; ln -s ../lib64/python2.4 .
130 fi
131
132 # install omniORBpy
133 cd ${PRODUCT_DIR}_SRC/omniORBpy-3.0_SRC
134 mkdir build
135 cd build
136
137 check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORBPY.LOG \
138     ../configure --prefix=${PRODUCT_DIR}
139
140 GCC=`which gcc`
141 cat >> ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG <<EOF
142 used gcc=$GCC
143 EOF
144 check_job ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG make
145 check_job ${PRODUCT_DIR}/INSTALL_OMNIORBPY.LOG make install
146
147 # install omniNotify
148 cd ${PRODUCT_DIR}_SRC/omniNotify-2.1_SRC
149
150 mkdir build
151 cd build
152
153 check_job ${PRODUCT_DIR}/CONFIGURE_OMNINOTIFY.LOG \
154     ../configure --prefix=${PRODUCT_DIR}
155
156 GCC=`which gcc`
157 cat >> ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG <<EOF
158 used gcc=$GCC
159 EOF
160 check_job ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG make
161 check_job ${PRODUCT_DIR}/INSTALL_OMNINOTIFY.LOG make install
162
163 cd ${PRODUCT_DIR}/bin
164 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidl > _omniidl
165 mv -f _omniidl omniidl
166 chmod a+x omniidl
167 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidlrun.py > _omniidlrun.py
168 mv -f _omniidlrun.py omniidlrun.py
169 chmod a+x omniidlrun.py
170
171 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
172 cd ${PRODUCT_DIR}
173
174 # remove sources and temporary files after building
175 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
176     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
177 fi
178
179 # to generate environment scripts
180 try_preinstalled
181 }
182
183 install_binary()
184 {
185 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
186 source ${INSTALL_WORK}/$SHRC
187
188 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
189
190 ln -sf ${PRODUCT_DIR} ${INSTALL_ROOT}/omni
191
192 cd ${PRODUCT_DIR}/bin
193 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidl > _omniidl
194 mv -f _omniidl omniidl
195 chmod a+x omniidl
196 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidlrun.py > _omniidlrun.py
197 mv -f _omniidlrun.py omniidlrun.py
198 chmod a+x omniidlrun.py
199
200 # to generate environment script for sources
201 try_preinstalled
202 }
203
204 export PROCEDURE=$1;
205 export INSTALL_WORK=$2;
206 export SOURCE_DIR=$3;
207 export INSTALL_ROOT=$4;
208 export PRODUCT_SEQUENCE=$5;
209 export PRODUCT_TYPE=$6;
210 export INSTALL_PRODUCTS=$7;
211 shift
212 REMOVE_SRC_TMP=$8;
213 export PRODUCT="omniORB-4.1.0"
214 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
215 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
216 source ./common.sh
217 $PROCEDURE