]> SALOME platform Git repositories - tools/install.git/blob - config_files/PyQt-3.13.sh
Salome HOME
1) getSize() just returns required size that read from XML now;
[tools/install.git] / config_files / PyQt-3.13.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : PyQt-3.13.sh
5 #  Created   : Thu Dec 18 12:01:00 2002
6 #  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
7 #  Project   : SALOME
8 #  Module    : Installation Wizard
9 #  Copyright : 2002-2007 CEA
10 #
11 #  This script is the part of the SALOME installation procedure.
12 #
13 ####################################################################################
14
15 check_version()
16 {
17 if [ -n "${PYQTDIR}" ] && [ -f ${PYQTDIR}/pyqtconfig.py ] ; then
18     ver=`cd ${PYQTDIR} && python -c "from pyqtconfig import Configuration; c=Configuration();print c.__getattr__('pyqt_version_str')" 2>/dev/null`
19     if [ -n "$ver" ] ; then
20         maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
21         min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
22         rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
23         let ver=$maj_ver*10000+$min_ver*100+$rel_ver
24         if [ $ver -eq 031300 ] ; then
25             return 0
26         fi
27     fi
28 fi
29 return 1
30 }
31
32 print_env_bin()
33 {
34 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
35 #$DELIM ${PRODUCT_TYPE} $DELIM
36 export PYQTDIR=\${INSTALL_ROOT}/${PRODUCT}
37 export PYQT_SIPS=\${PYQTDIR}/sip
38 export PATH=\${PYQTDIR}:\$PATH 
39 export PYTHONPATH=\${PYQTDIR}:\${PYTHONPATH}
40 export LD_LIBRARY_PATH=\${PYQTDIR}:\$LD_LIBRARY_PATH 
41 ##
42 EOF
43 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
44 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
45 }
46
47 print_env_src()
48 {
49 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
50 #$DELIM ${PRODUCT_TYPE}_src $DELIM
51 # nothing to do
52 ##
53 EOF
54 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
55 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
56 }
57
58 try_preinstalled(){
59 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
60 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
61 return $?
62 }
63
64 install_source()
65 {
66 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
67 source ${INSTALL_WORK}/$SHRC
68
69 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
70
71 # to generate environment scripts
72 try_preinstalled
73 }
74
75 install_source_and_build()
76 {
77 # install sources
78 install_source
79
80 # build sources
81 makedir ${PRODUCT_DIR}
82 cd ${PRODUCT_DIR}_SRC
83
84 sed -e 's%check_license()$%#check_license()%g' configure.py > configure.py.new
85 mv -f configure.py.new configure.py
86
87 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
88     python configure.py -b ${PRODUCT_DIR} -d ${PRODUCT_DIR} -v ${PRODUCT_DIR}/sip
89 GCC=`which gcc`
90 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
91 used gcc=$GCC
92 EOF
93 check_job ${PRODUCT_DIR}/MAKE.LOG make
94 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
95
96 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
97 cd ${PRODUCT_DIR};
98
99 # remove sources and temporary files after building
100 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
101     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
102 fi
103
104 # to generate environment scripts
105 try_preinstalled
106 }
107
108 install_binary()
109 {
110 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
111 source ${INSTALL_WORK}/$SHRC
112
113 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
114
115 # modify pyqtconfig.py file
116 cd ${PRODUCT_DIR}
117 sed -e "s%\('pyqt_bin_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}',%g"     pyqtconfig.py > pyqtconfig.py.1
118 sed -e "s%\('pyqt_mod_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}',%g"     pyqtconfig.py.1 > pyqtconfig.py
119 sed -e "s%\('pyqt_sip_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/sip',%g" pyqtconfig.py > pyqtconfig.py.1
120 mv pyqtconfig.py.1 pyqtconfig.py
121
122 # to generate environment script for sources
123 try_preinstalled
124 }
125
126 export PROCEDURE=$1;
127 export INSTALL_WORK=$2;
128 export SOURCE_DIR=$3;
129 export INSTALL_ROOT=$4;
130 export PRODUCT_SEQUENCE=$5;
131 export PRODUCT_TYPE=$6;
132 export INSTALL_PRODUCTS=$7;
133 shift
134 REMOVE_SRC_TMP=$8;
135 export PRODUCT="PyQt-3.13"
136 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
137 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
138 source ./common.sh
139 $PROCEDURE