]> SALOME platform Git repositories - tools/install.git/blob - config_files/omniORB-4.0.6.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.6.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : omniORB-4.0.6.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 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
85 # unpack
86 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}_SRC
87 check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.6.tar.gz -C ${PRODUCT_DIR}_SRC
88 check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${PRODUCT_DIR}_SRC
89
90 # to generate environment scripts
91 try_preinstalled
92 }
93
94 install_source_and_build()
95 {
96 # install sources
97 install_source
98
99 # build sources
100 makedir ${PRODUCT_DIR}
101 # install omniORB
102 cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
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 ${PRODUCT_DIR}_SRC/omniORBpy-2.6_SRC
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 ${PRODUCT_DIR}_SRC/omniNotify_SRC
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_DIR}_SRC > ${PRODUCT_DIR}/size.log
155 cd ${PRODUCT_DIR}
156
157 # remove sources and temporary files after building
158 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
159     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
160 fi
161
162 # to generate environment scripts
163 try_preinstalled
164 }
165
166 install_binary()
167 {
168 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
169 source ${INSTALL_WORK}/$SHRC
170
171 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
172
173 ln -sf ${PRODUCT_DIR} ${INSTALL_ROOT}/omni
174
175 cd ${PRODUCT_DIR}/bin
176 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidl > _omniidl
177 mv -f _omniidl omniidl
178 chmod a+x omniidl
179 sed -e "s%#\!.*python%#\!/usr/bin/env python%" omniidlrun.py > _omniidlrun.py
180 mv -f _omniidlrun.py omniidlrun.py
181 chmod a+x omniidlrun.py
182
183 # to generate environment script for sources
184 try_preinstalled
185 }
186
187 export PROCEDURE=$1;
188 export INSTALL_WORK=$2;
189 export SOURCE_DIR=$3;
190 export INSTALL_ROOT=$4;
191 export PRODUCT_SEQUENCE=$5;
192 export PRODUCT_TYPE=$6;
193 export INSTALL_PRODUCTS=$7;
194 shift
195 REMOVE_SRC_TMP=$8;
196 export PRODUCT="omniORB-4.0.6"
197 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
198 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
199 source ./common.sh
200 $PROCEDURE