install_source()
{
-echo "The installation of Python 2.3.4 from sources is not provided! Use native Python."
-return 1
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+makedir ${PRODUCT_DIR}
+
+check_jb tar xfz ${SOURCE_DIR}/Python-2.3.4.tar.gz -C ${INSTALL_WORK}
+cd ${PRODUCT_WORK}
+
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
+ ./configure --prefix=${PRODUCT_DIR} --with-threads --with-cxx=`which g++`
+# vsr: not compiled on RedHat8.0 without libstdc++.so
+sed -e 's%LIBS= -ldl -lpthread -lutil%LIBS= -ldl -lpthread -lutil -lstdc++%g' Makefile > _Makefile
+mv -f _Makefile Makefile
+# vsr: socket module is not compiled on RedHat9 because of absent KERBEROS include/libs flags
+sed -e "s%\[('USE_SSL',1)\]%\[('USE_SSL',1),('OPENSSL_NO_KRB5',None)\]%g" setup.py > _setup.py
+mv -f _setup.py setup.py
+GCC=`which gcc`
+cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
+used gcc=$GCC
+EOF
+
+check_job ${PRODUCT_DIR}/MAKE.LOG make
+check_job ${PRODUCT_DIR}/MAKINSTALL.LOG make install
+
+#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
+rm -fr ${PRODUCT_WORK}
+print_env
}
install_binary()
{
-echo "The installation of Python 2.3.4 from binaries is not provided! Use native gcc."
-return 1
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+check_jb tar xfz ${SOURCE_DIR}/Python-2.3.4.tar.gz -C ${INSTALL_ROOT}
+
+print_env
}
export PROCEDURE=$1;
+++ /dev/null
-#!/bin/sh
-
-check_version()
-{
-if [ -z "$PYTHONHOME" ]; then
- return 1
-fi
-isPython=`which python 2>/dev/null`
-if [ -n "$isPython" ]; then
- # version number is calculated as: <major>*10000+<minor>*100+<release>
- # for Python 2.3.5 it is equal to 20305
- ver=`python -V 2>&1`
- ver=`echo $ver | awk '{print $2}' | awk -F. '{v1=0;v2=0;v3=0;if(NF>0)v1=$1;if(NF>1)v2=$2;if(NF>2)v3=$3;print v1*10000+v2*100+v3}'`
- if [ $ver -eq 20305 ] ; then
- return 0
- fi
-fi
-return 1
-}
-
-print_env()
-{
-cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PYTHONHOME=\${INSTALL_ROOT}/${PRODUCT}
-export PATH=\${PYTHONHOME}/bin:\${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})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
-}
-
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-pythonhome="`find_in_path python ${PATH}`"
-if [ -z "${pythonhome}" ] ; then
- pythonhome="`find_in_path python /usr/bin`"
-fi
-if [ -n "${pythonhome}" ] ; then
- pythonhome=`cd ${pythonhome}/..; pwd`
- # get version number: <major>, <minor> and <release>
- # <major> and <minor> numbers are checked strickly, but <release> number can be larger than required one
- # version number is calculated as: <major>*10000+<minor>*100+<release>
- # for Python 2.3.5 it is equal to 20305
- ver=`python -V 2>&1`
- maj_ver=`echo $ver | awk '{print $2}' | awk -F. '{if(NF>0) print $1; else print 0}'`
- min_ver=`echo $ver | awk '{print $2}' | awk -F. '{if(NF>1) print $2; else print 0}'`
- rel_ver=`echo $ver | awk '{print $2}' | awk -F. '{if(NF>2) print $3; else print 0}'`
- let ver=$maj_ver*10000+$min_ver*100+$rel_ver
- if [ $ver -ge 20305 ] ; then
- tmp="\${PYTHONHOME}/bin ${pythonhome}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- 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 PATH=${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}"
-####### THIS COULD BE USED FOR STRICT COMPARISON ##############################
-# if [ $maj_ver -eq 2 ] && [ $min_ver -eq 3 ] && [ $rel_ver -eq 4 ] ; then
-######################################################################################
- if [ $maj_ver -eq 2 ] && [ $min_ver -eq 3 ] && [ $rel_ver -ge 4 ] ; then
- return 0
- else
- return 2
- fi
- fi
-fi
-return 1
-}
-
-try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
-return $?
-}
-
-install_source()
-{
-echo "The installation of Python 2.3.5 from sources is not provided!"
-return 1
-}
-
-install_binary()
-{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/$SHRC
-
-check_jb tar xfz ${SOURCE_DIR}/Python-2.3.5.tar.gz -C ${INSTALL_ROOT}
-
-print_env
-}
-
-export PROCEDURE=$1;
-export INSTALL_WORK=$2;
-export SOURCE_DIR=$3;
-export INSTALL_ROOT=$4;
-export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="python" ; fi
-export PRODUCT="Python-2.3.5"
-export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
-export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
-source ./common.sh
-${PROCEDURE}
\ No newline at end of file