cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export COMPONENT_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${COMPONENT_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${COMPONENT_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${COMPONENT_ROOT_DIR}/bin/salome:\${COMPONENT_ROOT_DIR}/lib/salome:\${COMPONENT_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export COMPONENT_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${COMPONENT_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${COMPONENT_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${COMPONENT_ROOT_DIR}/bin/salome:\${COMPONENT_ROOT_DIR}/lib/salome:\${COMPONENT_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export GEOM_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${GEOM_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${GEOM_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${GEOM_ROOT_DIR}/bin/salome:\${GEOM_ROOT_DIR}/lib/salome:\${GEOM_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export GEOM_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${GEOM_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${GEOM_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${GEOM_ROOT_DIR}/bin/salome:\${GEOM_ROOT_DIR}/lib/salome:\${GEOM_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export GHS3DPLUGIN_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export LD_LIBRARY_PATH=\${GHS3DPLUGIN_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${GHS3DPLUGIN_ROOT_DIR}/lib/salome:\${GHS3DPLUGIN_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export GHS3DPLUGIN_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export LD_LIBRARY_PATH=\${GHS3DPLUGIN_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${GHS3DPLUGIN_ROOT_DIR}/lib/salome:\${GHS3DPLUGIN_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export HELLO_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${HELLO_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${HELLO_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${HELLO_ROOT_DIR}/bin/salome:\${HELLO_ROOT_DIR}/lib/salome:\${HELLO_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export HELLO_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${HELLO_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${HELLO_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${HELLO_ROOT_DIR}/bin/salome:\${HELLO_ROOT_DIR}/lib/salome:\${HELLO_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export PATH=\${INSTALL_ROOT}/${PRODUCT}/bin:\${PATH}
-export PYTHONPATH=\${INSTALL_ROOT}/${PRODUCT}/lib/python2.2/site-packages:\${PYTHONPATH}
+export PYTHONPATH=\${INSTALL_ROOT}/${PRODUCT}/lib/python\${PYTHON_VERSION}/site-packages:\${PYTHONPATH}
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cd ${PRODUCT_WORK}
makedir ${PRODUCT_DIR}
check_job ${PRODUCT_DIR}/INSTALL.LOG python setup.py install --prefix=${PRODUCT_DIR}
-#file_pth=${PRODUCT_DIR}/lib/python2.2/site-packages/happydoclib.pth
+#file_pth=${PRODUCT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/happydoclib.pth
#if [ ! -f ${file_pth} ] ; then
# touch ${file_pth}
# cat > ${file_pth} <<EOF
if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
export PATH=\${KERNEL_ROOT_DIR}/bin/salome:\${PATH}
export LD_LIBRARY_PATH=\${KERNEL_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
- export PYTHONPATH=\${KERNEL_ROOT_DIR}/bin/salome:\${KERNEL_ROOT_DIR}/lib/salome:\${KERNEL_ROOT_DIR}/lib/python2.2/site-packages/salome:\${PYTHONPATH}
+ export PYTHONPATH=\${KERNEL_ROOT_DIR}/bin/salome:\${KERNEL_ROOT_DIR}/lib/salome:\${KERNEL_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
fi
fi
##
if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
export PATH=\${KERNEL_ROOT_DIR}/bin/salome:\${PATH}
export LD_LIBRARY_PATH=\${KERNEL_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
- export PYTHONPATH=\${KERNEL_ROOT_DIR}/bin/salome:\${KERNEL_ROOT_DIR}/lib/salome:\${KERNEL_ROOT_DIR}/lib/python2.2/site-packages/salome:\${PYTHONPATH}
+ export PYTHONPATH=\${KERNEL_ROOT_DIR}/bin/salome:\${KERNEL_ROOT_DIR}/lib/salome:\${KERNEL_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
fi
fi
##
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export MED_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${MED_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${MED_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${MED_ROOT_DIR}/bin/salome:\${MED_ROOT_DIR}/lib/salome:\${MED_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export MED_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${MED_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${MED_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${MED_ROOT_DIR}/bin/salome:\${MED_ROOT_DIR}/lib/salome:\${MED_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export NETGENPLUGIN_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export LD_LIBRARY_PATH=\${NETGENPLUGIN_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${NETGENPLUGIN_ROOT_DIR}/lib/salome:\${NETGENPLUGIN_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export NETGENPLUGIN_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export LD_LIBRARY_PATH=\${NETGENPLUGIN_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${NETGENPLUGIN_ROOT_DIR}/lib/salome:\${NETGENPLUGIN_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
#!/bin/sh
check_version(){
-if [ -d "${PYTHONHOME}/lib/python2.2/site-packages/Numeric" ]; then
- check_lib_version _numpy.so ${PYTHONHOME}/lib/python2.2/site-packages/Numeric
- if [ "$?" -eq "0" ]; then
- #echo "The product ${PRODUCT} has been already installed on yours system"
- return 0
- fi
+ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null`
+if [ "$ver" == "22.0" ]; then
+ return 0
fi
return 1
}
print_env(){
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
-export PYTHONPATH=\${INSTALL_ROOT}/${PRODUCT}/lib/python2.2/site-packages/Numeric:\${PYTHONPATH}
+export PYTHONPATH=\${INSTALL_ROOT}/${PRODUCT}/lib/python\${PYTHON_VERSION}/site-packages/Numeric:\${PYTHONPATH}
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
# looks for the native product and collects it's environment (used by make_env())
try_native(){
-cat > ${INSTALL_WORK}/try_native.py <<EOF
-import sys
-try :
- import Numeric
- sys.exit(0)
-except ImportError, r :
- sys.exit(1)
-EOF
-python ${INSTALL_WORK}/try_native.py
+check_version
if [ $? -eq 0 ] ; then
- pythonpath="`find_in_path _numpy.so ${PYTHONPATH}`"
+ pythonpath="`find_in_path Numeric.py ${PYTHONPATH}`"
tmp="${pythonpath} ${pythonpath} \${PYTHONPATH} ${PYTHONPATH}";
pythonpath=`sort_path ${tmp}`
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- rm -f ${INSTALL_WORK}/try_native.py
return 0
fi
-rm -f ${INSTALL_WORK}/try_native.py
return 1
}
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export PYCALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${PYCALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
+ export PYTHONPATH=\${PYCALCULATOR_ROOT_DIR}/bin/salome:\${PYCALCULATOR_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export PYCALCULATOR_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${PYCALCULATOR_ROOT_DIR}/bin/salome:\${PATH}
+ export PYTHONPATH=\${PYCALCULATOR_ROOT_DIR}/bin/salome:\${PYCALCULATOR_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export PYHELLO_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${PYHELLO_ROOT_DIR}/bin/salome:\${PATH}
+ export PYTHONPATH=\${PYHELLO_ROOT_DIR}/bin/salome:\${PYHELLO_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export PYHELLO_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${PYHELLO_ROOT_DIR}/bin/salome:\${PATH}
+ export PYTHONPATH=\${PYHELLO_ROOT_DIR}/bin/salome:\${PYHELLO_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
export PYQTDIR=\${INSTALL_ROOT}/${PRODUCT}
export PYQT_SIPS=\${PYQTDIR}/sip
export PATH=\${PYQTDIR}:\$PATH
-export PYTHONPATH=\${PYQTDIR}:\${PYTHONPATH}
export LD_LIBRARY_PATH=\${PYQTDIR}:\$LD_LIBRARY_PATH
+export PYTHONPATH=\${PYQTDIR}:\${PYTHONPATH}
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
#$DELIM ${PRODUCT_TYPE} $DELIM
export PYQTDIR=\${INSTALL_ROOT}/${PRODUCT}
export PYQT_SIPS=\${PYQTDIR}/sip
-export PYTHONPATH=\${PYQTDIR}:\${PYQTDIR}/qt:\${PYQTDIR}/qtgl:\${PYQTDIR}/qttable:\${PYQTDIR}/qtxml:\${PYTHONPATH}
export PATH=\${PYQTDIR}:\$PATH
export LD_LIBRARY_PATH=\${PYQTDIR}:\$LD_LIBRARY_PATH
+export PYTHONPATH=\${PYQTDIR}:\${PYQTDIR}/qt:\${PYQTDIR}/qtgl:\${PYQTDIR}/qttable:\${PYQTDIR}/qtxml:\${PYTHONPATH}
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
# looks for the native product and collects it's environment (used by make_env())
try_native(){
-pyqtdir="`find_in_path sip ${PATH}`"
+pyqtdir="`find_in_path pyuic ${PATH}`"
if [ -z "${pyqtdir}" ] ; then
- pyqtdir="`find_in_path sip /usr/bin`"
+ pyqtdir="`find_in_path pyuic /usr/bin`"
fi
if [ -n "${pyqtdir}" ] ; then
pyqt_sips=${pyqtdir}/sip
return 1
fi
fi
+ python_version="`python -c 'import sys; print sys.version[:3]'`"
pythonpath="`find_in_path libsip.so.9.1.0 ${PYTHONPATH}`"
if [ -z "${pythonpath}" ] ; then
- pythonpath="`find_in_path libsip.so.9.1.0 /usr/lib/python2.2/site-packages`"
+ pythonpath="`find_in_path libsip.so.9.1.0 /usr/lib/python${python_version}/site-packages`"
fi
if [ -n "${pythonpath}" ] ; then
tmp="${pyqtdir} ${pyqtdir} \${PATH} ${PATH}";
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export PYTHONHOME=\${INSTALL_ROOT}/${PRODUCT}
-export PYTHON_INCLUDE=\${PYTHONHOME}/include/python2.2
-export PYTHONPATH=\${PYTHONHOME}/lib/python2.2:\${PYTHONPATH}
export PATH=\${PYTHONHOME}/bin:\${PATH}
-export LD_LIBRARY_PATH=\${PYTHONHOME}/lib/python2.2:\${LD_LIBRARY_PATH}
+export PYTHON_VERSION=\`python -c "import sys; print sys.version[:3]"\`
+export PYTHON_INCLUDE=\${PYTHONHOME}/include/python\${PYTHON_VERSION}
+export PYTHONPATH=\${PYTHONHOME}/lib/python\${PYTHON_VERSION}:\${PYTHONPATH}
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
# if [ "`${pythonhome}/bin/python -V 2>&1`" == "Python 2.2.1" ] ; then
tmp="\${PYTHONHOME}/bin ${pythonhome}/bin \${PATH} ${PATH}";
path=`sort_path ${tmp}`
- tmp="\${PYTHONHOME}/lib/python2.2 ${pythonhome}/lib/python2.2 \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- tmp="\${PYTHONHOME}/lib/python2.2 ${pythonhome}/lib/python2.2 \${PYTHONPATH} ${PYTHONPATH}";
+ tmp="\${PYTHONHOME}/lib/python\${PYTHON_VERSION} ${pythonhome}/lib/python${maj_ver}.${min_ver} \${PYTHONPATH} ${PYTHONPATH}";
pythonpath=`sort_path ${tmp}`
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export PYTHONHOME=${pythonhome}
-export PYTHON_INCLUDE=\${PYTHONHOME}/include/python2.2
-export PYTHONPATH=${pythonpath}
export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+export PYTHON_VERSION=\`python -c "import sys; print sys.version[:3]"\`
+export PYTHON_INCLUDE=\${PYTHONHOME}/include/python\${PYTHON_VERSION}
+export PYTHONPATH=${pythonpath}
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export SMESH_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${SMESH_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${SMESH_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${SMESH_ROOT_DIR}/bin/salome:\${SMESH_ROOT_DIR}/lib/salome:\${SMESH_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export SMESH_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${SMESH_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${SMESH_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${SMESH_ROOT_DIR}/bin/salome:\${SMESH_ROOT_DIR}/lib/salome:\${SMESH_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export SUPERV_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${SUPERV_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${SUPERV_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${SUPERV_ROOT_DIR}/bin/salome:\${SUPERV_ROOT_DIR}/lib/salome:\${SUPERV_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export SUPERV_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${SUPERV_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${SUPERV_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${SUPERV_ROOT_DIR}/bin/salome:\${SUPERV_ROOT_DIR}/lib/salome:\${SUPERV_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export VISU_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${VISU_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${VISU_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${VISU_ROOT_DIR}/bin/salome:\${VISU_ROOT_DIR}/lib/salome:\${VISU_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export VISU_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}
+if [ -n "\${ENV_FOR_LAUNCH}" ] ; then
+ if [ "\${ENV_FOR_LAUNCH}" == "1" ] ; then
+ export PATH=\${VISU_ROOT_DIR}/bin/salome:\${PATH}
+ export LD_LIBRARY_PATH=\${VISU_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=\${VISU_ROOT_DIR}/bin/salome:\${VISU_ROOT_DIR}/lib/salome:\${VISU_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/salome:\${PYTHONPATH}
+ fi
+fi
##
EOF
make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
export VTKHOME=\${INSTALL_ROOT}/${PRODUCT}
export PATH=\${VTKHOME}/bin:\${PATH}
export LD_LIBRARY_PATH=\${VTKHOME}/lib/vtk:\${LD_LIBRARY_PATH}
-export PYTHONPATH=\${VTKHOME}/lib/vtk:\${VTKHOME}/lib/python2.2/site-packages/vtk_python:\${PYTHONPATH}
+export PYTHONPATH=\${VTKHOME}/lib/vtk:\${VTKHOME}/lib/python\${PYTHON_VERSION}/site-packages/vtk_python:\${PYTHONPATH}
export TCLLIBPATH="\${VTKHOME}/lib/vtk/tcl \${TCLLIBPATH}"
##
EOF
try_native(){
check_version
if [ $? -eq 0 ] ; then
+ python_version="`python -c 'import sys; print sys.version[:3]'`"
tmp="\${VTKHOME}/bin ${VTKHOME}/bin \${PATH} ${PATH}";
path=`sort_path ${tmp}`
tmp="\${VTKHOME}/lib/vtk ${VTKHOME}/lib/vtk \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
ld_library_path=`sort_path ${tmp}`
- tmp="\${VTKHOME}/lib/vtk:\${VTKHOME}/lib/python2.2/site-packages/vtk_python ${VTKHOME}/lib/vtk:${VTKHOME}/lib/python2.2/site-packages/vtk_python \${PYTHONPATH} ${PYTHONPATH}";
+ tmp="\${VTKHOME}/lib/vtk:\${VTKHOME}/lib/python${PYTHON_VERSION}/site-packages/vtk_python ${VTKHOME}/lib/vtk:${VTKHOME}/lib/python${python_version}/site-packages/vtk_python \${PYTHONPATH} ${PYTHONPATH}";
python_path=`sort_path ${tmp}`
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
check_jb tar xfz ${SOURCE_DIR}/VTK-4.2-LatestRelease.tar.gz -C ${INSTALL_WORK}
cd ${PRODUCT_WORK}
+# get Python and tcl/tk version
+python_version="`python -c 'import sys; print sys.version[:3]'`"
+tcl_version="`find ${TCLHOME}/lib -name 'libtcl*.so' | awk '/libtcl[0-9.]+.so/ { print $0}' | sed -e 's%^.*libtcl\([0-9\.]*\)\.so%\1%'`"
+
VTK_CMAKE_OPTIONS=""
### common VTK settings
VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DBUILD_SHARED_LIBS:BOOL=ON"
VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_RENDERING:BOOL=ON"
### Wrap Python settings
VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_PYTHON:BOOL=ON"
-VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_EXECUTABLE:STRING=${PYTHONHOME}/bin/python2.2"
-VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_INCLUDE_PATH:STRING=${PYTHONHOME}/include/python2.2"
-VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_LIBRARY:STRING=${PYTHONHOME}/lib/python2.2/config/libpython2.2.a"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_EXECUTABLE:STRING=${PYTHONHOME}/bin/python${python_version}"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_INCLUDE_PATH:STRING=${PYTHONHOME}/include/python${python_version}"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_LIBRARY:STRING=${PYTHONHOME}/lib/python${python_version}/config/libpython${python_version}.a"
### Wrap Tcl settings
VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_TCL:BOOL=ON"
VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_INCLUDE_PATH:STRING=${TCLHOME}/include"
-VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_LIBRARY:STRING=${TCLHOME}/lib/libtcl.so"
-VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtclstub.a"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_LIBRARY:STRING=${TCLHOME}/lib/libtcl${tcl_version}.so"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtclstub${tcl_version}.a"
VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_TCLSH:STRING=${TCLHOME}/bin/tclsh"
VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_INCLUDE_PATH:STRING=${TCLHOME}/include"
-VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_LIBRARY:STRING=${TCLHOME}/lib/libtk.so"
-VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtkstub.a"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_LIBRARY:STRING=${TCLHOME}/lib/libtk${tcl_version}.so"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtkstub${tcl_version}.a"
VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_WISH:STRING=${TCLHOME}/bin/wish"
### if Mesa is pre-installed
if [ -n "$MESA_HOME" ]; then
rm -fr ${PRODUCT_WORK} ${INSTALL_WORK}/cmake-1.6.6
# set correct symbolic links - bug of python wrappings installation
-cd ${PRODUCT_DIR}/lib/python2.2/site-packages/vtk_python
+cd ${PRODUCT_DIR}/lib/python${python_version}/site-packages/vtk_python
ln -sf ../../../vtk/*Python*.so .
print_env
check_version()
{
-if [ -n "$SIPDIR" ]; then
- check_lib_version sip ${SIPDIR}
- if [ "$?" -eq "0" ]; then
- check_lib_version libsip.so.9.1.0 ${SIPDIR}
- if [ "$?" -eq "0" ]; then
- return 0
- fi
+if [ -n "${SIPDIR}" ]; then
+ sip_ver=`${SIPDIR}/sip -V | awk '{print $1}'`
+ if [ "$sip_ver" == "3.3.2" ]; then
+ return 0
fi
fi
return 1
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export SIPDIR=\${INSTALL_ROOT}/${PRODUCT}
-export PYTHONPATH=\${SIPDIR}:\${PYTHONPATH}
export PATH=\${SIPDIR}:\${PATH}
+export PYTHONPATH=\${SIPDIR}:\${PYTHONPATH}
export LD_LIBRARY_PATH=\${SIPDIR}:\${LD_LIBRARY_PATH}
##
EOF
sipdir="`find_in_path sip /usr/bin`"
fi
if [ -n "${sipdir}" ] ; then
+ python_version="`python -c 'import sys; print sys.version[:3]'`"
sippython="`find_in_path libsip.so.9.1.0 ${PYTHONPATH}`"
if [ -z "${sippython}" ] ; then
- sippython="`find_in_path libsip.so.9.1.0 /usr/lib/python2.2/site-packages`"
+ sippython="`find_in_path libsip.so.9.1.0 /usr/lib/python${python_version}/site-packages`"
fi
if [ -n ${sippython} ]; then
tmp="${sipdir} ${sipdir} \${PATH} ${PATH}";
check_version()
{
if [ -n "${SIPDIR}" ]; then
- sip_ver=`${SIPDIR}/sip -V | awk '{print $1}' | sed "s/\./_/g"`
- if [ "$sip_ver" == "4_1" ]; then
+ sip_ver=`${SIPDIR}/sip -V | awk '{print $1}'`
+ if [ "$sip_ver" == "4.1" ]; then
return 0
fi
fi