# the third parameter defines the mode: 0 - append, 1 - prepend
cleandup() {
out_var=\`echo \$1 \$2 | awk -v dir=\$3 '{ \\
- na = split(\$2,a,":"); \\
- if ( \$1 == "<empty>") nb = split("",b,":"); \\
- else nb = split(\$1,b,":"); \\
- s = "" ; \\
- for(i=1;i<=nb;i++) { \\
- if(!(b[i] in ccc)) { \\
- if(length(s)!=0) \\
- s = sprintf("%s:",s); \\
- s = sprintf("%s%s",s,b[i]); \\
- ccc[b[i]]; \\
- }; \\
- }; \\
- s1 = ""; \\
- for(i=1;i<=na;i++) { \\
- if(!(a[i] in ccc)) { \\
- if(length(s1)!=0) \\
- s1 = sprintf("%s:",s1); \\
- s1 = sprintf("%s%s",s1,a[i]); \\
- ccc[a[i]]; \\
- }; \\
- }; \\
- if(dir) \\
- s = length(s) == 0 ? s1 : sprintf("%s:%s",s1,s); \\
- else \\
- s = length(s1) == 0 ? s : sprintf("%s:%s",s,s1); \\
- printf("%s\n",s); \\
- }'\`
+ na = split(\$2,a,":"); \\
+ k1=0; \\
+ bbb[k1++]=""; \\
+ ccc[""]; \\
+ if(\$1 != "<empty>") { \\
+ nb = split(\$1,b,":"); \\
+ for(i=1;i<=nb;i++) { \\
+ if(!(b[i] in ccc) ) { \\
+ ccc[b[i]]; \\
+ bbb[k1++]=b[i]; \\
+ }; \\
+ }; \\
+ }; \\
+ k2=0; \\
+ aaa[k2++]=""; \\
+ for(i=1;i<=na;i++) { \\
+ if(!(a[i] in ccc)) { \\
+ ccc[a[i]]; \\
+ aaa[k2++]=a[i]; \\
+ }; \\
+ }; \\
+ ORS=":"; \\
+ if(dir) { \\
+ for(i=1;i<k2;i++) { \\
+ print aaa[i]; \\
+ } \\
+ for(i=1;i<k1;i++) { \\
+ print bbb[i]; \\
+ } \\
+ } \\
+ else { \\
+ for(i=1;i<k1;i++) { \\
+ print bbb[i]; \\
+ } \\
+ for(i=1;i<k2;i++) { \\
+ print aaa[i]; \\
+ } \\
+ } \\
+ }' | sed -e 's/\(.*\):/\1/g'\`
echo \$out_var
}
### exporta ###
# 3. writing global functions to _salome.csh file
cat >> ${install_work}/_$CSHRC <<EOF
+
###########################################################################
# Aliases setenva and setenvp are used to append/prepend correspondingly
# one directory or a set of directories separated by semicolon symbol (':')
# the third parameter defines the mode: 0 - append, 1 - prepend
alias cleandup "echo \!:1 \!:2 | awk -v dir=\!:3 \\\\
'"'{ na = split(\$2,a,":"); \\\\
- nb = split(\$1,b,":"); \\\\
- s = "" ; \\\\
- for(i=1;i<=nb;i++) { \\\\
- if(!(b[i] in ccc)) { \\\\
- if(length(s)!=0) \\\\
- s = sprintf("%s:",s); \\\\
- s = sprintf("%s%s",s,b[i]); \\\\
- ccc[b[i]]; \\\\
- }; \\\\
- }; \\\\
- s1 = ""; \\\\
- for(i=1;i<=na;i++) { \\\\
- if(!(a[i] in ccc)) { \\\\
- if(length(s1)!=0) \\\\
- s1 = sprintf("%s:",s1); \\\\
- s1 = sprintf("%s%s",s1,a[i]); \\\\
- ccc[a[i]]; \\\\
- }; \\\\
- }; \\\\
- if(dir) \\\\
- s = length(s) == 0 ? s1 : sprintf("%s:%s",s1,s); \\\\
- else \\\\
- s = length(s1) == 0 ? s : sprintf("%s:%s",s,s1); \\\\
- printf("%s\n",s); \\\\
- }'"'"
+ k1=0; \\\\
+ bbb[k1++]=""; \\\\
+ ccc[""]; \\\\
+ if(\$1 != "<empty>") { \\\\
+ nb = split(\$1,b,":"); \\\\
+ for(i=1;i<=nb;i++) { \\\\
+ if(!(b[i] in ccc) ) { \\\\
+ ccc[b[i]]; \\\\
+ bbb[k1++]=b[i]; \\\\
+ }; \\\\
+ }; \\\\
+ }; \\\\
+ k2=0; \\\\
+ aaa[k2++]=""; \\\\
+ for(i=1;i<=na;i++) { \\\\
+ if(!(a[i] in ccc)) { \\\\
+ ccc[a[i]]; \\\\
+ aaa[k2++]=a[i]; \\\\
+ }; \\\\
+ }; \\\\
+ ORS=":"; \\\\
+ if(dir) { \\\\
+ for(i=1;i<k2;i++) { \\\\
+ print aaa[i]; \\\\
+ } \\\\
+ for(i=1;i<k1;i++) { \\\\
+ print bbb[i]; \\\\
+ } \\\\
+ } \\\\
+ else { \\\\
+ for(i=1;i<k1;i++) { \\\\
+ print bbb[i]; \\\\
+ } \\\\
+ for(i=1;i<k2;i++) { \\\\
+ print aaa[i]; \\\\
+ } \\\\
+ } \\\\
+ }'"' | sed -e 's/\(.*\):/\1/g'"
### setenva ###
# appends directory or set of directories, separated by ':' (second parameter)
# to the variable (first parameter)
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
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
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
+
+# Setting "/usr/X11R6/lib" path in LD_LIBRARY_PATH for the libGL.so.1 file
+echo '# Setting /usr/X11R6/lib path in LD_LIBRARY_PATH for the libGL.so.1 file' >> ${INSTALL_WORK}/_tmp2
+echo 'export LD_LIBRARY_PATH=/usr/X11R6/lib:${LD_LIBRARY_PATH}' >> ${INSTALL_WORK}/_tmp2
+
cat ${INSTALL_WORK}/_tmp2 >> ${install_work}/_$SHRC
# 5. Create a salome.csh file from salome.sh by replacing export by setenv, etc.
fi
sed -e 's%setenv ENV_FOR_LAUNCH 1%setenv ENV_FOR_LAUNCH 0%' ${install_work}/_$CSHRC > ${install_root}/env_build.csh
sed -e 's%export ENV_FOR_LAUNCH=1%export ENV_FOR_LAUNCH=0%' ${install_work}/_$SHRC > ${install_root}/env_build.sh
+
cp -f ${install_work}/_$CSHRC ${install_root}/env_products.csh
cp -f ${install_work}/_$SHRC ${install_root}/env_products.sh
+
rm -f ${install_work}/_$SHRC ${install_work}/_$CSHRC
### !!! copying build.csh script
if [ -e ./build.csh ]; then
cp -f ./build.csh ${install_root}
fi
+### !!! copying release notes
+for p in `ls ../` ; do
+ export pdf=`echo ${p} | sed s/[.]/" "/g | awk '{print $2}'`
+ if [ "${pdf}" = "pdf" ]; then
+ export RN=$p
+ if [ ! -e ${install_root}/${RN} ]; then
+ cp -f ../${RN} ${install_root}
+ fi
+ fi
+done
+
}
#try use already existing product
print_env
return 0
fi
+ else
+ rm -f ${install_work}/env_${product_type}.sh
+ make_env ${install_root} ${install_work} "${product_sequence}"
fi
fi
return 1;
SALOME_MODULES="`env | awk -F_ '/[[:alnum:]]*_ROOT_DIR/ { print $1 }'`"
cd $ldir
+ldir=`pwd`
la_files=`find . -name "*.la"`
for l in X ${la_files}; do
moddir=`printenv ${mod}_ROOT_DIR`
if [ -n "${moddir}" ] ; then
#echo $l $mod $moddir
- sed -e "s%\(-L\|[[:space:]]\)[^[:space:]]*${mod}[^[:space:]]*/lib%\1${moddir}/lib%g" $l > $l"_"
+ sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod}[^[:space:]/]*/lib% \1${moddir}/lib%g" $l > $l"_"
mv -f $l"_" $l
fi
done
if [ ! -d ${casdir} ] ; then casdir=`printenv CASROOT`/lin/lib ; fi
if [ -n "${CASROOT}" ] && [ -d "${casdir}" ] ; then
# echo $l $CASROOT $casdir
- sed -e "s%-L[^[:space:]]*\(OCT\|CAS\)[^[:space:]]*%-L${casdir}%g" $l > $l"_"
+ sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*\(OCT\|CAS\)[^[:space:]/]*/Linux/lib% \1${casdir}%g" \
+ -e "s%[[:space:]]\(-L\)\?[^[:space:]]*\(OCT\|CAS\)[^[:space:]/]*/lin/lib% \1${casdir}%g" \
+ -e "s%[[:space:]]\(-L\)\?[^[:space:]]*\(OCT\|CAS\)[^[:space:]/]*/lib% \1${casdir}%g" $l > $l"_"
mv -f $l"_" $l
fi
# 3. process omniORB dependencies
hdfdir=`printenv HDF5HOME`/lib
if [ -n "${HDF5HOME}" ] && [ -d "${hdfdir}" ] ; then
# echo $l $HDF5HOME $hdfdir
- sed -e "s%-L[^[:space:]]*hdf[^[:space:]]*/lib%-L${hdfdir}%g" $l > $l"_"
+ sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*hdf[^[:space:]/]*/lib% \1${hdfdir}%g" $l > $l"_"
mv -f $l"_" $l
fi
# 6. process MED dependencies
meddir=`printenv MED2HOME`/lib
if [ -n "${MED2HOME}" ] && [ -d "${meddir}" ] ; then
# echo $l $MED2HOME $meddir
- sed -e "s%-L[^[:space:]]*med[^[:space:]]*/lib%-L${meddir}%g" $l > $l"_"
+ sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*med[^[:space:]/]*/lib% \1${meddir}%g" $l > $l"_"
mv -f $l"_" $l
fi
# 7. process qwt dependencies
qwtdir=`find_in_path libqwt.so ${LD_LIBRARY_PATH}`
if [ -n "${qwtdir}" ] && [ -d "${qwtdir}" ] ; then
# echo $l $qwtdir
- sed -e "s%-L[^[:space:]]*qwt[^[:space:]]*/lib%-L${qwtdir}%g" $l > $l"_"
+ sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*qwt[^[:space:]/]*/lib% \1${qwtdir}%g" $l > $l"_"
mv -f $l"_" $l
fi
# 8. process qt dependencies
qtdir=`printenv QTDIR`/lib
if [ -n "${QTDIR}" ] && [ -d "${qtdir}" ] ; then
# echo $l $QTDIR $qtdir
- sed -e "s%-L[^[:space:]]*qt[^[:space:]]*/lib%-L${qtdir}%g" $l > $l"_"
+ sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*qt[^[:space:]/]*/lib% \1${qtdir}%g" $l > $l"_"
mv -f $l"_" $l
fi
# 9. process python dependencies
sed -e "s%-L[^[:space:]]*tcltk[^[:space:]]*/lib%-L${tcldir}%g" $l > $l"_"
mv -f $l"_" $l
fi
- # 13. modify libdir
+ # 13. process boost dependencies
+ boostdir=`printenv BOOSTDIR`/lib
+ if [ -n "${boostdir}" ] && [ -d "${boostdir}" ] ; then
+ # echo $l $BOOSTDIR $boostdir
+ sed -e "s%-L[^[:space:]]*boost[^[:space:]]*/lib%-L${boostdir}%g" $l > $l"_"
+ mv -f $l"_" $l
+ fi
+ # 14. modify libdir
#sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib/salome'%g" $l > $l"_"
+ mod=`basename $ldir | awk -F_ '{print $1}'`
+ moddir=`printenv ${mod}_ROOT_DIR`
sed -e "s%^libdir='[^[:space:]]*${mod}[^[:space:]]*/\(lib.*\)'%libdir='${moddir}/\1'%g" $l > $l"_"
mv -f $l"_" $l
fi