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