]> SALOME platform Git repositories - tools/install.git/blob - config_files/omniORB-4.0.5.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.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_bin()
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 if [ $PROCEDURE != "try_preinstalled" ] && [ -w ${PRODUCT_DIR} ] ; then
53     cat > ${PRODUCT_DIR}/.omniORB.cfg <<EOF
54 InitRef = NameService=corbaname::`hostname`:2810
55 EOF
56 fi
57 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
58 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
59 }
60
61 print_env_src()
62 {
63 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
64 #$DELIM ${PRODUCT_TYPE}_src $DELIM
65 # nothing to do
66 ##
67 EOF
68 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
69 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
70 }
71
72 try_preinstalled(){
73 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
74 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
75 return $?
76 }
77
78 install_source()
79 {
80 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
81 source ${INSTALL_WORK}/$SHRC
82
83 makedir ${PRODUCT_DIR}_SRC
84 # unpack
85 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}_SRC
86 check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.5.tar.gz -C ${PRODUCT_DIR}_SRC
87 check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${PRODUCT_DIR}_SRC
88
89 # to generate environment scripts
90 try_preinstalled
91 }
92
93 install_source_and_build()
94 {
95 # install sources
96 install_source
97
98 # build sources
99 makedir ${PRODUCT_DIR}
100 # install omniORB
101 cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
102 mkdir build
103 cd build
104
105 check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORB.LOG \
106     ../configure --prefix=${PRODUCT_DIR}
107
108 GCC=`which gcc`
109 cat >> ${PRODUCT_DIR}/MAKE_OMNIORB.LOG <<EOF
110 used gcc=$GCC
111 EOF
112 check_job ${PRODUCT_DIR}/MAKE_OMNIORB.LOG make
113 check_job ${PRODUCT_DIR}/INSTALL_OMNIORB.LOG make install
114
115 # install omniORBpy
116 cd ${PRODUCT_DIR}_SRC/omniORBpy-2.5_SRC
117 mkdir build
118 cd build
119
120 check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORBPY.LOG \
121     ../configure --prefix=${PRODUCT_DIR}
122
123 GCC=`which gcc`
124 cat >> ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG <<EOF
125 used gcc=$GCC
126 EOF
127 check_job ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG make
128 check_job ${PRODUCT_DIR}/INSTALL_OMNIORBPY.LOG make install
129
130 # install omniNotify
131 cd ${PRODUCT_DIR}_SRC/omniNotify-2.1_SRC
132 mkdir build
133 cd build
134
135 check_job ${PRODUCT_DIR}/CONFIGURE_OMNINOTIFY.LOG \
136     ../configure --prefix=${PRODUCT_DIR}
137
138 GCC=`which gcc`
139 cat >> ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG <<EOF
140 used gcc=$GCC
141 EOF
142 check_job ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG make
143 check_job ${PRODUCT_DIR}/INSTALL_OMNINOTIFY.LOG make install
144
145 cd ${PRODUCT_DIR}/bin
146 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidl > _omniidl
147 mv -f _omniidl omniidl
148 chmod a+x omniidl
149 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidlrun.py > _omniidlrun.py
150 mv -f _omniidlrun.py omniidlrun.py
151 chmod a+x omniidlrun.py
152
153 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
154 cd ${PRODUCT_DIR}
155
156 # remove sources and temporary files after building
157 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
158     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
159 fi
160
161 # to generate environment scripts
162 try_preinstalled
163 }
164
165 install_binary()
166 {
167 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
168 source ${INSTALL_WORK}/$SHRC
169
170 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
171
172 ln -sf ${PRODUCT_DIR} ${INSTALL_ROOT}/omni
173
174 cd ${PRODUCT_DIR}/bin
175 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidl > _omniidl
176 mv -f _omniidl omniidl
177 chmod a+x omniidl
178 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidlrun.py > _omniidlrun.py
179 mv -f _omniidlrun.py omniidlrun.py
180 chmod a+x omniidlrun.py
181
182 # to generate environment script for sources
183 try_preinstalled
184 }
185
186 export PROCEDURE=$1;
187 export INSTALL_WORK=$2;
188 export SOURCE_DIR=$3;
189 export INSTALL_ROOT=$4;
190 export PRODUCT_SEQUENCE=$5;
191 export PRODUCT_TYPE=$6;
192 export INSTALL_PRODUCTS=$7;
193 shift
194 REMOVE_SRC_TMP=$8;
195 export PRODUCT="omniORB-4.0.5"
196 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
197 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
198 source ./common.sh
199 $PROCEDURE