return 1;
}
-print_env()
+print_env_bin()
{
-cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export BOOSTDIR=\${INSTALL_ROOT}/${PRODUCT}
export LD_LIBRARY_PATH=\${BOOSTDIR}/lib:\${LD_LIBRARY_PATH}
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-boostdir="`find_in_path version.hpp /usr/include/boost:/usr/share/include/boost`"
-if [ -n "${boostdir}" ] ; then
- boostdir=`cd ${boostdir}/../..; pwd`
- ls ${boostdir}/lib/libboost_thread* &> /dev/null
- if [ "$?" -ne "0" ] ; then
- return 1
- fi
- ver=`egrep 'BOOST_VERSION [0-9]+' ${boostdir}/include/boost/version.hpp | sed 's/.*BOOST_VERSION \([0-9]\+\)/\1/g'`
- if [ $ver -ge 103100 ] ; then
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export BOOSTDIR=${boostdir}
-export LD_LIBRARY_PATH=\${BOOSTDIR}/lib:\${LD_LIBRARY_PATH}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- if [ $ver -eq 103100 ] ; then
- return 0
- else
- return 2
- fi
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
-
# unpack
-check_jb tar xzf ${SOURCE_DIR}/boost-1.31.0.tar.gz -C ${INSTALL_WORK}
+check_jb tar xzf ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
-# build
GCC=`which gcc`
cat >> ${PRODUCT_DIR}/BUILD.LOG <<EOF
used gcc=$GCC
EOF
-cd ${PRODUCT_WORK}/tools/build/jam_src
+cd ${PRODUCT_DIR}_SRC/tools/build/jam_src
check_job ${PRODUCT_DIR}/BUILD.LOG ./build.sh
# apply patch to avoid conflicts with Qt signals
# VSR 07/03/06 : this is no more needed
-#cd ${PRODUCT_WORK}/boost/signals/detail
+#cd ${PRODUCT_DIR}_SRC/boost/signals/detail
#sed -e "s%# define BOOST_SIGNALS_NAMESPACE signals%# define BOOST_SIGNALS_NAMESPACE bsignals%g" \
# signals_common.hpp > signals_common.hpp.orig
#mv -f signals_common.hpp.orig signals_common.hpp
# install
-cd ${PRODUCT_WORK}
+cd ${PRODUCT_DIR}_SRC
python_root=`find_in_path python $PATH`;
python_root=`cd ${python_root}/..; pwd`
python_version=`python -c "import sys; print sys.version[:3]"`
echo "`pwd` -> ./tools/build/jam_src/bin.linuxx86/bjam >> ${PRODUCT_DIR}/INSTALL.LOG"
./tools/build/jam_src/bin.linuxx86/bjam "-sBOOST_ALL_DYN_LINK=1" \
"-sBUILD=release <runtime-link>dynamic <threading>multi" \
- --prefix=${PRODUCT_DIR} --builddir=${PRODUCT_WORK} \
+ --prefix=${PRODUCT_DIR} --builddir=${PRODUCT_DIR}_SRC \
"-sPYTHON_VERSION=$python_version" --with-python-root=${python_root} \
install >> ${PRODUCT_DIR}/INSTALL.LOG 2> $INSTALL_WORK/errlog
fi
done
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/boost-1.31.0.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="boost" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="boost-1.31.0"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1;
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-boostdir="`find_in_path version.hpp /usr/include/boost:/usr/share/include/boost`"
-if [ -n "${boostdir}" ] ; then
- boostdir=`cd ${boostdir}/../..; pwd`
- ls ${boostdir}/lib/libboost_thread* &> /dev/null
- if [ "$?" -ne "0" ] ; then
- return 1
- fi
- ver=`egrep 'BOOST_VERSION [0-9]+' ${boostdir}/include/boost/version.hpp | sed 's/.*BOOST_VERSION \([0-9]\+\)/\1/g'`
- if [ $ver -ge 103200 ] ; then
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export BOOSTDIR=${boostdir}
-export LD_LIBRARY_PATH=\${BOOSTDIR}/lib:\${LD_LIBRARY_PATH}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- if [ $ver -eq 103200 ] ; then
- return 0
- else
- return 2
- fi
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
-
# unpack
-check_jb tar xzf ${SOURCE_DIR}/boost-1.32.0.tar.gz -C ${INSTALL_WORK}
+check_jb tar xzf ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
-# build
GCC=`which gcc`
cat >> ${PRODUCT_DIR}/BUILD.LOG <<EOF
used gcc=$GCC
EOF
-cd ${PRODUCT_WORK}/tools/build/jam_src
+cd ${PRODUCT_DIR}_SRC/tools/build/jam_src
check_job ${PRODUCT_DIR}/BUILD.LOG ./build.sh
# apply patch to avoid conflicts with Qt signals
# VSR 07/03/06 : this is no more needed
-#cd ${PRODUCT_WORK}/boost/signals/detail
+#cd ${PRODUCT_DIR}_SRC/boost/signals/detail
#sed -e "s%# define BOOST_SIGNALS_NAMESPACE signals%# define BOOST_SIGNALS_NAMESPACE bsignals%g" \
# signals_common.hpp > signals_common.hpp.orig
#mv -f signals_common.hpp.orig signals_common.hpp
# install
-cd ${PRODUCT_WORK}
+cd ${PRODUCT_DIR}_SRC
python_root=`find_in_path python $PATH`;
python_root=`cd ${python_root}/..; pwd`
python_version=`python -c "import sys; print sys.version[:3]"`
echo "`pwd` -> ./tools/build/jam_src/${binfolder}/bjam >> ${PRODUCT_DIR}/INSTALL.LOG"
./tools/build/jam_src/${binfolder}/bjam "-sBOOST_ALL_DYN_LINK=1" \
"-sBUILD=release <runtime-link>dynamic <threading>multi" \
- --prefix=${PRODUCT_DIR} --builddir=${PRODUCT_WORK} \
+ --prefix=${PRODUCT_DIR} --builddir=${PRODUCT_DIR}_SRC \
"-sPYTHON_VERSION=$python_version" --with-python-root=${python_root} \
install >> ${PRODUCT_DIR}/INSTALL.LOG 2> $INSTALL_WORK/errlog
if test `uname -m` = "x86_64" ; then
cd ${PRODUCT_DIR}; ln -sf lib lib64
fi
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/boost-1.32.0.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="boost" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="boost-1.32.0"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-check_version
-if [ $? -eq 0 ] ; then
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export CASROOT=${CASROOT}
-export PATH=\${CASROOT}/bin:\${PATH}
-export LD_LIBRARY_PATH=\${CASROOT}/lib:\${CASROOT}/lin/lib:\${LD_LIBRARY_PATH}
-# Variable for Foundation Classes :
-export CSF_UnitsLexicon=\${CASROOT}/src/UnitsAPI/Lexi_Expr.dat
-export CSF_UnitsDefinition=\${CASROOT}/src/UnitsAPI/Units.dat
-# Variable for DataExchange :
-export CSF_SHMessage=\${CASROOT}/src/SHMessage
-export CSF_XSMessage=\${CASROOT}/src/XSMessage
-# Variable for Font :
-export CSF_MDTVFontDirectory=\${CASROOT}/src/FontMFT
-export CSF_MDTVTexturesDirectory=\${CASROOT}/src/Textures
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_preinstalled()
+{
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
-
# unpack
-check_jb tar xfz ${SOURCE_DIR}/CAS-6.2.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
# configure
+echo " +++++++++++ configure"
if test `uname -m` = "x86_64" ; then
flags="$flags CFLAGS=-m64 -D_OCC64"
flags="$flags CXXFLAGS=-m64 -D_OCC64"
if [ $? -eq 0 ] ; then flags="$flags --with-dps-include=$dpsdir/include --with-dps-library=$dpsdir/lib"; fi
flags="$flags --disable-debug --enable-production"
-export CASROOT=${PRODUCT_WORK}
+export CASROOT=${PRODUCT_DIR}_SRC
check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure $flags --prefix=${PRODUCT_DIR}
# make
+echo " +++++++++++ make"
GCC=`which gcc`
cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
used gcc=$GCC
check_job ${PRODUCT_DIR}/MAKE.LOG make -j4 install-strip
# copy includes
+echo " +++++++++++ copy includes"
cp -fr inc ${PRODUCT_DIR}
cp -f config.h ${PRODUCT_DIR}
(cd ${PRODUCT_DIR}/inc; ln -fs ../config.h config.h)
# copy resources
+echo " +++++++++++ copy resources"
makedir ${PRODUCT_DIR}/src
for d in UnitsAPI SHMessage FontMFT Textures XSMessage DrawResources ; do
cp -rp src/${d} ${PRODUCT_DIR}/src
(cd ${PRODUCT_DIR}; mkdir -p lin; cd lin; ln -fs ../lib lib; ln -fs ../bin bin)
# fix libGL dependencies
+echo " +++++++++++ fix libGL dependencies"
cd ${PRODUCT_DIR}/lib
gllibdir="`where_gl_libs`"
if [ "$gllibdir" != "" ] ; then
mv -f libTKOpenGl.la.new libTKOpenGl.la
fi
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/CAS-6.2.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# modify *.la files
ldir=${PRODUCT_DIR}/lib
mv -f libTKOpenGl.la.new libTKOpenGl.la
fi
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="cas" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="CAS-6.2"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
#
####################################################################################
+VERSION="3.2.6"
+
check_version(){
# No way to check version!
return 0
}
-print_env(){
+print_env_bin(){
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export HXX2SALOME_ROOT_DIR=\${INSTALL_ROOT}/${PRODUCT}/bin
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-HXX2SALOME_ROOT_DIR="`find_in_path hxx2salome ${PATH}`"
-if [ -n "${adir}" ] ; then
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export HXX2SALOME_ROOT_DIR=${HXX2SALOME_ROOT_DIR}
-export PATH=\${HXX2SALOME_ROOT_DIR}:\${PATH}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/HXX2SALOMEsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
-makedir ${PRODUCT_DIR}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
-check_jb tar xfz ${SOURCE_DIR}/HXX2SALOMEsourcesV3.2.6.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_SRC_DIR}
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Build configure...
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
+#du -sk ${PRODUCT_SRC_DIR} > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
+fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/HXX2SALOMEbinariesV3.2.6.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/HXX2SALOMEbinariesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="HXX2SALOME" ; fi
-export PRODUCT="HXX2SALOME_3.2.6"
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
+export PRODUCT="HXX2SALOME_${VERSION}"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
-export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
+export PRODUCT_SRC_DIR=${INSTALL_ROOT}/"HXX2SALOME_SRC_${VERSION}"
source ./common.sh
$PROCEDURE
#
####################################################################################
+VERSION="3.2.6"
+
check_version(){
# No way to check version!
return 0
}
-print_env(){
+print_env_bin(){
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
#nothing to do
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-try_native(){
-return 0
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
+##
+EOF
+(test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source(){
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/HXX2SALOMEDOCsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
-check_jb tar xfz ${SOURCE_DIR}/HXX2SALOMEDOCsourcesV3.2.6.tar.gz -C ${INSTALL_ROOT}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
-print_env
+install_source_and_build()
+{
+# install sources
+install_source
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary(){
-echo "Can't install binaries for ${PRODUCT}"
+echo "It's impossible to install ${PRODUCT} from binaries"
+
+# to generate environment scripts
+try_preinstalled
+
return 1
}
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="HXX2SALOMEDOC" ; fi
-export PRODUCT="HXX2SALOMEDOC_3.2.6"
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
+export PRODUCT="HXX2SALOMEDOC_${VERSION}"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
-export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
+export PRODUCT_SRC_DIR=${INSTALL_ROOT}/"HXX2SALOMEDOC_SRC_${VERSION}"
source ./common.sh
$PROCEDURE
return 1
}
-print_env(){
+print_env_bin(){
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
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})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-numpath=`python -c "import Numeric; print Numeric.__file__" 2>/dev/null`
-if [ -n "${numpath}" ] ; then
- numpath=`dirname ${numpath}`
- ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null | awk -F. '{v=0;for(i=1;i<=NF;i++)v=v*100+$i;print v}'`
- if [ $ver -ge 2200 ] ; then
- tmp="${numpath} ${numpath} \${PYTHONPATH} ${PYTHONPATH}";
- pythonpath=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PYTHONPATH=${pythonpath}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- if [ $ver -eq 2200 ] ; then
- return 0
- else
- return 2
- fi
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
-check_jb tar xfz ${SOURCE_DIR}/Numeric-22.0.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
check_job ${PRODUCT_DIR}/INSTALL.LOG python setup.py install --prefix=${PRODUCT_DIR}
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-check_jb tar xfz ${SOURCE_DIR}/Numeric-22.0.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="numeric" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="Numeric-22.0"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
#
####################################################################################
-check_version(){
+check_version()
+{
ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null`
if [ "$ver" == "23.7" ]; then
return 0
return 1
}
-print_env(){
+print_env_bin()
+{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
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})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-numpath=`python -c "import Numeric; print Numeric.__file__" 2>/dev/null`
-if [ -n "${numpath}" ] ; then
- numpath=`dirname ${numpath}`
- ver=`python -c 'import Numeric; print Numeric.__version__' 2>/dev/null | awk -F. '{v=0;for(i=1;i<=NF;i++)v=v*100+$i;print v}'`
- if [ $ver -ge 2307 ] ; then
- tmp="${numpath} ${numpath} \${PYTHONPATH} ${PYTHONPATH}";
- pythonpath=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PYTHONPATH=${pythonpath}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- if [ $ver -eq 2307 ] ; then
- return 0
- else
- return 2
- fi
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_preinstalled()
+{
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-makedir ${PRODUCT_DIR}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
-check_jb tar xfz ${SOURCE_DIR}/Numeric-23.7.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
if test `uname -m` = "x86_64" ; then
export CFLAGS=-m64
export CXXFLAGS=-m64
cd ${PRODUCT_DIR}; ln -sf lib64 lib
fi
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-check_jb tar xfz ${SOURCE_DIR}/Numeric-23.7.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="numeric" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="Numeric-23.7"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-# we need version 3.13 or newer
-try_native(){
-# check pyuic
-pyqtdir="`find_in_path pyuic ${PATH}:/usr/bin`"
-if [ -z "${pyqtdir}" ] ; then return 1 ; fi
-# check sip files
-pyqt_sips="`find_in_path qtmod.sip ${pyqtdir}/sip/qt:/usr/share/sip/qt:/usr/share/sip/qt/qt`"
-if [ -z "${pyqt_sips}" ] ; then return 1 ; fi
-pyqt_sips=`cd $pyqt_sips/.. ; pwd`
-# check configuration file
-python_version="`python -c 'import sys; print sys.version[:3]'`"
-pyqt_cfg="`find_in_path pyqtconfig.py ${pyqtdir}:/usr/lib/python${python_version}/site-packages`"
-if [ -z "${pyqt_cfg}" ] ; then return 1 ; fi
-# check library
-pyqt_lib="`find_in_path qt.so ${pyqtdir}:/usr/lib/python${python_version}/site-packages`"
-if [ -z "${pyqt_lib}" ] ; then return 1 ; fi
-# check version
-ver=`cd ${pyqt_cfg} && python -c "from pyqtconfig import Configuration; c=Configuration();print c.__getattr__('pyqt_version_str')" 2>/dev/null`
-if [ -n "$ver" ] ; then
- maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- let ver=$maj_ver*10000+$min_ver*100+$rel_ver
- # version number should be at least 3.13
- if [ $ver -ge 031300 ] ; then
- tmp="${pyqtdir} ${pyqtdir} \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="${pyqt_lib} ${pyqt_lib} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- tmp="${pyqt_cfg} ${pyqt_cfg} \${PYTHONPATH} ${PYTHONPATH}";
- pythonpath=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PYQT_SIPS=${pyqt_sips}
-export PATH=${path}
-export PYTHONPATH=${pythonpath}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
-check_jb tar xfz ${SOURCE_DIR}/PyQt-3.13.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
sed -e 's%check_license()$%#check_license()%g' configure.py > configure.py.new
mv -f configure.py.new configure.py
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/PyQt-3.13.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# modify pyqtconfig.py file
cd ${PRODUCT_DIR}
sed -e "s%\('pyqt_sip_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/sip',%g" pyqtconfig.py > pyqtconfig.py.1
mv pyqtconfig.py.1 pyqtconfig.py
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="pyqt" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="PyQt-3.13"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-# we need version 3.13 or newer
-try_native(){
-# check pyuic
-pyqtdir="`find_in_path pyuic ${PATH}:/usr/bin`"
-if [ -z "${pyqtdir}" ] ; then return 1 ; fi
-# check sip files
-pyqt_sips="`find_in_path qtmod.sip ${pyqtdir}/sip/qt:/usr/share/sip/qt:/usr/share/sip/qt/qt`"
-if [ -z "${pyqt_sips}" ] ; then return 1 ; fi
-pyqt_sips=`cd $pyqt_sips/.. ; pwd`
-# check configuration file
-python_version="`python -c 'import sys; print sys.version[:3]'`"
-if test `uname -m` = "x86_64" ; then
-pyqt_cfg="`find_in_path pyqtconfig.py ${pyqtdir}:/usr/lib64/python${python_version}/site-packages`"
-else
-pyqt_cfg="`find_in_path pyqtconfig.py ${pyqtdir}:/usr/lib/python${python_version}/site-packages`"
-fi
-if [ -z "${pyqt_cfg}" ] ; then return 1 ; fi
-# check library
-if test `uname -m` = "x86_64" ; then
-pyqt_lib="`find_in_path qt.so ${pyqtdir}:/usr/lib64/python${python_version}/site-packages`"
-else
-pyqt_lib="`find_in_path qt.so ${pyqtdir}:/usr/lib/python${python_version}/site-packages`"
-fi
-if [ -z "${pyqt_lib}" ] ; then return 1 ; fi
-# check version
-ver=`cd ${pyqt_cfg} && python -c "from pyqtconfig import Configuration; c=Configuration();print c.__getattr__('pyqt_version_str')" 2>/dev/null`
-if [ -n "$ver" ] ; then
- maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- let ver=$maj_ver*10000+$min_ver*100+$rel_ver
- # version number should be at least 3.13
- if [ $ver -ge 031300 ] ; then
- tmp="${pyqtdir} ${pyqtdir} \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="${pyqt_lib} ${pyqt_lib} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- tmp="${pyqt_cfg} ${pyqt_cfg} \${PYTHONPATH} ${PYTHONPATH}";
- pythonpath=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PYQT_SIPS=${pyqt_sips}
-export PATH=${path}
-export PYTHONPATH=${pythonpath}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-check_jb tar xfz ${SOURCE_DIR}/PyQt-3.14.1.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
if test `uname -m` = "x86_64" ; then
export CFLAGS=-m64 CXXFLAGS=-m64
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/PyQt-3.14.1.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# modify pyqtconfig.py file
cd ${PRODUCT_DIR}
sed -e "s%\('pyqt_sip_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/sip',%g" pyqtconfig.py > pyqtconfig.py.1
mv pyqtconfig.py.1 pyqtconfig.py
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="pyqt" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="PyQt-3.14.1"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# 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>
- # e.g. for Python 2.3.4 it is equal to 20304
- 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 20304 ] ; 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}`
- tmp="\${PYTHONHOME}/lib ${pythonhome}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PYTHONHOME=${pythonhome}
-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}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
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
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-check_jb tar xfz ${SOURCE_DIR}/Python-2.3.4.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+cd ${PRODUCT_DIR}_SRC
+makedir ${PRODUCT_DIR}
check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
./configure --prefix=${PRODUCT_DIR} --with-threads --with-cxx=`which g++` --enable-shared
chmod a+x "$sc"
fi
done
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/Python-2.3.4.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
(cd ${PRODUCT_DIR}/lib/python2.3/config; ln -fs ../../libpython2.3.so.1.0 libpython2.3.so)
fi
done
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
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_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="Python-2.3.4"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# 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>
- # e.g. 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}`
- tmp="\${PYTHONHOME}/lib ${pythonhome}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PYTHONHOME=${pythonhome}
-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}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
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 5 ] ; then
- return 0
- else
- return 2
- fi
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-check_jb tar xfz ${SOURCE_DIR}/Python-2.3.5.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
./configure --prefix=${PRODUCT_DIR} --with-threads --with-cxx=`which g++` --enable-shared
fi
done
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/Python-2.3.5.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
(cd ${PRODUCT_DIR}/lib/python2.3/config; ln -fs ../../libpython2.3.so.1.0 libpython2.3.so)
fi
done
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
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_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="Python-2.3.5"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# 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.4.1 it is equal to 20401
- 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 20401 ] ; 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}`
- tmp="\${PYTHONHOME}/lib ${pythonhome}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PYTHONHOME=${pythonhome}
-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}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
-####### THIS COULD BE USED FOR STRICT COMPARISON ##############################
-# if [ $maj_ver -eq 2 ] && [ $min_ver -eq 4 ] && [ $rel_ver -eq 1 ] ; then
-######################################################################################
- if [ $maj_ver -eq 2 ] && [ $min_ver -eq 4 ] && [ $rel_ver -ge 1 ] ; then
- return 0
- else
- return 2
- fi
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
-
if test `uname -m` = "x86_64" ; then
export PYTHON_ARCHIVE_PREFIX="-lib64"
export PYTHON_LIB_PREFIX="64"
PYTHON_CONFIGURE_OPTIONS="--with-threads --with-cxx=`which g++` --enable-shared"
fi
-check_jb tar xfz ${SOURCE_DIR}/Python-2.4.1${PYTHON_ARCHIVE_PREFIX}.tar.gz -C ${INSTALL_WORK}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}${PYTHON_ARCHIVE_PREFIX}.tar.gz -C ${INSTALL_ROOT}
# apply patch for 64-bit platforms
if test `uname -m` = "x86_64" ; then
if [ -f patches/Python-2.4.1-lib64.patch ] ; then
- cp patches/Python-2.4.1-lib64.patch ${PRODUCT_WORK}
- ( cd ${PRODUCT_WORK} ; \
+ cp patches/Python-2.4.1-lib64.patch ${PRODUCT_DIR}_SRC
+ ( cd ${PRODUCT_DIR}_SRC ; \
patch -p1 < Python-2.4.1-lib64.patch ; \
rm -rf aclocal.m4 ; \
aclocal >& /dev/null ; \
fi
fi
-cd ${PRODUCT_WORK}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
./configure --prefix=${PRODUCT_DIR} $PYTHON_CONFIGURE_OPTIONS
( cd ${PRODUCT_DIR}; ln -sf lib64 lib )
fi
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/Python-2.4.1.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
(cd ${PRODUCT_DIR}/lib/python2.4/config; ln -fs ../../libpython2.4.so.1.0 libpython2.4.so)
fi
done
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
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_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="Python-2.4.1"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 0
}
-print_env(){
-cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export DATA_DIR=\${INSTALL_ROOT}/${PRODUCT}
-##
-EOF
-(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+print_env_bin(){
+return 1
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-check_version
-if [ $? -eq 0 ] ; then
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export DATA_DIR=\${INSTALL_ROOT}/${PRODUCT}
+print_env_src(){
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+export DATA_DIR=\${INSTALL_ROOT}/${PRODUCT}_SRC
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/SAMPLESsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SRC_DIR}/SAMPLESsourcesV${VERSION}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_source_and_build()
install_binary()
{
-return 1
+install_source
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="SAMPLES" ; fi
-export PRODUCT="SAMPLES_SRC_${VERSION}"
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+SRC_DIR=$8;
+export PRODUCT="SAMPLES_${VERSION}"
+export PRODUCT_SRC="SAMPLES_SRC_${VERSION}"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
-export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
+export PRODUCT_SRC_DIR=${INSTALL_ROOT}/${PRODUCT_SRC}
source ./common.sh
$PROCEDURE
return 1;
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-swig_root="`find_in_path swig ${PATH}`"
-if [ -z "${swig_root}" ] ; then
- swig_root="`find_in_path swig /usr/bin`"
-fi
-if [ -n "${swig_root}" ] ; then
- swig_root=`cd ${swig_root}/..; pwd`
- ver=`swig -version 2>&1 | grep -i version | awk '{ print $3 }' | sed -e 's/^\([0-9.]*\)\(.*\)/\1/'`
- if [ "$ver" == "1.3.24" ] ; then
- tmp="\${SWIG_ROOT}/bin ${swig_root}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export SWIG_ROOT=${swig_root}
-export PATH=${path}
-#
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
+##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0;
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
+check_jb tar xfz ${SRC_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
if test `uname -m` = "x86_64" ; then
export CFLAGS=-m64
export CXXFLAGS=-m64
fi
-check_jb tar xfz ${SOURCE_DIR}/swig-1.3.24.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+cd ${PRODUCT_DIR}_SRC
makedir ${PRODUCT_DIR}
check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-echo "It impossible to install SWIG 1.3.24 from binaries, try to install it from sources."
-return 1
+echo "It impossible to install ${PRODUCT} from binaries! So this one will be build from sources."
+install_source_and_build
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="swig" ; fi
-export PRODUCT="SWIG-1.3.24"
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+SRC_DIR=$8;
+shift
+REMOVE_SRC_TMP=$8;
+export PRODUCT="swig-1.3.24"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
source ./common.sh
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-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/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
-export VTKHOME=${VTKHOME}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
-export PYTHONPATH=${python_path}
-export TCLLIBPATH="\${VTKHOME}/lib/vtk/tcl \${TCLLIBPATH}"
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
-return $?
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
+eturn $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+makedir ${PRODUCT_DIR}_SRC
+
+check_jb tar xfz ${SOURCE_DIR}/cmake-1.6.6.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}_SRC
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
-check_jb tar xfz ${SOURCE_DIR}/cmake-1.6.6.tar.gz -C ${INSTALL_WORK}
-cd ${INSTALL_WORK}/cmake-1.6.6
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC/cmake-1.6.6_SRC
check_job ${PRODUCT_DIR}/CONFIGUREcmake.LOG ./configure
cat >> ${PRODUCT_DIR}/MAKEcmake.LOG <<EOF
used gcc=$GCC
EOF
check_job ${PRODUCT_DIR}/MAKEcmake.LOG make
-check_jb tar xfz ${SOURCE_DIR}/VTK-4.2-LatestRelease.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
# get Python and tcl/tk version
python_version="`python -c 'import sys; print sys.version[:3]'`"
used VTK settings:
$VTK_CMAKE_OPTIONS
EOF
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ${INSTALL_WORK}/cmake-1.6.6/Source/cmake . $VTK_CMAKE_OPTIONS
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ${PRODUCT_DIR}_SRC/cmake-1.6.6_SRC/Source/cmake . $VTK_CMAKE_OPTIONS
cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
used gcc=$GCC
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
-cd ${PRODUCT_WORK}/Wrapping/Python
+cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC/Wrapping/Python
check_job ${PRODUCT_DIR}/SETUPPYTHON.LOG python setup.py install --prefix=${PRODUCT_DIR}
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-#du -sk ${INSTALL_WORK}/cmake-1.6.6 >> ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK} ${INSTALL_WORK}/cmake-1.6.6
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
# set correct symbolic links - bug of python wrappings installation
cd ${PRODUCT_DIR}/lib/python${python_version}/site-packages/vtk_python
ln -sf ../../../vtk/*Python*.so .
-print_env
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/VTK-4.2.2.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="vtk" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="VTK-4.2.2"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-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/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
-export VTKHOME=${VTKHOME}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
-export PYTHONPATH=${python_path}
-export TCLLIBPATH="\${VTKHOME}/lib/vtk/tcl \${TCLLIBPATH}"
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+makedir ${PRODUCT_DIR}_SRC
-check_jb tar xfz ${SOURCE_DIR}/cmake-1.6.6.tar.gz -C ${INSTALL_WORK}
-check_jb tar xfz ${SOURCE_DIR}/VTK-4.2.6.tar.gz -C ${INSTALL_WORK}
+check_jb tar xfz ${SOURCE_DIR}/cmake-1.6.6.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}_SRC
# apply patches for 64-bit platforms
if test `uname -m` = "x86_64" ; then
if [ -f patches/cmake-1.6.6-lib64.patch ] ; then
- cp patches/cmake-1.6.6-lib64.patch ${INSTALL_WORK}/cmake-1.6.6
- ( cd ${INSTALL_WORK}/cmake-1.6.6 ; patch -p1 < cmake-1.6.6-lib64.patch )
+ cp patches/cmake-1.6.6-lib64.patch ${PRODUCT_DIR}_SRC/cmake-1.6.6_SRC
+ ( cd ${PRODUCT_DIR}_SRC/cmake-1.6.6_SRC ; patch -p1 < cmake-1.6.6-lib64.patch )
fi
if [ -f patches/vtk-4.2.6-lib64.patch ] ; then
- cp patches/vtk-4.2.6-lib64.patch ${PRODUCT_WORK}
- ( cd ${PRODUCT_WORK} ; patch -p1 < vtk-4.2.6-lib64.patch )
+ cp patches/vtk-4.2.6-lib64.patch ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
+ ( cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC ; patch -p1 < vtk-4.2.6-lib64.patch )
fi
fi
# apply patch: fix pb with importing Python vtk modules on some platforms
if [ -f patches/vtk-4.2.6-patented.patch ] ; then
- cp patches/vtk-4.2.6-patented.patch ${PRODUCT_WORK}
- ( cd ${PRODUCT_WORK} ; patch -p1 < vtk-4.2.6-patented.patch )
+ cp patches/vtk-4.2.6-patented.patch ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
+ ( cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC ; patch -p1 < vtk-4.2.6-patented.patch )
+fi
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
-cd ${INSTALL_WORK}/cmake-1.6.6
+# build sources
+makedir ${PRODUCT_DIR}
+
+cd ${PRODUCT_DIR}_SRC/cmake-1.6.6_SRC
check_job ${PRODUCT_DIR}/CONFIGUREcmake.LOG ./configure
cat >> ${PRODUCT_DIR}/MAKEcmake.LOG <<EOF
EOF
check_job ${PRODUCT_DIR}/MAKEcmake.LOG make
-cd ${PRODUCT_WORK}
+cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
# apply a small patch for VTK (needed for gcc-3.4)
sed -e "s%seekg(self->GetFile()->tellg()%seekg(static_cast<long>(self->GetFile()->tellg())%g" IO/vtkBMPReader.cxx > IO/vtkBMPReader.cxx.orig
used VTK settings:
$VTK_CMAKE_OPTIONS
EOF
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ${INSTALL_WORK}/cmake-1.6.6/Source/cmake . $VTK_CMAKE_OPTIONS
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ${PRODUCT_DIR}_SRC/cmake-1.6.6_SRC/Source/cmake . $VTK_CMAKE_OPTIONS
cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
used gcc=$GCC
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
-cd ${PRODUCT_WORK}/Wrapping/Python
+cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC/Wrapping/Python
check_job ${PRODUCT_DIR}/SETUPPYTHON.LOG python setup.py install --prefix=${PRODUCT_DIR}
cd ${PRODUCT_DIR}; ln -s lib64 lib
fi
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-#du -sk ${INSTALL_WORK}/cmake-1.6.6 >> ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK} ${INSTALL_WORK}/cmake-1.6.6
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
if [ -n "$MESA_HOME" ]; then
- check_jb tar xfz ${SOURCE_DIR}/VTK-4.2.6-with-Mesa.tar.gz -C ${INSTALL_ROOT}
+ check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}_with_Mesa.tar.gz -C ${INSTALL_ROOT}
else
- check_jb tar xfz ${SOURCE_DIR}/VTK-4.2.6.tar.gz -C ${INSTALL_ROOT}
+ check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
fi
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="vtk" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="VTK-4.2.6"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
touch ${install_work}/$i
done
-if [ $# -eq 3 ] ; then
- product_name=$3;
+if [ $# -eq 4 ] ; then
+ product_name=$4;
product_env=${install_work}/env_${product_name}.sh
(test -e ${product_env} && rm ${product_env} )
fi
# 1. first dump all environment files into the $SHRC file
product_sequence="$2"
+install_products="$3"
for i in $product_sequence ; do
env_file=${install_work}/env_${i}.sh
- ( test -e $env_file && cat $env_file >> ${install_work}/$SHRC 2>/dev/null )
+ _env_file=${install_work}/_env_${i}.sh
+ if [ -e $_env_file ] ; then
+ cat $_env_file >> ${install_work}/$SHRC 2>/dev/null
+ elif [ -e $env_file ] ; then
+ echo $install_products | grep -q "\b${i}\b"
+ if [ $? -eq 1 ] ; then
+ cat $env_file | sed 's/^/## /' >> ${install_work}/$SHRC 2>/dev/null
+ else
+ cat $env_file >> ${install_work}/$SHRC 2>/dev/null
+ fi
+ fi
done
# 2. writing global functions to _salome.sh file
rm -f ${INSTALL_WORK}/_tmp1 ${INSTALL_WORK}/_tmp2
-if [ $# -eq 4 ] ; then
- product_dir=$4
+if [ $# -eq 5 ] ; then
+ product_dir=$5
if [ -e ${product_dir} ] ; then
- cp -f ${install_work}/_$SHRC ${product_dir}/$SHRC
- cp -f ${install_work}/_$CSHRC ${product_dir}/$CSHRC
+ test -e ${product_dir}/$SHRC && mv ${product_dir}/$SHRC ${product_dir}/${SHRC}_`date +%F_%T`
+ cp ${install_work}/_$SHRC ${product_dir}/$SHRC
+ test -e ${product_dir}/$CSHRC && mv ${product_dir}/$CSHRC ${product_dir}/${CSHRC}_`date +%F_%T`
+ cp ${install_work}/_$CSHRC ${product_dir}/$CSHRC
fi
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
+#test -e ${install_root}/env_products.csh && mv ${install_root}/env_products.csh ${install_root}/env_products.csh_`date +%F_%T`
cp -f ${install_work}/_$CSHRC ${install_root}/env_products.csh
+#test -e ${install_root}/env_products.sh && mv ${install_root}/env_products.sh ${install_root}/env_products.sh_`date +%F_%T`
cp -f ${install_work}/_$SHRC ${install_root}/env_products.sh
rm -f ${install_work}/_$SHRC ${install_work}/_$CSHRC
### !!! copying build.csh and build.sh scripts
if [ -e ./build.csh ]; then
+ #test -e ${install_root}/build.csh && mv ${install_root}/build.csh ${install_root}/build.csh_`date +%F_%T`
cp -f ./build.csh ${install_root}
fi
if [ -e ./build.sh ]; then
+ #test -e ${install_root}/build.sh && mv ${install_root}/build.sh ${install_root}/build.sh_`date +%F_%T`
cp -f ./build.sh ${install_root}
fi
### !!! copying release notes
#try use already existing product
try_existing()
{
-product_dir=$1; install_root=$2; install_work=$3; product_sequence="$4"; product_type=$5
+product_dir=$1; install_root=$2; install_work=$3;
+product_sequence="$4"; installed_products="$5"; product_type=$6
env_file=${product_dir}/env_${product_type}.sh
if [ -f ${env_file} ] ; then
- cp -f ${env_file} ${install_work}
- make_env ${install_root} ${install_work} "${product_sequence}"
+# cp -f ${env_file} ${install_work}
+ cp -f ${env_file} ${install_work}/_env_${product_type}.sh
+ make_env ${install_root} ${install_work} "${product_sequence}" "${installed_products}"
source ${install_work}/$SHRC
check_version
if [ $? -eq 0 ] ; then
- if [ -d ${product_dir} ] && [ -w ${product_dir} ] ; then
- #makedir ${product_dir}
- print_env
- return 0
- fi
- else
- rm -f ${install_work}/env_${product_type}.sh
- make_env ${install_root} ${install_work} "${product_sequence}"
+ return 0
fi
fi
-return 1;
+echo ${product_type} | grep -q '_src$'
+if [ $? -eq 1 ] ; then
+ print_env_bin
+else
+ print_env_src
+fi
+return 0
}
#check existance of lib passed as first parameter
return 0
}
-print_env(){
+print_env_bin(){
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
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})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-try_native(){
-return 1
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
+##
+EOF
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-check_jb tar xfz ${SOURCE_DIR}/docutils-0.3.7.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK} ; python setup.py install --prefix=${PRODUCT_DIR}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC ; python setup.py install --prefix=${PRODUCT_DIR}
cd ${PRODUCT_DIR}/bin;
cd ${PRODUCT_DIR}; ln -sf lib64 lib
fi
-rm -fr ${PRODUCT_WORK}
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/docutils-0.3.7.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
cd ${PRODUCT_DIR}/bin;
sed -e "s%#\!.*python%#\!/usr/bin/env python%" rst2latex.py > _rst2latex.py
chmod a+x rst2html.py
ln -sf rst2html.py rst2html
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="docutils" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="docutils-0.3.7"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-# we need version 1.4.4 or newer
-try_native(){
-doxyhome="`find_in_path doxygen ${PATH}:/usr/bin`"
-if [ -n "${doxyhome}" ] ; then
- ver=`doxygen --version`
- maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- let ver=$maj_ver*10000+$min_ver*100+$rel_ver
- if [ $ver -ge 10404 ] ; then
- tmp="${doxyhome} ${doxyhome} \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PATH=${path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/doxygen-1.4.6.tar.gz -C ${INSTALL_WORK}
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
-cd ${PRODUCT_WORK}
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+cd ${PRODUCT_DIR}_SRC
makedir ${PRODUCT_DIR}
# vsr: fix a bug on Mandrake-10.1: wrong qt library reference
sed -e "s/-lqt$/-lqt-mt/g" ./tmake/lib/linux-g++/tmake.conf > ./tmake/lib/linux-g++/tmake.conf.new
#EOF
#fi
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/doxygen-1.4.6.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="doxygen" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="doxygen-1.4.6"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
GCC_VERSION_REL=`echo $GCC_VERSION | awk -F[.-] '{if(NF>2) print $3; else print 0}'`
let GCC_VERSION_ID=$GCC_VERSION_MAJ*10000+$GCC_VERSION_MIN*100+$GCC_VERSION_REL
-check_version(){
+check_version()
+{
# version number is calculated as: <major>*10000+<minor>*100+<release>
# e.g. for gcc 3.2 it is equal to 30200, for gcc 3.3.2 - 30202
gcc_ver=`gcc -dumpversion | 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}'`
return 1
}
-print_env(){
-cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export GCC_ROOT=\${INSTALL_ROOT}/${PRODUCT}
-export CXX=\${GCC_ROOT}/bin/g++
-export CC=\${GCC_ROOT}/bin/gcc
-export PATH=\${GCC_ROOT}/bin:\${PATH}
-export LD_LIBRARY_PATH=\${GCC_ROOT}/lib:\${LD_LIBRARY_PATH}
-##
-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(){
gcc_root="`where_gcc $GCC_VERSION`"
export LD_LIBRARY_PATH=${ld_library_path}
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+ make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
####### THIS COULD BE USED FOR STRICT COMPARISON ##############################
# if [ $maj_ver -eq 3 ] && [ $min_ver -eq 2 ] && [ $rel_ver -eq 0 ] ; then
######################################################################################
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
-return $?
-}
-
-install_source()
-{
-echo "The installation of gcc $GCC_VERSION from sources is not provided! Use native gcc."
-return 1
-}
-
-install_binary()
-{
-echo "It impossible to install gcc $GCC_VERSION from binaries, try install from sources."
-return 1
+echo "It is impossible to install gcc from binaries or sources! So native gcc will be used."
+try_native
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="gcc" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
export PRODUCT="gcc-$GCC_VERSION"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-check_version
-if [ $? -eq 0 ] ; then
- dot="`find_in_path dot ${PATH}`"
- dot=`cd ${dot}/..; pwd`
- tmp="${dot}/bin ${dot}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="${dot}/lib/graphviz ${dot}/lib/graphviz \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}""${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/graphviz-1.9.tar.gz -C ${INSTALL_WORK}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
-cd ${PRODUCT_WORK}
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+cd ${PRODUCT_DIR}_SRC
makedir ${PRODUCT_DIR}
+
check_job ${PRODUCT_DIR}/CONFIGURE.LOG configure --prefix=${PRODUCT_DIR} --with-tcl=${TCLHOME} --disable-rpath
GCC=`which gcc`
cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/graphviz-1.9.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
cd ${PRODUCT_DIR}/lib/graphviz
for l in `ls *.la`; do
libdir=`grep -e "libdir=.*" $l | sed -e "s/libdir=[\'|\"]\(.*\)[\'|\"]/\1/g"`
chmod a+x $l
done
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="graphviz" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="graphviz-1.9"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-dothome="`find_in_path dot ${PATH}:/usr/bin`"
-if [ -n "${dothome}" ] ; then
- ver=`dot -V 2>&1 | awk '{print $3}'`
- maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- let ver=$maj_ver*10000+$min_ver*100+$rel_ver
- if [ $ver -ge 20201 ] ; then
- dothome=`cd ${dothome}/..; pwd`
- tmp="${dothome}/bin ${dothome}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="${dothome}/lib/graphviz ${dothome}/lib/graphviz \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/graphviz-2.2.1.tar.gz -C ${INSTALL_WORK}
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
-cd ${PRODUCT_WORK}
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+cd ${PRODUCT_DIR}_SRC
makedir ${PRODUCT_DIR}
if test `uname -m` = "x86_64" ; then
check_job ${PRODUCT_DIR}/CONFIGURE.LOG configure --prefix=${PRODUCT_DIR} --with-expatlibdir=/usr/lib64 --with-tcl=${TCLHOME} --disable-rpath CFLAGS=-m64 CXXFLAGS=-m64
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/graphviz-2.2.1.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
cd ${PRODUCT_DIR}/lib/graphviz
for l in `ls *.la`; do
libdir=`grep -e "libdir=.*" $l | sed -e "s/libdir=[\'|\"]\(.*\)[\'|\"]/\1/g"`
chmod a+x $l
done
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="graphviz" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="graphviz-2.2.1"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-hdfdir="`find_in_path libhdf5.so ${LD_LIBRARY_PATH}:/usr/lib`"
-if [ -z "${hdfdir}" ] ; then return 1 ; fi
-if [ -f ${hdfdir}/libhdf5.settings ]; then
- ver=`grep "HDF5 Version:" ${hdfdir}/libhdf5.settings | awk '{print $3}'`
- if [ "$ver" == "1.6.3" ]; then
- hdfdir=`cd ${hdfdir}/..; pwd`
- tmp="\${HDF5HOME}/bin ${hdfdir}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${HDF5HOME}/lib ${hdfdir}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export HDF5HOME=${hdfdir}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/hdf5-1.6.3.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+cd ${PRODUCT_DIR}_SRC
makedir ${PRODUCT_DIR}
check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
./configure --prefix=${PRODUCT_DIR} -disable-debug --enable-production --enable-threadsafe --enable-hdf5v1_2 \
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/hdf5-1.6.3.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
### modify libhdf5.la file to correct direct path to hdf5 library
### no need to do this for sources installation because 'make install' does it!
sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libhdf5.la > libhdf5.la.new
mv -f libhdf5.la.new libhdf5.la
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="hdf" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="hdf5-1.6.3"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-hdfdir="`find_in_path libhdf5.so ${LD_LIBRARY_PATH}:/usr/lib`"
-if [ -z "${hdfdir}" ] ; then return 1 ; fi
-if [ -f ${hdfdir}/libhdf5.settings ]; then
- ver=`grep "HDF5 Version:" ${hdfdir}/libhdf5.settings | awk '{print $3}'`
- if [ "$ver" == "1.6.4" ]; then
- hdfdir=`cd ${hdfdir}/..; pwd`
- tmp="\${HDF5HOME}/bin ${hdfdir}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${HDF5HOME}/lib ${hdfdir}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export HDF5HOME=${hdfdir}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
+
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
if test `uname -m` = "x86_64" ; then
HDF_CONFIGURE_OPTIONS="-disable-debug --enable-production --enable-threadsafe --enable-hdf5v1_2 --enable-stream-vfd --disable-hsizet --with-pthread=/usr/include,/usr/lib CFLAGS=-m64 CXXFLAGS=-m64"
else
HDF_CONFIGURE_OPTIONS="-disable-debug --enable-production --enable-threadsafe --enable-hdf5v1_2 --enable-stream-vfd --disable-hsizet --with-pthread=/usr/include,/usr/lib"
fi
-check_jb tar xfz ${SOURCE_DIR}/hdf5-1.6.4.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+
+cd ${PRODUCT_DIR}_SRC
makedir ${PRODUCT_DIR}
check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
./configure --prefix=${PRODUCT_DIR} $HDF_CONFIGURE_OPTIONS
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/hdf5-1.6.4.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
### modify libhdf5.la file to correct direct path to hdf5 library
### no need to do this for sources installation because 'make install' does it!
mv -f libhdf5_hl.la.new libhdf5_hl.la
fi
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="hdf" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="hdf5-1.6.4"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-check_version
-if [ $? -eq 0 ] ; then
- tmp="\${MED2HOME}/bin ${MED2HOME}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${MED2HOME}/lib ${MED2HOME}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export MED2HOME=${MED2HOME}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/med_fichier2.2.3.src.tar.gz -C ${INSTALL_WORK}
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
-cd ${PRODUCT_WORK}
+# build sources
+cd ${PRODUCT_DIR}_SRC
makedir ${PRODUCT_DIR}
#vsr: provide additional flags for f95 (Mandriva 2006.0, Fedora Core 4)
if [ $is_mandriva == 1 ] || [ $is_fedora == 1 ] ; then
if test `uname -m` = "x86_64" ; then
echo "`pwd` -> ./configure --prefix=${PRODUCT_DIR} FFLAGS='-g -O2 -ffixed-line-length-none' CFLAGS=-m64 CXXFLAGS=-m64 >> ${PRODUCT_DIR}/CONFIGURE.LOG"
- ./configure --prefix=${PRODUCT_DIR} FFLAGS="-g -O2 -ffixed-line-length-none" CFLAGS=-m64 CXXFLAGS=-m64 >> ${PRODUCT_DIR}/CONFIGURE.LOG 2> ${INSTALL_WORK}/errlog
+ ./configure --prefix=${PRODUCT_DIR} FFLAGS="-g -O2 -ffixed-line-length-none" CFLAGS=-m64 CXXFLAGS=-m64 >> ${PRODUCT_DIR}/CONFIGURE.LOG 2> ${PRODUCT_DIR}_SRC/errlog
else
echo "`pwd` -> ./configure --prefix=${PRODUCT_DIR} FFLAGS='-g -O2 -ffixed-line-length-none' >> ${PRODUCT_DIR}/CONFIGURE.LOG"
- ./configure --prefix=${PRODUCT_DIR} FFLAGS="-g -O2 -ffixed-line-length-none" >> ${PRODUCT_DIR}/CONFIGURE.LOG 2> ${INSTALL_WORK}/errlog
+ ./configure --prefix=${PRODUCT_DIR} FFLAGS="-g -O2 -ffixed-line-length-none" >> ${PRODUCT_DIR}/CONFIGURE.LOG 2> ${PRODUCT_DIR}_SRC/errlog
fi
if [ "$?" -ne "0" ] ; then
cat ${PRODUCT_DIR}/CONFIGURE.LOG
- cat ${INSTALL_WORK}/errlog >&2
- cat ${INSTALL_WORK}/errlog >> ${PRODUCT_DIR}/CONFIGURE.LOG
+ cat ${PRODUCT_DIR}_SRC/errlog >&2
+ cat ${PRODUCT_DIR}_SRC/errlog >> ${PRODUCT_DIR}/CONFIGURE.LOG
exit 1
fi
else
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
### modify libmed.la libmedC.la files to correct direct path to hdf5 library
cd ${PRODUCT_DIR}/lib
chmod 755 libmed.la
chmod 755 libmedC.la
-print_env
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/med-2.2.3.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
### modify libmed.la libmedC.la files to correct direct path to hdf5 library
### also modify libmed.la and libmedC.la files to correct direct path to med libraries
mv _xmdump xmdump
chmod a+x xmdump
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="med" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="med-2.2.3"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
-export PRODUCT_WORK=${INSTALL_WORK}/med_fichier2.2.3.src
+export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
source ./common.sh
$PROCEDURE
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-msg2qmroot="`find_in_path msg2qm ${PATH}`"
-if [ -n "${msg2qmroot}" ] ; then
- tmp="\${MSG2QM_ROOT} ${msg2qmroot} \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export MSG2QM_ROOT=${msg2qmroot}
-export PATH=${path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_preinstalled()
+{
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/msg2qm.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
qmake msg2qm.pro -o Makefile
check_job ${PRODUCT_DIR}/MAKE.LOG make
cp -f msg2qm ${PRODUCT_DIR}
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -rf ${PRODUCT_WORK}
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/msg2qm.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="msg2qm" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="msg2qm"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-check_version
-if [ $? -eq 0 ] ; then
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export NETGENHOME=\${NETGENROOT}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-
-makedir ${PRODUCT_DIR}
-
-check_jb tar xfz ${SOURCE_DIR}/netgen-4.5.tar.gz -C ${INSTALL_WORK}
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# apply general patch for SALOME
if [ -f patches/netgen-4.5-for-SALOME.patch ] ; then
- cp patches/netgen-4.5-for-SALOME.patch ${PRODUCT_WORK}
- ( cd ${PRODUCT_WORK}; patch -p1 < netgen-4.5-for-SALOME.patch )
+ cp patches/netgen-4.5-for-SALOME.patch ${PRODUCT_DIR}_SRC
+ ( cd ${PRODUCT_DIR}_SRC; patch -p1 < netgen-4.5-for-SALOME.patch )
fi
# apply patch for 64-bit platforms
if test `uname -m` = "x86_64" ; then
if [ -f patches/netgen-4.5-lib64.patch ] ; then
- cp patches/netgen-4.5-lib64.patch ${PRODUCT_WORK}
- ( cd ${PRODUCT_WORK}; patch -p1 < netgen-4.5-lib64.patch )
+ cp patches/netgen-4.5-lib64.patch ${PRODUCT_DIR}_SRC
+ ( cd ${PRODUCT_DIR}_SRC; patch -p1 < netgen-4.5-lib64.patch )
fi
fi
# additional patching for SALOME
-(cd ${PRODUCT_WORK}; cp ngtcltk/ngnewdelete.* libsrc/interface)
+(cd ${PRODUCT_DIR}_SRC; cp ngtcltk/ngnewdelete.* libsrc/interface)
# apply patch: to make compilable on latest versions of gcc
-(cd ${PRODUCT_WORK}/libsrc/meshing; echo -e '16s/^$/class Mesh;\nwq' | ed - meshtype.hpp > /dev/null)
+(cd ${PRODUCT_DIR}_SRC/libsrc/meshing; echo -e '16s/^$/class Mesh;\nwq' | ed - meshtype.hpp > /dev/null)
# apply patch: to make compilable with CASCADE-6.1.1
-(cd ${PRODUCT_WORK}/libsrc; sed -e "s%\(.*\)-DHAVE_LIMITS\'%\1-DHAVE_LIMITS_H%g" makefile.inc > makefile.inc.new; mv makefile.inc.new makefile.inc)
+(cd ${PRODUCT_DIR}_SRC/libsrc; sed -e "s%\(.*\)-DHAVE_LIMITS\'%\1-DHAVE_LIMITS_H%g" makefile.inc > makefile.inc.new; mv makefile.inc.new makefile.inc)
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
# set platform type variable
if test `uname -m` = "x86_64" ; then
export MACHINE=LINUX64
# compile
for directory in csg general geom2d gprim interface linalg occ meshing opti stlgeom ; do
- cd ${PRODUCT_WORK}/libsrc/${directory}
+ cd ${PRODUCT_DIR}_SRC/libsrc/${directory}
check_job ${PRODUCT_DIR}/MAKE.LOG make
done
# install
mkdir -p ${PRODUCT_DIR}/lib
-cp -f ${PRODUCT_WORK}/lib/${MACHINE}/* ${PRODUCT_DIR}/lib
+cp -f ${PRODUCT_DIR}_SRC/lib/${MACHINE}/* ${PRODUCT_DIR}/lib
mkdir -p ${PRODUCT_DIR}/include
-cp -f ${PRODUCT_WORK}/libsrc/interface/nglib.h ${PRODUCT_DIR}/include
+cp -f ${PRODUCT_DIR}_SRC/libsrc/interface/nglib.h ${PRODUCT_DIR}/include
for directory in csg general geom2d gprim linalg occ meshing opti stlgeom ; do
- cp -f ${PRODUCT_WORK}/libsrc/${directory}/*.hpp ${PRODUCT_DIR}/include
+ cp -f ${PRODUCT_DIR}_SRC/libsrc/${directory}/*.hpp ${PRODUCT_DIR}/include
done
-cp -f ${PRODUCT_WORK}/libsrc/include/mystdlib.h ${PRODUCT_WORK}/libsrc/include/mydefs.hpp ${PRODUCT_DIR}/include
+cp -f ${PRODUCT_DIR}_SRC/libsrc/include/mystdlib.h ${PRODUCT_DIR}_SRC/libsrc/include/mydefs.hpp ${PRODUCT_DIR}/include
+
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/netgen-4.5.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="netgen" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="netgen-4.5"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 0
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
export LD_LIBRARY_PATH=\$OMNIORBDIR/lib:\$LD_LIBRARY_PATH
##
EOF
-cat > ${PRODUCT_DIR}/.omniORB.cfg <<EOF
+if [ $PROCEDURE != "try_preinstalled" ] && [ -w ${PRODUCT_DIR} ] ; then
+ cat > ${PRODUCT_DIR}/.omniORB.cfg <<EOF
InitRef = NameService=corbaname::`hostname`:2810
EOF
+fi
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-check_version
-if [ $? -eq 0 ] ; then
- python_version="`python -c 'import sys; print sys.version[:3]'`"
- tmp="\${OMNIORBDIR}/bin ${OMNIORBDIR}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${OMNIORBDIR}/lib ${OMNIORBDIR}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- tmp="\${OMNIORBDIR}/lib:\${OMNIORBDIR}/lib/python\${PYTHON_VERSION}/site-packages ${OMNIORBDIR}/lib:${OMNIORBDIR}/lib/python${python_version}/site-packages \${PYTHONPATH} ${PYTHONPATH}";
- pythonpath=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export OMNIORBDIR=${OMNIORBDIR}
-export OMNIORB_CONFIG=\${OMNIORBDIR}/.omniORB.cfg
-export PYTHONPATH=${pythonpath}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+makedir ${PRODUCT_DIR}_SRC
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.5.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${PRODUCT_DIR}_SRC
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
-check_jb tar xfz ${SOURCE_DIR}/omniORB-4.0.5.tar.gz -C ${INSTALL_WORK}
-check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.5.tar.gz -C ${INSTALL_WORK}
-check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${INSTALL_WORK}
+install_source_and_build()
+{
+# install sources
+install_source
+# build sources
+makedir ${PRODUCT_DIR}
# install omniORB
-cd ${INSTALL_WORK}/omniORB-4.0.5
+cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
mkdir build
cd build
check_job ${PRODUCT_DIR}/INSTALL_OMNIORB.LOG make install
# install omniORBpy
-cd ${INSTALL_WORK}/omniORBpy-2.5
+cd ${PRODUCT_DIR}_SRC/omniORBpy-2.5_SRC
mkdir build
cd build
check_job ${PRODUCT_DIR}/INSTALL_OMNIORBPY.LOG make install
# install omniNotify
-cd ${INSTALL_WORK}/omniNotify
+cd ${PRODUCT_DIR}_SRC/omniNotify-2.1_SRC
mkdir build
cd build
mv -f _omniidlrun.py omniidlrun.py
chmod a+x omniidlrun.py
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
cd ${PRODUCT_DIR}
-rm -fr ${INSTALL_WORK}/omniORB-4.0.5
-rm -fr ${INSTALL_WORK}/omniORBpy-2.5
-rm -fr ${INSTALL_WORK}/omniNotify
-print_env
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/omniORB-4.0.5.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
ln -sf ${PRODUCT_DIR} ${INSTALL_ROOT}/omni
mv -f _omniidlrun.py omniidlrun.py
chmod a+x omniidlrun.py
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="omni" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="omniORB-4.0.5"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 0
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
InitRef = NameService=corbaname::`hostname`:2810
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-omnidir="`find_in_path omniidl ${PATH}:/usr/bin`"
-if [ -n "${omnidir}" ] ; then
- omnidir=`cd ${omnidir}/..; pwd`
- OMNIORBDIR=${omnidir}
- python_version="`python -c 'import sys; print sys.version[:3]'`"
- check_lib_version libomniORB4.so.0.6 ${OMNIORBDIR}/lib
- if [ "$?" -ne "0" ]; then return 1 ; fi
- check_lib_version _omnipymodule.so.2.6 ${OMNIORBDIR}/lib/python${python_version}/site-packages
- if [ "$?" -ne "0" ]; then return 1 ; fi
- tmp="${omnidir}/bin ${omnidir}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="${omnidir}/lib ${omnidir}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- tmp="${omnidir}/lib:${omnidir}/lib/python\${PYTHON_VERSION}:${omnidir}/lib/python\${PYTHON_VERSION}/site-packages ${omnidir}/lib:${omnidir}/lib/python${python_version}/site-packages \${PYTHONPATH} ${PYTHONPATH}";
- pythonpath=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export OMNIORB_CONFIG=\${HOME}/.omniORB.cfg
-export PYTHONPATH=${pythonpath}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+makedir ${PRODUCT_DIR}_SRC
-check_jb tar xfz ${SOURCE_DIR}/omniORB-4.0.6.tar.gz -C ${INSTALL_WORK}
-check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.6.tar.gz -C ${INSTALL_WORK}
-check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${INSTALL_WORK}
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.6.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${PRODUCT_DIR}_SRC
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
# install omniORB
-cd ${INSTALL_WORK}/omniORB-4.0.6
+cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
mkdir build
cd build
check_job ${PRODUCT_DIR}/INSTALL_OMNIORB.LOG make install
# install omniORBpy
-cd ${INSTALL_WORK}/omniORBpy-2.6
+cd ${PRODUCT_DIR}_SRC/omniORBpy-2.6_SRC
mkdir build
cd build
check_job ${PRODUCT_DIR}/INSTALL_OMNIORBPY.LOG make install
# install omniNotify
-cd ${INSTALL_WORK}/omniNotify
+cd ${PRODUCT_DIR}_SRC/omniNotify_SRC
mkdir build
cd build
mv -f _omniidlrun.py omniidlrun.py
chmod a+x omniidlrun.py
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
cd ${PRODUCT_DIR}
-rm -fr ${INSTALL_WORK}/omniORB-4.0.6
-rm -fr ${INSTALL_WORK}/omniORBpy-2.6
-rm -fr ${INSTALL_WORK}/omniNotify
-print_env
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/omniORB-4.0.6.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
ln -sf ${PRODUCT_DIR} ${INSTALL_ROOT}/omni
mv -f _omniidlrun.py omniidlrun.py
chmod a+x omniidlrun.py
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="omni" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="omniORB-4.0.6"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 0
}
-print_env()
+print_env_bin()
{
if test `uname -m` = "x86_64" ; then
InitRef = NameService=corbaname::`hostname`:2810
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-omnidir="`find_in_path omniidl ${PATH}:/usr/bin`"
-if [ -n "${omnidir}" ] ; then
- omnidir=`cd ${omnidir}/..; pwd`
- OMNIORBDIR=${omnidir}
- python_version="`python -c 'import sys; print sys.version[:3]'`"
- check_lib_version libomniORB4.so.0.6 ${OMNIORBDIR}/lib
- if [ "$?" -ne "0" ]; then return 1 ; fi
- check_lib_version _omnipymodule.so.2.6 ${OMNIORBDIR}/lib/python${python_version}/site-packages
- if [ "$?" -ne "0" ]; then return 1 ; fi
- tmp="${omnidir}/bin ${omnidir}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="${omnidir}/lib ${omnidir}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- tmp="${omnidir}/lib:${omnidir}/lib/python\${PYTHON_VERSION}:${omnidir}/lib/python\${PYTHON_VERSION}/site-packages ${omnidir}/lib:${omnidir}/lib/python${python_version}/site-packages \${PYTHONPATH} ${PYTHONPATH}";
- pythonpath=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export OMNIORB_CONFIG=\${HOME}/.omniORB.cfg
-export PYTHONPATH=${pythonpath}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-
-makedir ${PRODUCT_DIR}
-
-check_jb tar xfz ${SOURCE_DIR}/omniORB-4.0.7.tar.gz -C ${INSTALL_WORK}
-check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.7.tar.gz -C ${INSTALL_WORK}
-check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${INSTALL_WORK}
+makedir ${PRODUCT_DIR}_SRC
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/omniORBpy-2.7.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/omniNotify-2.1.tar.gz -C ${PRODUCT_DIR}_SRC
# apply patches for 64-bit platforms
if test `uname -m` = "x86_64" ; then
if [ -f patches/omniORB-4.0.7-lib64.patch ] ; then
- cp patches/omniORB-4.0.7-lib64.patch ${INSTALL_WORK}/omniORB-4.0.7
- ( cd ${INSTALL_WORK}/omniORB-4.0.7 ; patch -p1 < omniORB-4.0.7-lib64.patch )
+ cp patches/omniORB-4.0.7-lib64.patch ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
+ ( cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC ; patch -p1 < omniORB-4.0.7-lib64.patch )
fi
if [ -f patches/omniORBpy-2.7-lib64.patch ] ; then
- cp patches/omniORBpy-2.7-lib64.patch ${INSTALL_WORK}/omniORBpy-2.7
- ( cd ${INSTALL_WORK}/omniORBpy-2.7 ; patch -p1 < omniORBpy-2.7-lib64.patch )
+ cp patches/omniORBpy-2.7-lib64.patch ${PRODUCT_DIR}_SRC/omniORBpy-2.7_SRC
+ ( cd ${PRODUCT_DIR}_SRC/omniORBpy-2.7_SRC ; patch -p1 < omniORBpy-2.7-lib64.patch )
fi
if [ -f patches/omniNotify-2.1-lib64.patch ] ; then
- cp patches/omniNotify-2.1-lib64.patch ${INSTALL_WORK}/omniNotify
- ( cd ${INSTALL_WORK}/omniNotify ; patch -p1 < omniNotify-2.1-lib64.patch )
+ cp patches/omniNotify-2.1-lib64.patch ${PRODUCT_DIR}_SRC/omniNotify-2.1_SRC
+ ( cd ${PRODUCT_DIR}_SRC/omniNotify-2.1_SRC ; patch -p1 < omniNotify-2.1-lib64.patch )
fi
fi
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
# install omniORB
-cd ${INSTALL_WORK}/omniORB-4.0.7
+cd ${PRODUCT_DIR}_SRC/omniORB-4.0.7_SRC
mkdir build
cd build
fi
# install omniORBpy
-cd ${INSTALL_WORK}/omniORBpy-2.7
+cd ${PRODUCT_DIR}_SRC/omniORBpy-2.7_SRC
mkdir build
cd build
check_job ${PRODUCT_DIR}/INSTALL_OMNIORBPY.LOG make install
# install omniNotify
-cd ${INSTALL_WORK}/omniNotify
+cd ${PRODUCT_DIR}_SRC/omniNotify-2.1_SRC
mkdir build
cd build
mv -f _omniidlrun.py omniidlrun.py
chmod a+x omniidlrun.py
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
cd ${PRODUCT_DIR}
-rm -fr ${INSTALL_WORK}/omniORB-4.0.7
-rm -fr ${INSTALL_WORK}/omniORBpy-2.7
-rm -fr ${INSTALL_WORK}/omniNotify
-print_env
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/omniORB-4.0.7.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
ln -sf ${PRODUCT_DIR} ${INSTALL_ROOT}/omni
mv -f _omniidlrun.py omniidlrun.py
chmod a+x omniidlrun.py
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="omni" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="omniORB-4.0.7"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
####################################################################################
check_version(){
-if [ -z "$QTDIR" ]; then
+if [ -z "$QTDIR" ] || [ ! -f ${QTDIR}/include/qglobal.h ]; then
return 1
fi
+
ver=`grep "QT_VERSION_STR" ${QTDIR}/include/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
if [ "$ver" == "3.3.3" ] ; then
return 0
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-qtdir=""
-if [ -d /usr/share/qt3/lib ] ; then
- qtdir="`find_in_path libqt-mt.so.3.3.3 /usr/share/qt3/lib`"
-fi
-if [ -z "${qtdir}" ] && [ -d /usr/lib/qt3/lib ] ; then
- qtdir="`find_in_path libqt-mt.so.3.3.3 /usr/lib/qt3/lib`"
-fi
-if [ -z "${qtdir}" ] ; then
- qtdir="`find_in_path libqt-mt.so.3.3.3 /usr/lib`"
-fi
-if [ -z "${qtdir}" ] ; then
- qtdir="`find_in_path libqt-mt.so.3.3.3 ${LD_LIBRARY_PATH}`"
-fi
-if [ -n "${qtdir}" ] ; then
- qtdir=`cd ${qtdir}/..; pwd`
- moc="`find_in_path moc ${qtdir}/bin`"
- uic="`find_in_path uic ${qtdir}/bin`"
- if [ -n "${moc}" ] && [ -n "${uic}" ] ; then
- tmp="\${QTDIR}/bin ${qtdir}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${QTDIR}/lib ${qtdir}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export QTDIR=${qtdir}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
-check_jb tar xfz ${SOURCE_DIR}/qt-3.3.3.tar.gz -C ${INSTALL_WORK}
+# build sources
+makedir ${PRODUCT_DIR}
# apply patch : fix pb of libGL loading
if [ -f patches/qt-3.3.3-load-gl.patch ] ; then
- cp patches/qt-3.3.3-load-gl.patch ${PRODUCT_WORK}
- ( cd ${PRODUCT_WORK} ; patch -p1 < qt-3.3.3-load-gl.patch )
+ cp patches/qt-3.3.3-load-gl.patch ${PRODUCT_DIR}_SRC
+ ( cd ${PRODUCT_DIR}_SRC ; patch -p1 < qt-3.3.3-load-gl.patch )
patched_for_gl="yes"
fi
-cd ${PRODUCT_WORK}
+cd ${PRODUCT_DIR}_SRC
mv -f configure configure-orig
sed -e "s%read acceptance%acceptance=yes%" configure-orig > configure
chmod +x configure
-export QTDIR=${PRODUCT_WORK}
+export QTDIR=${PRODUCT_DIR}_SRC
export LD_LIBRARY_PATH=${QTDIR}/lib:$LD_LIBRARY_PATH
# basic flags
if [ -h ${PRODUCT_DIR}/bin/$b ]; then
rm -f ${PRODUCT_DIR}/bin/$b
fi
- cp -f ${PRODUCT_WORK}/bin/$b ${PRODUCT_DIR}/bin/$b
+ cp -f ${PRODUCT_DIR}_SRC/bin/$b ${PRODUCT_DIR}/bin/$b
fi
done
#rm -rf ${PRODUCT_DIR}/doc
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/qt-3.3.3.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
cd ${PRODUCT_DIR}/lib
sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" qt-mt.pc > qt-mt.pc.new
mv -f qt-mt.pc.new qt-mt.pc
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="qt" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="qt-3.3.3"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-
-qtdir=""
- if test `uname -m` = "x86_64" ; then
- export QT_LD_PREFIX='64'
- else
- QT_LD_PREFIX=''
- fi
-
-if [ -d /usr/share/qt3/lib${QT_LD_PREFIX} ] ; then
- qtdir="`find_in_path libqt-mt.so.3.3 /usr/share/qt3/lib\${QT_LD_PREFIX}`"
-fi
-if [ -z "${qtdir}" ] && [ -d /usr/lib/qt3/lib${QT_LD_PREFIX} ] ; then
- qtdir="`find_in_path libqt-mt.so.3.3 /usr/lib/qt3/lib${QT_LD_PREFIX}`"
-fi
-if [ -z "${qtdir}" ] ; then
- qtdir="`find_in_path libqt-mt.so.3.3 /usr/lib${QT_LD_PREFIX}`"
-fi
-if [ -z "${qtdir}" ] ; then
- qtdir="`find_in_path libqt-mt.so.3.3 ${LD_LIBRARY_PATH}`"
-fi
-if [ -n "${qtdir}" ] ; then
- qtdir=`cd ${qtdir}/..; pwd`
- moc="`find_in_path moc ${qtdir}/bin`"
- uic="`find_in_path uic ${qtdir}/bin`"
- if [ -n "${moc}" ] && [ -n "${uic}" ] ; then
- tmp="\${QTDIR}/bin ${qtdir}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${QTDIR}/lib${QT_LD_PREFIX} ${qtdir}/lib${QT_LD_PREFIX} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export QTDIR=${qtdir}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
-check_jb tar xfz ${SOURCE_DIR}/qt-3.3.4.tar.gz -C ${INSTALL_WORK}
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
# apply patch : fix pb of libGL loading
if [ -f patches/qt-3.3.3-load-gl.patch ] ; then
- cp patches/qt-3.3.3-load-gl.patch ${PRODUCT_WORK}
- ( cd ${PRODUCT_WORK} ; patch -p1 < qt-3.3.3-load-gl.patch )
+ cp patches/qt-3.3.3-load-gl.patch ${PRODUCT_DIR}_SRC
+ ( cd ${PRODUCT_DIR}_SRC ; patch -p1 < qt-3.3.3-load-gl.patch )
patched_for_gl="yes"
fi
# apply patch for 64-bit platforms
if test `uname -m` = "x86_64" ; then
if [ -f patches/qt-3.3.4-lib64.patch ] ; then
- cp patches/qt-3.3.4-lib64.patch ${PRODUCT_WORK}
- ( cd ${PRODUCT_WORK} ; patch -p1 < qt-3.3.4-lib64.patch )
+ cp patches/qt-3.3.4-lib64.patch ${PRODUCT_DIR}_SRC
+ ( cd ${PRODUCT_DIR}_SRC ; patch -p1 < qt-3.3.4-lib64.patch )
fi
fi
-cd ${PRODUCT_WORK}
+cd ${PRODUCT_DIR}_SRC
mv -f configure configure-orig
sed -e "s%read acceptance%acceptance=yes%" configure-orig > configure
chmod +x configure
-export QTDIR=${PRODUCT_WORK}
+export QTDIR=${PRODUCT_DIR}_SRC
export LD_LIBRARY_PATH=${QTDIR}/lib:$LD_LIBRARY_PATH
# basic flags
if [ -h ${PRODUCT_DIR}/bin/$b ]; then
rm -f ${PRODUCT_DIR}/bin/$b
fi
- cp -f ${PRODUCT_WORK}/bin/$b ${PRODUCT_DIR}/bin/$b
+ cp -f ${PRODUCT_DIR}_SRC/bin/$b ${PRODUCT_DIR}/bin/$b
fi
done
#rm -rf ${PRODUCT_DIR}/doc
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/qt-3.3.4.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# modify libdir
cd ${PRODUCT_DIR}/lib
sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" qt-mt.pc > qt-mt.pc.new
mv -f qt-mt.pc.new qt-mt.pc
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="qt" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="qt-3.3.4"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-qwthome="`find_in_path libqwt.so.0.4.1 ${LD_LIBRARY_PATH}`"
-if [ -z "${qwthome}" ] ; then
- qwthome="`find_in_path libqwt.so.0.4.1 /usr/lib`"
-fi
-if [ -n "${qwthome}" ] ; then
- tmp="${qwthome} ${qwthome} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/qwt-0.4.1.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+cd ${PRODUCT_DIR}_SRC
makedir ${PRODUCT_DIR}
qmake qwt.pro -o Makefile
check_job ${PRODUCT_DIR}/MAKE.LOG make
cp -rf include lib ${PRODUCT_DIR}
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -rf ${PRODUCT_WORK}
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/qwt-0.4.1.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="qwt" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="qwt-0.4.1"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-if test `uname -m` = "x86_64" ; then
-qwthome="`find_in_path libqwt.so ${LD_LIBRARY_PATH}:/usr/lib64:/usr/local/lib64`"
-else
-qwthome="`find_in_path libqwt.so ${LD_LIBRARY_PATH}:/usr/lib:/usr/local/lib`"
-fi
-if [ -n "${qwthome}" ] ; then
- qwtroot=`cd ${qwthome}/..; pwd`
- qwtinc="`find_in_path qwt_global.h ${qwtroot}/include:${qwtroot}/include/qwt:${QTDIR}/include/qwt:/usr/lib/qt3/include/qwt:/usr/local/lib/qt3/include/qwt`"
- if [ -n "${qwtinc}" ] ; then
- ver=`grep -e "^#define[[:space:]]\+QWT_VERSION_STR" ${qwtinc}/qwt_global.h | sed -e 's/^#define[[:space:]]\+QWT_VERSION_STR[[:space:]]*"\(.*\)"/\1/'`
- if [ "$ver" == "4.2.0" ]; then
- tmp="${qwthome} ${qwthome} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfj ${SOURCE_DIR}/qwt-4.2.0.tar.bz2 -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+cd ${PRODUCT_DIR}_SRC
makedir ${PRODUCT_DIR}
qmake qwt.pro -o Makefile
check_job ${PRODUCT_DIR}/MAKE.LOG make
cp -rf include lib ${PRODUCT_DIR}
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -rf ${PRODUCT_WORK}
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/qwt-4.2.0.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-print_env
+# to generate environment script for sources
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="qwt" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="qwt-4.2.0"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-# we need version 4.1 or newer
-try_native(){
-sipdir="`find_in_path sip ${PATH}:/usr/bin`"
-if [ -n "${sipdir}" ] ; then
- python_version="`python -c 'import sys; print sys.version[:3]'`"
- sippython="`find_in_path sip.so ${PYTHONPATH}:/usr/lib/python${python_version}/site-packages`"
- if [ -n "${sippython}" ]; then
- ver=`${sipdir}/sip -V | awk '{print $1}'`
- maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- let ver=$maj_ver*10000+$min_ver*100+$rel_ver
- # minimal required version is 4.1
- if [ $ver -ge 40100 ] ; then
- tmp="${sipdir} ${sipdir} \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="${sippython} ${sippython} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- tmp="${sippython} ${sippython} \${PYTHONPATH} ${PYTHONPATH}";
- pythonpath=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PATH=${path}
-export PYTHONPATH=${pythonpath}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
-check_jb tar xfz ${SOURCE_DIR}/sip-4.1.tar.gz -C ${INSTALL_WORK}
-cd ${PRODUCT_WORK}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
python configure.py -b ${PRODUCT_DIR} -d ${PRODUCT_DIR} -e ${PRODUCT_DIR} -v ${PRODUCT_DIR} -l qt-mt
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/sip-4.1.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# modify sipconfig.py file
if [ -n "${PYTHONHOME}" ] && [ -n "${QTDIR}" ] ; then
rm sipconfig.py.1
fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="sip" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="sip-4.1"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 1
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-# we need version 4.1 or newer
-try_native(){
-sipdir="`find_in_path sip ${PATH}:/usr/bin`"
-if [ -n "${sipdir}" ] ; then
- python_version="`python -c 'import sys; print sys.version[:3]'`"
-if test `uname -m` = "x86_64" ; then
- sippython="`find_in_path sip.so ${PYTHONPATH}:/usr/lib64/python${python_version}/site-packages`"
-else
- sippython="`find_in_path sip.so ${PYTHONPATH}:/usr/lib/python${python_version}/site-packages`"
-fi
- if [ -n "${sippython}" ]; then
- ver=`${sipdir}/sip -V | awk '{print $1}'`
- maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
- let ver=$maj_ver*10000+$min_ver*100+$rel_ver
- # minimal required version is 4.1
- if [ $ver -ge 40100 ] ; then
- tmp="${sipdir} ${sipdir} \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="${sippython} ${sippython} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- tmp="${sippython} ${sippython} \${PYTHONPATH} ${PYTHONPATH}";
- pythonpath=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export PATH=${path}
-export PYTHONPATH=${pythonpath}
-export LD_LIBRARY_PATH=${ld_library_path}
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
- fi
- fi
-fi
-return 1
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
-makedir ${PRODUCT_DIR}
-
-check_jb tar xfz ${SOURCE_DIR}/sip-4.2.1.tar.gz -C ${INSTALL_WORK}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# apply patch for 64-bit platforms
if test `uname -m` = "x86_64" ; then
if [ -f patches/sip-4.2.1-lib64.patch ] ; then
- cp patches/sip-4.2.1-lib64.patch ${PRODUCT_WORK}
- ( cd ${PRODUCT_WORK} ; patch -p1 < sip-4.2.1-lib64.patch )
+ cp patches/sip-4.2.1-lib64.patch ${PRODUCT_DIR}_SRC
+ ( cd ${PRODUCT_DIR}_SRC ; patch -p1 < sip-4.2.1-lib64.patch )
fi
fi
-cd ${PRODUCT_WORK}
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+makedir ${PRODUCT_DIR}
+cd ${PRODUCT_DIR}_SRC
if test `uname -m` = "x86_64" ; then
SIP_CONFIGURE_OPTIONS="-b ${PRODUCT_DIR} -d ${PRODUCT_DIR} -e ${PRODUCT_DIR} -v ${PRODUCT_DIR} -l qt-mt -p linux-g++-64"
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
-#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/sip-4.2.1.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# modify sipconfig.py file
if [ -n "${PYTHONHOME}" ] && [ -n "${QTDIR}" ] ; then
rm sipconfig.py.1
fi
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="sip" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="sip-4.2.1"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 0
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-tclhome="`find_in_path tclsh ${PATH}`"
-if [ -z "${tclhome}" ] ; then
- tclhome="`find_in_path tclsh /usr/bin`"
-fi
-if [ -n "${tclhome}" ] ; then
- tclhome=`cd ${tclhome}/..; pwd`
- tmp="\${TCLHOME}/bin ${tclhome}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${TCLHOME}/lib ${tclhome}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export TCLHOME=${tclhome}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
-export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl${VERSION} \${TCLHOME}/lib/tk${VERSION} \${TCLLIBPATH}"
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
+mkdir -p ${PRODUCT_DIR}_SRC
+
+check_jb tar xfz ${SOURCE_DIR}/tcl8.3.3.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/tk8.3.3.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/tclx8.3.tar.gz -C ${PRODUCT_DIR}_SRC
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
makedir ${PRODUCT_DIR}
-check_jb tar xfz ${SOURCE_DIR}/tcl8.3.3.tar.gz -C ${INSTALL_WORK}
-cd ${INSTALL_WORK}/tcl8.3.3/unix
+cd ${PRODUCT_DIR}_SRC/tcl-8.3.3_SRC/unix
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Configuring tcl...
(cd ${PRODUCT_DIR}/lib; ln -s libtcl8.3.so libtcl.so)
(cd ${PRODUCT_DIR}/lib; ln -s libtclstub8.3.a libtclstub.a)
-check_jb tar xfz ${SOURCE_DIR}/tk8.3.3.tar.gz -C ${INSTALL_WORK}
-cd ${INSTALL_WORK}/tk8.3.3/unix
+cd ${PRODUCT_DIR}_SRC/tk-8.3.3_SRC/unix
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Configuring tk...
(cd ${PRODUCT_DIR}/lib; ln -s libtk8.3.so libtk.so)
(cd ${PRODUCT_DIR}/lib; ln -s libtkstub8.3.a libtkstub.a)
-check_jb tar xfz ${SOURCE_DIR}/tclx8.3.tar.gz -C ${INSTALL_WORK}
-cd ${INSTALL_WORK}/tclx8.3/unix
+cd ${PRODUCT_DIR}_SRC/tclx-8.3_SRC/unix
#VRV - bug in a tclx configure
chmod +w ./configure
echo -e '/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 1\ns/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 1/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 0\nwq' | ed - configure
(cd ${PRODUCT_DIR}/lib; ln -s libtkx8.3.so libtkx.so)
(cd ${PRODUCT_DIR}/lib; ln -s libtkx8.3.a libtkx.a)
-#du -sk ${INSTALL_WORK}/tcl8.3.3 > ${PRODUCT_DIR}/size.log
-#du -sk ${INSTALL_WORK}/tk8.3.3 >> ${PRODUCT_DIR}/size.log
-#du -sk ${INSTALL_WORK}/tclx8.3 >> ${PRODUCT_DIR}/size.log
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
cd ${PRODUCT_DIR}
-rm -fr ${INSTALL_WORK}/tcl8.3.3 ${INSTALL_WORK}/tk8.3.3 ${INSTALL_WORK}/tclx8.3
-print_env
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/tcltk-8.3.3.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# overriding installation path
cd ${PRODUCT_DIR}/lib
sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tkConfig.sh > _tkConfig.sh
mv -f _tkConfig.sh tkConfig.sh
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="tcl" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="tcltk-8.3.3"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
return 0
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-tclhome="`find_in_path tclsh ${PATH}`"
-if [ -z "${tclhome}" ] ; then
- tclhome="`find_in_path tclsh /usr/bin`"
-fi
-if [ -n "${tclhome}" ] ; then
- tclhome=`cd ${tclhome}/..; pwd`
- tmp="\${TCLHOME}/bin ${tclhome}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${TCLHOME}/lib ${tclhome}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export TCLHOME=${tclhome}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
-export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl${VERSION} \${TCLHOME}/lib/tk${VERSION} \${TCLLIBPATH}"
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
+mkdir -p ${PRODUCT_DIR}_SRC
+
+# unpack
+check_jb tar xfz ${SOURCE_DIR}/tcl-8.4.5.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/tk-8.4.5.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/tclx-8.3.5.tar.gz -C ${PRODUCT_DIR}_SRC
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
if test `uname -m` = "x86_64" ; then
export CFLAGS=-m64
fi
makedir ${PRODUCT_DIR}
-check_jb tar xfz ${SOURCE_DIR}/tcl8.4.5.tar.gz -C ${INSTALL_WORK}
-cd ${INSTALL_WORK}/tcl8.4.5/unix
+cd ${PRODUCT_DIR}_SRC/tcl-8.4.5_SRC/unix
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Configuring tcl...
(cd ${PRODUCT_DIR}/lib; ln -fs libtcl8.4.so libtcl.so)
(cd ${PRODUCT_DIR}/lib; ln -fs libtclstub8.4.a libtclstub.a)
-check_jb tar xfz ${SOURCE_DIR}/tk8.4.5.tar.gz -C ${INSTALL_WORK}
-cd ${INSTALL_WORK}/tk8.4.5/unix
+cd ${PRODUCT_DIR}_SRC/tk-8.4.5_SRC/unix
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Configuring tk...
(cd ${PRODUCT_DIR}/lib; ln -fs libtk8.4.so libtk.so)
(cd ${PRODUCT_DIR}/lib; ln -fs libtkstub8.4.a libtkstub.a)
-check_jb tar xfz ${SOURCE_DIR}/tclx8.3.5.tar.gz -C ${INSTALL_WORK}
-
#vsr: patch tclx 8.3.5 to make it compiliable on Mandriva 2006.0
-cd ${INSTALL_WORK}/tclx8.3.5/unix
+cd ${PRODUCT_DIR}_SRC/tclx-8.3.5_SRC/unix
mv Common.mk.in Common.mk.in.orig
sed -e 's/@DEFS@/-DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void/g' Common.mk.in.orig > Common.mk.in
-cd ${INSTALL_WORK}/tclx8.3.5/tcl/unix
+cd ${PRODUCT_DIR}_SRC/tclx-8.3.5_SRC/tcl/unix
mv tclxConfig.sh.in tclxConfig.sh.in.orig
sed -e 's/@DEFS@/ -DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void /g' tclxConfig.sh.in.orig > tclxConfig.sh.in
-cd ${INSTALL_WORK}/tclx8.3.5/tk/unix
+cd ${PRODUCT_DIR}_SRC/tclx-8.3.5_SRC/tk/unix
mv tkxConfig.sh.in tkxConfig.sh.in.orig
sed -e 's/@DEFS@/ -DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void /g' tkxConfig.sh.in.orig > tkxConfig.sh.in
-cd ${INSTALL_WORK}/tclx8.3.5/unix
+cd ${PRODUCT_DIR}_SRC/tclx-8.3.5_SRC/unix
#VRV - bug in a tclx configure
chmod +w ./configure
echo -e '/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 1\ns/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 1/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 0\nwq' | ed - configure
(cd ${PRODUCT_DIR}/lib; ln -fs libtkx8.3.so libtkx.so)
(cd ${PRODUCT_DIR}/lib; ln -fs libtkx8.3.a libtkx.a)
-#du -sk ${INSTALL_WORK}/tcl8.4.5 > ${PRODUCT_DIR}/size.log
-#du -sk ${INSTALL_WORK}/tk8.4.5 >> ${PRODUCT_DIR}/size.log
-#du -sk ${INSTALL_WORK}/tclx8.3.5 >> ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR}
-rm -fr ${INSTALL_WORK}/tcl8.4.5 ${INSTALL_WORK}/tk8.4.5 ${INSTALL_WORK}/tclx8.3.5
-print_env
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR};
+
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/tcltk-8.4.5.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# overriding installation path
cd ${PRODUCT_DIR}/lib
sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tkConfig.sh > _tkConfig.sh
mv -f _tkConfig.sh tkConfig.sh
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="tcl" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
export PRODUCT="tcltk-8.4.5"
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
source ./common.sh
return 0
}
-print_env()
+print_env_bin()
{
cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#$DELIM ${PRODUCT_TYPE} $DELIM
##
EOF
(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-tclhome="`find_in_path tclsh ${PATH}`"
-if [ -z "${tclhome}" ] ; then
- tclhome="`find_in_path tclsh /usr/bin`"
-fi
-if [ -n "${tclhome}" ] ; then
- tclhome=`cd ${tclhome}/..; pwd`
- tmp="\${TCLHOME}/bin ${tclhome}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${TCLHOME}/lib ${tclhome}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
- ld_library_path=`sort_path ${tmp}`
- cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export TCLHOME=${tclhome}
-export PATH=${path}
-export LD_LIBRARY_PATH=${ld_library_path}
-export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl${VERSION} \${TCLHOME}/lib/tk${VERSION} \${TCLLIBPATH}"
+print_env_src()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
+#$DELIM ${PRODUCT_TYPE}_src $DELIM
+# nothing to do
##
EOF
- (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
- make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
- return 0
-fi
-return 1;
+(test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
return $?
}
install_source()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
source ${INSTALL_WORK}/$SHRC
+mkdir -p ${PRODUCT_DIR}_SRC
+
+check_jb tar xfz ${SOURCE_DIR}/tcl-8.4.7.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/tk-8.4.7.tar.gz -C ${PRODUCT_DIR}_SRC
+check_jb tar xfz ${SOURCE_DIR}/tclx-8.3.5.tar.gz -C ${PRODUCT_DIR}_SRC
+
+if [ $PROCEDURE == "install_source" ]; then
+# to generate environment scripts
+ try_preinstalled
+fi
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
makedir ${PRODUCT_DIR}
-check_jb tar xfz ${SOURCE_DIR}/tcl8.4.7.tar.gz -C ${INSTALL_WORK}
-cd ${INSTALL_WORK}/tcl8.4.7/unix
+cd ${PRODUCT_DIR}_SRC/tcl-8.4.7_SRC/unix
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Configuring tcl...
(cd ${PRODUCT_DIR}/lib; ln -fs libtcl8.4.so libtcl.so)
(cd ${PRODUCT_DIR}/lib; ln -fs libtclstub8.4.a libtclstub.a)
-check_jb tar xfz ${SOURCE_DIR}/tk8.4.7.tar.gz -C ${INSTALL_WORK}
-cd ${INSTALL_WORK}/tk8.4.7/unix
+cd ${PRODUCT_DIR}_SRC/tk-8.4.7_SRC/unix
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Configuring tk...
(cd ${PRODUCT_DIR}/lib; ln -fs libtk8.4.so libtk.so)
(cd ${PRODUCT_DIR}/lib; ln -fs libtkstub8.4.a libtkstub.a)
-check_jb tar xfz ${SOURCE_DIR}/tclx8.3.5.tar.gz -C ${INSTALL_WORK}
-
#vsr: patch tclx 8.3.5 to make it compiliable on Mandriva 2006.0
-cd ${INSTALL_WORK}/tclx8.3.5/unix
+cd ${PRODUCT_DIR}_SRC/tclx-8.3.5_SRC/unix
mv Common.mk.in Common.mk.in.orig
sed -e 's/@DEFS@/-DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void/g' Common.mk.in.orig > Common.mk.in
-cd ${INSTALL_WORK}/tclx8.3.5/tcl/unix
+cd ${PRODUCT_DIR}_SRC/tclx-8.3.5_SRC/tcl/unix
mv tclxConfig.sh.in tclxConfig.sh.in.orig
sed -e 's/@DEFS@/ -DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void /g' tclxConfig.sh.in.orig > tclxConfig.sh.in
-cd ${INSTALL_WORK}/tclx8.3.5/tk/unix
+cd ${PRODUCT_DIR}_SRC/tclx-8.3.5_SRC/tk/unix
mv tkxConfig.sh.in tkxConfig.sh.in.orig
sed -e 's/@DEFS@/ -DSTDC_HEADERS=1 -DNDEBUG=1 -DRETSIGTYPE=void /g' tkxConfig.sh.in.orig > tkxConfig.sh.in
-cd ${INSTALL_WORK}/tclx8.3.5/unix
+cd ${PRODUCT_DIR}_SRC/tclx-8.3.5_SRC/unix
#VRV - bug in a tclx configure
chmod +w ./configure
echo -e '/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 1\ns/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 1/test "$no_create" = yes || ${CONFIG_SHELL-\/bin\/sh} $CONFIG_STATUS || exit 0\nwq' | ed - configure
(cd ${PRODUCT_DIR}/lib; ln -fs libtkx8.3.so libtkx.so)
(cd ${PRODUCT_DIR}/lib; ln -fs libtkx8.3.a libtkx.a)
-#du -sk ${INSTALL_WORK}/tcl8.4.7 > ${PRODUCT_DIR}/size.log
-#du -sk ${INSTALL_WORK}/tk8.4.7 >> ${PRODUCT_DIR}/size.log
-#du -sk ${INSTALL_WORK}/tclx8.3.5 >> ${PRODUCT_DIR}/size.log
+#du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
cd ${PRODUCT_DIR}
-rm -fr ${INSTALL_WORK}/tcl8.4.7 ${INSTALL_WORK}/tk8.4.7 ${INSTALL_WORK}/tclx8.3.5
-print_env
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+ test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
+fi
+
+# to generate environment scripts
+try_preinstalled
}
install_binary()
{
-make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
source ${INSTALL_WORK}/$SHRC
-check_jb tar xfz ${SOURCE_DIR}/tcltk-8.4.7.tar.gz -C ${INSTALL_ROOT}
+check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
# overriding installation path
cd ${PRODUCT_DIR}/lib
sed -e "s%${old_prefix}%${PRODUCT_DIR}%g" tkConfig.sh > _tkConfig.sh
mv -f _tkConfig.sh tkConfig.sh
-print_env
+# to generate environment scripts
+try_preinstalled
}
export PROCEDURE=$1;
export SOURCE_DIR=$3;
export INSTALL_ROOT=$4;
export PRODUCT_SEQUENCE=$5;
-if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="tcl" ; fi
+export PRODUCT_TYPE=$6;
+export INSTALL_PRODUCTS=$7;
+shift
+REMOVE_SRC_TMP=$8;
export PRODUCT="tcltk-8.4.7"
export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}