]> SALOME platform Git repositories - tools/install.git/blob - config_files/qwt-0.4.1.sh
Salome HOME
Remove commented code.
[tools/install.git] / config_files / qwt-0.4.1.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : qwt-0.4.1.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 "${QWTHOME}" ]; then
18     check_lib_version libqwt.so.0.4.1 ${QWTHOME}/lib
19     if [ "$?" -eq "0" ]; then
20         return 0
21     fi
22 fi
23 return 1
24 }
25
26 print_env_bin()
27 {
28 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
29 #$DELIM ${PRODUCT_TYPE} $DELIM
30 export QWTHOME=\${INSTALL_ROOT}/${PRODUCT}
31 export LD_LIBRARY_PATH=\${QWTHOME}/lib:\${LD_LIBRARY_PATH} 
32 ##
33 EOF
34 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
35 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
36 }
37
38 print_env_src()
39 {
40 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
41 #$DELIM ${PRODUCT_TYPE}_src $DELIM
42 # nothing to do
43 ##
44 EOF
45 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
46 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
47 }
48
49 try_preinstalled(){
50 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
51 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
52 return $?
53 }
54
55 install_source()
56 {
57 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
58 source ${INSTALL_WORK}/$SHRC
59
60 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
61
62 # to generate environment scripts
63 try_preinstalled
64 }
65
66 install_source_and_build()
67 {
68 # install sources
69 install_source
70
71 # build sources
72 cd ${PRODUCT_DIR}_SRC
73 makedir ${PRODUCT_DIR}
74
75 qmake qwt.pro -o Makefile
76
77 GCC=`which gcc`
78 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
79 used gcc=$GCC
80 EOF
81
82 check_job ${PRODUCT_DIR}/MAKE.LOG make 
83 cp -rf include lib ${PRODUCT_DIR}
84
85 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
86 cd ${PRODUCT_DIR};
87
88 # remove sources and temporary files after building
89 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
90     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
91 fi
92
93 # to generate environment scripts
94 try_preinstalled
95 }
96
97 install_binary()
98 {
99 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
100 source ${INSTALL_WORK}/$SHRC
101
102 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
103
104 # to generate environment script for sources
105 try_preinstalled
106 }
107
108 export PROCEDURE=$1;
109 export INSTALL_WORK=$2;
110 export SOURCE_DIR=$3;
111 export INSTALL_ROOT=$4;
112 export PRODUCT_SEQUENCE=$5;
113 export PRODUCT_TYPE=$6;
114 export INSTALL_PRODUCTS=$7;
115 shift
116 REMOVE_SRC_TMP=$8;
117 export PRODUCT="qwt-0.4.1"
118 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
119 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
120 source ./common.sh
121 $PROCEDURE