3 # This script installs a subset of products necessary for SALOME application
5 # Usage: install <target-directory> [all]
6 # install <target-directory> <product> ... <product>
8 # Type 'install --help' to get more information
11 # <target-directory> must be an absolute path
13 # The script is the part of the SALOME PRO installation procedure.
15 # Copyright : 2003 CEA/DEN, EDF R&D
16 ####################################################################################
19 export SHRC="salome.sh"
20 export CSHRC="salome.csh"
22 #this function takes several parameters
23 #first parameter contains descriptor of output file
24 #next parameters is command for execution
25 #in case of bad result of execution ask user about furher steps
26 #(user can cancel installation procedure)
32 if [ -n "$INSTALL_WORK" ] ; then errfile=$INSTALL_WORK/errlog; fi
34 if [ "$out" != "1" ] ; then cmd="$cmd >> $out" ; fi
36 if [ "$out" != "1" ] ; then
41 if [ "$?" -ne "0" ] ; then
42 if [ $out != "1" ] ; then
47 # VSR : 10/11/05: disable answer mode ==>
49 #echo -e "NOT DONE !!! => $*"
50 #echo -n "Would you like to continue to install this product: (Y,N) [Y] : "
52 #rep=`echo $rep | tr "[A-Z]" "[a-z]"`
53 #if test -z $rep || [ $rep = "y" ] ; then
56 # VSR : 10/11/05: disable answer mode <==
62 #invoke check_job function
63 #all output will be put into terminal
73 rm -rf "$1" > /dev/null
77 #create environment for sh and csh
80 install_root=$1; shift
82 for i in $SHRC $CSHRC ; do
83 if [ -e ${install_work}/$i ]; then
86 touch ${install_work}/$i
89 if [ $# -eq 3 ] ; then
91 product_env=${install_work}/env_${product_name}.sh
92 (test -e ${product_env} && rm ${product_env} )
94 ### !!! writing salome.sh file !!! -> define INSTALL_ROOT
95 cat >> ${install_work}/$SHRC <<EOF
96 #${DELIM} Setting products installation directory ${DELIM}
97 export INSTALL_ROOT=${install_root}
99 #${DELIM} Environment switch: 0 for SALOME building, 1 for SALOME launching ${DELIM}
100 export ENV_FOR_LAUNCH=1
103 ### !!! The next is for RedHat 9 only !!!
104 if [ -f /etc/redhat-release ] ; then
105 grep -e "Red Hat Linux release 9" /etc/redhat-release > /dev/null
106 if [ $? -eq 0 ] ; then
107 cat >> ${install_work}/$SHRC <<EOF
108 #${DELIM} Force RH9 to use old implementation of threads ${DELIM}
109 export LD_ASSUME_KERNEL=2.4.18
114 ### !!! writing salome.csh file !!! -> set inital variables
115 pre_vars="PATH LD_LIBRARY_PATH LD_RUN_PATH PYTHONPATH TCLLIBPATH"
116 for i in $pre_vars ; do
117 cat >> ${install_work}/$CSHRC <<EOF
118 #${DELIM} setting initial ${i} ${DELIM}
119 if (! (\$?${i}) ) then
126 ### !!! writing salome.(c)sh files !!! -> dump products environment files, changing 'export' by 'setenv(a|p)' where necessary
127 ### Note, that for performance reasons temporary environment files used during installation procedure itself
128 ### are created without using setenv(a|p) aliases.
130 # 1. first dump all environment files into the $SHRC file
131 product_sequence="$2"
132 for i in $product_sequence ; do
133 env_file=${install_work}/env_${i}.sh
134 ( test -e $env_file && cat $env_file >> ${install_work}/$SHRC 2>/dev/null )
137 # 2. writing global functions to _salome.sh file
138 cat >> ${install_work}/_$SHRC <<EOF
139 ##########################################################################
140 # Functions exporta and exportp are used to append/prepend correspondingly
141 # one directory or a set of directories separated by semicolon symbol (':')
142 # to the environment variables like PATH, LD_LIBRARY_PATH, PYTHONPATH,
144 # The main purpose is to replace default setenv command behavior:
145 # exporta, exportp also remove duplicated entries, shortening in that way
146 # the environment variables.
147 # If some directory being added is already included into the variable
148 # nothing is done for it.
149 # Note, that these functions work some slower that setenv command itself.
152 # appends/prepends set of directories (second parameter)
153 # to the another set of directories (first parameter) and
154 # removes duplicated entries;
155 # the third parameter defines the mode: 0 - append, 1 - prepend
157 out_var=\`echo \$1 \$2 | awk -v dir=\$3 '{ \\
158 na = split(\$2,a,":"); \\
159 if ( \$1 == "<empty>") nb = split("",b,":"); \\
160 else nb = split(\$1,b,":"); \\
162 for(i=1;i<=nb;i++) { \\
163 if(!(b[i] in ccc)) { \\
165 s = sprintf("%s:",s); \\
166 s = sprintf("%s%s",s,b[i]); \\
171 for(i=1;i<=na;i++) { \\
172 if(!(a[i] in ccc)) { \\
174 s1 = sprintf("%s:",s1); \\
175 s1 = sprintf("%s%s",s1,a[i]); \\
180 s = length(s) == 0 ? s1 : sprintf("%s:%s",s1,s); \\
182 s = length(s1) == 0 ? s : sprintf("%s:%s",s,s1); \\
188 # appends directory or set of directories, separated by ':' (second parameter)
189 # to the variable (first parameter)
191 xenv=\`printenv \$1\`
192 if [ -z "\$xenv" ]; then xenv="<empty>"; fi
193 out_var=\`cleandup \$xenv \$2 0\`
197 # prepends directory or set of directories, separated by ':' (second parameter)
198 # to the variable (first parameter)
200 xenv=\`printenv \$1\`
201 if [ -z "\$xenv" ]; then xenv="<empty>"; fi
202 out_var=\`cleandup \$xenv \$2 1\`
205 ###########################################################################
209 # 3. writing global functions to _salome.csh file
210 cat >> ${install_work}/_$CSHRC <<EOF
212 ###########################################################################
213 # Aliases setenva and setenvp are used to append/prepend correspondingly
214 # one directory or a set of directories separated by semicolon symbol (':')
215 # to the environment variables like PATH, LD_LIBRARY_PATH, PYTHONPATH,
217 # The main purpose is to replace default setenv command behavior:
218 # setenva, setenvp also remove duplicated entries, shortening in that way
219 # the environment variables.
220 # If some directory being added is already included into the variable
221 # nothing is done for it.
222 # Note, that these aliases work some slower that setenv command itself.
225 # appends/prepends set of directories (second parameter)
226 # to the another set of directories (first parameter) and
227 # removes duplicated entries;
228 # the third parameter defines the mode: 0 - append, 1 - prepend
229 alias cleandup "echo \!:1 \!:2 | awk -v dir=\!:3 \\\\
230 '"'{ na = split(\$2,a,":"); \\\\
231 nb = split(\$1,b,":"); \\\\
233 for(i=1;i<=nb;i++) { \\\\
234 if(!(b[i] in ccc)) { \\\\
235 if(length(s)!=0) \\\\
236 s = sprintf("%s:",s); \\\\
237 s = sprintf("%s%s",s,b[i]); \\\\
242 for(i=1;i<=na;i++) { \\\\
243 if(!(a[i] in ccc)) { \\\\
244 if(length(s1)!=0) \\\\
245 s1 = sprintf("%s:",s1); \\\\
246 s1 = sprintf("%s%s",s1,a[i]); \\\\
251 s = length(s) == 0 ? s1 : sprintf("%s:%s",s1,s); \\\\
253 s = length(s1) == 0 ? s : sprintf("%s:%s",s,s1); \\\\
254 printf("%s\n",s); \\\\
257 # appends directory or set of directories, separated by ':' (second parameter)
258 # to the variable (first parameter)
259 alias setenva 'set a=\!:1 ; set b=\!:2 ; \\
260 set c=\`printenv \$a\` ; \\
261 set b=\`cleandup \$c \$b 0\` ; \\
266 # prepends directory or set of directories, separated by ':' (second parameter)
267 # to the variable (first parameter)
268 alias setenvp 'set a=\!:1 ; set b=\!:2 ; \\
269 set c=\`printenv \$a\` ; \\
270 set b=\`cleandup \$c \$b 1\` ; \\
273 ###########################################################################
276 cat ${install_work}/$CSHRC >> ${install_work}/_$CSHRC
278 # 4. put the contents of salome.sh to _salome.sh replacing export by export(a|p) aliases where necessary
279 sed -e 's%export\([[:blank:]]*\)PATH=\$[{]\?PATH[}]\?:\(.*\)%exporta\1PATH \2%g' -e 's%export\([[:blank:]]*\)PATH=\(.*\):\$[{]\?PATH[}]\?%exportp\1PATH \2%g' ${install_work}/$SHRC > ${INSTALL_WORK}/_tmp1 2>/dev/null
280 sed -e 's%export\([[:blank:]]*\)LD_LIBRARY_PATH=\$[{]\?LD_LIBRARY_PATH[}]\?:\(.*\)%exporta\1LD_LIBRARY_PATH \2%g' -e 's%export\([[:blank:]]*\)LD_LIBRARY_PATH=\(.*\):\$[{]\?LD_LIBRARY_PATH[}]\?%exportp\1LD_LIBRARY_PATH \2%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
281 sed -e 's%export\([[:blank:]]*\)PYTHONPATH=\$[{]\?PYTHONPATH[}]\?:\(.*\)%exporta\1PYTHONPATH \2%g' -e 's%export\([[:blank:]]*\)PYTHONPATH=\(.*\):\$[{]\?PYTHONPATH[}]\?%exportp\1PYTHONPATH \2%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
282 sed -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\$[{]\?LD_RUN_PATH[}]\?:\(.*\)%exporta\1LD_RUN_PATH \2%g' -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\(.*\):\$[{]\?LD_RUN_PATH[}]\?%exportp\1LD_RUN_PATH \2%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2
284 # Setting "/usr/X11R6/lib" path in LD_LIBRARY_PATH for the libGL.so.1 file
285 echo '# Setting /usr/X11R6/lib path in LD_LIBRARY_PATH for the libGL.so.1 file' >> ${INSTALL_WORK}/_tmp2
286 echo 'export LD_LIBRARY_PATH=/usr/X11R6/lib:${LD_LIBRARY_PATH}' >> ${INSTALL_WORK}/_tmp2
288 cat ${INSTALL_WORK}/_tmp2 >> ${install_work}/_$SHRC
290 # 5. Create a salome.csh file from salome.sh by replacing export by setenv, etc.
291 sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${install_work}/$SHRC > ${INSTALL_WORK}/_tmp1 2>/dev/null
292 cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/$CSHRC
294 # 6. Create a _salome.csh file from _salome.sh by replacing export by setenv, exporta by setenva, etc.
295 sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
296 sed -e 's%exporta \([[:alnum:]_[:blank:]]*\)%setenva \1%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
297 sed -e 's%exportp \([[:alnum:]_[:blank:]]*\)%setenvp \1%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
298 sed -e 's%if \[ -n "\${ENV_FOR_LAUNCH}" \] ; then%if ( ${?ENV_FOR_LAUNCH} ) then%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
299 sed -e 's%if \[ "\${ENV_FOR_LAUNCH}" == "1" \] ; then%if ( "\${ENV_FOR_LAUNCH}" == "1" ) then%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
300 sed -e 's%^\([[:blank:]]*\)fi\([[:blank:]]*\)$%\1endif\2%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
301 cat ${INSTALL_WORK}/_tmp2 >> ${install_work}/_$CSHRC 2>/dev/null
303 rm -f ${INSTALL_WORK}/_tmp1 ${INSTALL_WORK}/_tmp2
305 if [ $# -eq 4 ] ; then
307 if [ -e ${product_dir} ] ; then
308 cp -f ${install_work}/_$SHRC ${product_dir}/$SHRC
309 cp -f ${install_work}/_$CSHRC ${product_dir}/$CSHRC
312 sed -e 's%setenv ENV_FOR_LAUNCH 1%setenv ENV_FOR_LAUNCH 0%' ${install_work}/_$CSHRC > ${install_root}/env_build.csh
313 sed -e 's%export ENV_FOR_LAUNCH=1%export ENV_FOR_LAUNCH=0%' ${install_work}/_$SHRC > ${install_root}/env_build.sh
315 cp -f ${install_work}/_$CSHRC ${install_root}/env_products.csh
316 cp -f ${install_work}/_$SHRC ${install_root}/env_products.sh
318 rm -f ${install_work}/_$SHRC ${install_work}/_$CSHRC
319 ### !!! copying build.csh script
320 if [ -e ./build.csh ]; then
321 cp -f ./build.csh ${install_root}
325 #try use already existing product
328 product_dir=$1; install_root=$2; install_work=$3; product_sequence="$4"; product_type=$5
329 env_file=${product_dir}/env_${product_type}.sh
330 if [ -f ${env_file} ] ; then
331 cp -f ${env_file} ${install_work}
332 make_env ${install_root} ${install_work} "${product_sequence}"
333 source ${install_work}/$SHRC
335 if [ $? -eq 0 ] ; then
336 if [ -d ${product_dir} ] && [ -w ${product_dir} ] ; then
337 #makedir ${product_dir}
342 rm -f ${install_work}/env_${product_type}.sh
343 make_env ${install_root} ${install_work} "${product_sequence}"
349 #check existance of lib passed as first parameter
350 #return 0 if lib exists
351 #if you pass second parameter search will be done in it
352 #otherwise search will be done in $LD_LIBRARY_PATH
353 #you should use : as dilimeter if you are going to pass second parameter
358 whereIs=$LD_LIBRARY_PATH
360 for L in `echo ${whereIs} | sed -e"s%:% %g"` ; do
361 ret=`find $L -name $1 2>/dev/null`
362 if [ -n "$ret" ] ; then
363 #echo "The $1 exists on yours system in a $L folder"
373 for i in `echo ${path} | sed -e"s%:% %g"` ; do
374 ret=`find $i -name $file -maxdepth 1 2>/dev/null`
375 if [ -n "$ret" ] ; then
376 ret=`echo $ret | sed -e"s%/\$file$%%g"`
385 arg1=$1; val1=$2; arg2=$3; val2=$4
386 tmp="^$val1$|^$val1:|:$val1$|:$val1:"
387 #echo $val2 | grep -E "$tmp" >/dev/null 2>&1
388 #if [ $? -eq 0 ] ; then
393 exclude_list="usr lib bin sbin etc"
394 for i in ${exclude_list} ; do
396 echo ${val1} | grep -E "$tmp" >/dev/null 2>&1
397 if [ $? == 0 ] ; then to_tail=0; break; fi
399 if [ $to_tail -eq 0 ] ; then
408 maj_ver=`echo $1 | awk -F. '{if(NF>0) print $1; else print 0}'`
409 min_ver=`echo $1 | awk -F. '{if(NF>1) print $2; else print 0}'`
410 rel_ver=`echo $1 | awk -F. '{if(NF>2) print $3; else print 0}'`
411 let ver=$maj_ver*10000+$min_ver*100+$rel_ver
414 for i in `echo ${PATH}:/usr/bin:/usr/local/bin | sed -e"s%:% %g"` ; do
415 ret=`find $i -name gcc -maxdepth 1 2>/dev/null`
416 if [ -n "$ret" ] ; then
417 maj_ver=`$ret -dumpversion | awk -F. '{if(NF>0) print $1; else print 0}'`
418 min_ver=`$ret -dumpversion | awk -F. '{if(NF>1) print $2; else print 0}'`
419 rel_ver=`$ret -dumpversion | awk -F. '{if(NF>2) print $3; else print 0}'`
420 let ver1=$maj_ver*10000+$min_ver*100+$rel_ver
421 if [ $ver1 -eq $ver ] ; then
422 ret=`echo $ret | sed -e"s%/gcc$%%g"`
426 if [ $ver1 -gt $ver ] && [ $ver1 -gt $newerver ] ; then
428 newer=`echo $ret | sed -e"s%/gcc$%%g"`
432 if [ -n "$newer" ] ; then
440 if test -z "${TCLHOME}"; then
443 tclcfg=`find ${TCLHOME}/lib -name "tclConfig.sh" 2> /dev/null`
447 ver=`cat $f | grep -e "TCL_VERSION=.*" | sed -e "s%TCL_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g" | awk -F. '{x=0;for(i=1;i<=3;i++){x=x*100;if(i<=NF)x+=$i;}print x;}'`
448 if [ $maxver -lt $ver ]; then
453 if test -n "$file"; then
463 if test -z "${TCLHOME}"; then
466 tclcfg=`find ${TCLHOME}/lib -name "tkConfig.sh" 2> /dev/null`
470 ver=`cat $f | grep -e "TK_VERSION=.*" | sed -e "s%TK_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g" | awk -F. '{x=0;for(i=1;i<=3;i++){x=x*100;if(i<=NF)x+=$i;}print x;}'`
471 if [ $maxver -lt $ver ]; then
476 if test -n "$file"; then
486 if test -f /usr/X11R6/include/DPS/dpsconfig.h ; then
490 if test -f /usr/include/DPS/dpsconfig.h ; then
500 if [ -z "$ldir" ] || [ ! -d "$ldir" ]; then return 1; fi
504 SALOME_MODULES="`env | awk -F_ '/[[:alnum:]]*_ROOT_DIR/ { print $1 }'`"
508 la_files=`find . -name "*.la"`
510 for l in X ${la_files}; do
511 if [ "$l" != "X" ] ; then
515 # 1. process salome modules dependencies
516 for mod in $SALOME_MODULES; do
517 moddir=`printenv ${mod}_ROOT_DIR`
518 if [ -n "${moddir}" ] ; then
519 #echo $l $mod $moddir
520 sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod}[^[:space:]/]*/lib% \1${moddir}/lib%g" $l > $l"_"
524 # 2. process CAS.CADE dependencies
525 casdir=`printenv CASROOT`/lib
526 if [ ! -d ${casdir} ] ; then casdir=`printenv CASROOT`/Linux/lib ; fi
527 if [ ! -d ${casdir} ] ; then casdir=`printenv CASROOT`/lin/lib ; fi
528 if [ -n "${CASROOT}" ] && [ -d "${casdir}" ] ; then
529 # echo $l $CASROOT $casdir
530 sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*\(OCT\|CAS\)[^[:space:]/]*/Linux/lib% \1${casdir}%g" \
531 -e "s%[[:space:]]\(-L\)\?[^[:space:]]*\(OCT\|CAS\)[^[:space:]/]*/lin/lib% \1${casdir}%g" \
532 -e "s%[[:space:]]\(-L\)\?[^[:space:]]*\(OCT\|CAS\)[^[:space:]/]*/lib% \1${casdir}%g" $l > $l"_"
535 # 3. process omniORB dependencies
536 omnidir=`printenv OMNIORBDIR`/lib/i586_linux_2.0_glibc2.1
537 if [ ! -d ${omnidir} ] ; then omnidir=`printenv OMNIORBDIR`/lib ; fi
538 if [ -n "${OMNIORBDIR}" ] && [ -d "${omnidir}" ] ; then
539 # echo $l $OMNIORBDIR $omnidir
540 sed -e "s%-L[^[:space:]]*omni[^[:space:]]*%-L${omnidir}%g" $l > $l"_"
543 # 4. process VTK dependencies
544 vtkdir=`printenv VTKHOME`/lib/vtk
545 if [ -n "${VTKHOME}" ] && [ -d "${vtkdir}" ] ; then
546 # echo $l $VTKHOME $vtkdir
547 sed -e "s%-L[^[:space:]]*VTK[^[:space:]]*/lib/vtk%-L${vtkdir}%g" $l > $l"_"
550 # 5. process HDF dependencies
551 hdfdir=`printenv HDF5HOME`/lib
552 if [ -n "${HDF5HOME}" ] && [ -d "${hdfdir}" ] ; then
553 # echo $l $HDF5HOME $hdfdir
554 sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*hdf[^[:space:]/]*/lib% \1${hdfdir}%g" $l > $l"_"
557 # 6. process MED dependencies
558 meddir=`printenv MED2HOME`/lib
559 if [ -n "${MED2HOME}" ] && [ -d "${meddir}" ] ; then
560 # echo $l $MED2HOME $meddir
561 sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*med[^[:space:]/]*/lib% \1${meddir}%g" $l > $l"_"
564 # 7. process qwt dependencies
565 qwtdir=`find_in_path libqwt.so ${LD_LIBRARY_PATH}`
566 if [ -n "${qwtdir}" ] && [ -d "${qwtdir}" ] ; then
568 sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*qwt[^[:space:]/]*/lib% \1${qwtdir}%g" $l > $l"_"
571 # 8. process qt dependencies
572 qtdir=`printenv QTDIR`/lib
573 if [ -n "${QTDIR}" ] && [ -d "${qtdir}" ] ; then
574 # echo $l $QTDIR $qtdir
575 sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*qt[^[:space:]/]*/lib% \1${qtdir}%g" $l > $l"_"
578 # 9. process python dependencies
579 where_python=`which python` # e.g. /usr/bin/python
580 if [ -n "$where_python" ] ; then
581 where_python=`dirname $where_python` # --> /usr/bin
582 where_python=`dirname $where_python` # --> /usr
583 python_version=`python -c "import sys; print sys.version[:3]"`
584 # echo $l $where_python $python_version
585 sed -e "s%-L[^[:space:]]*python[0-9]\.[0-9]\([^[:space:]]*\)%-L${where_python}/lib/python${python_version}\1%g" $l > $l"_"
588 # 10. process sip dependencies
589 sipdir=`find_in_path sip.so ${LD_LIBRARY_PATH}`
590 if [ -n "${sipdir}" ] && [ -d "${sipdir}" ] ; then
592 sed -e "s%-L[^[:space:]]*sip[^[:space:]]*%-L${sipdir}%g" $l > $l"_"
595 # 11. process PyQt dependencies
596 pyqtdir=`find_in_path qt.so ${LD_LIBRARY_PATH}`
597 if [ -n "${pyqtdir}" ] && [ -d "${pyqtdir}" ] ; then
599 sed -e "s%-L[^[:space:]]*PyQt[^[:space:]]*%-L${pyqtdir}%g" $l > $l"_"
602 # 12. process tcl/tk dependencies
603 tcldir=`printenv TCLHOME`/lib
604 if [ -n "${tcldir}" ] && [ -d "${tcldir}" ] ; then
605 # echo $l $TCLHOME $tcldir
606 sed -e "s%-L[^[:space:]]*tcltk[^[:space:]]*/lib%-L${tcldir}%g" $l > $l"_"
609 # 13. process boost dependencies
610 boostdir=`printenv BOOSTDIR`/lib
611 if [ -n "${boostdir}" ] && [ -d "${boostdir}" ] ; then
612 # echo $l $BOOSTDIR $boostdir
613 sed -e "s%-L[^[:space:]]*boost[^[:space:]]*/lib%-L${boostdir}%g" $l > $l"_"
617 #sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib/salome'%g" $l > $l"_"
618 mod=`basename $ldir | awk -F_ '{print $1}'`
619 moddir=`printenv ${mod}_ROOT_DIR`
620 sed -e "s%^libdir='[^[:space:]]*${mod}[^[:space:]]*/\(lib.*\)'%libdir='${moddir}/\1'%g" $l > $l"_"