]> SALOME platform Git repositories - tools/install.git/blob - config_files/qwt-0.4.1.sh
Salome HOME
Remove HappyDoc dependencies
[tools/install.git] / config_files / qwt-0.4.1.sh
1 #!/bin/sh
2
3 check_version()
4 {
5 if [ -n "${QWTHOME}" ]; then
6     check_lib_version libqwt.so.0.4.1 ${QWTHOME}/lib
7     if [ "$?" -eq "0" ]; then
8         return 0
9     fi
10 fi
11 return 1
12 }
13
14 print_env()
15 {
16 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
17 #$DELIM ${PRODUCT_TYPE} $DELIM
18 export QWTHOME=\${INSTALL_ROOT}/${PRODUCT}
19 export LD_LIBRARY_PATH=\${QWTHOME}/lib:\${LD_LIBRARY_PATH} 
20 ##
21 EOF
22 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
23 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
24 }
25
26 # looks for the native product and collects it's environment (used by make_env())
27 try_native(){
28 qwthome="`find_in_path libqwt.so.0.4.1 ${LD_LIBRARY_PATH}`"
29 if [ -z "${qwthome}" ] ; then
30     qwthome="`find_in_path libqwt.so.0.4.1 /usr/lib`"
31 fi
32 if [ -n "${qwthome}" ] ; then
33     tmp="${qwthome} ${qwthome} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
34     ld_library_path=`sort_path ${tmp}`
35     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
36 #$DELIM ${PRODUCT_TYPE} $DELIM
37 export LD_LIBRARY_PATH=${ld_library_path}
38 ##
39 EOF
40     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
41     return 0
42 fi
43 return 1
44 }
45
46 try_preinstalled(){
47 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
48 return $?
49 }
50
51 install_source()
52 {
53 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
54 source ${INSTALL_WORK}/$SHRC
55
56 check_jb tar xfz ${SOURCE_DIR}/qwt-0.4.1.tar.gz -C ${INSTALL_WORK}
57 cd ${PRODUCT_WORK}
58 makedir ${PRODUCT_DIR}
59
60 qmake qwt.pro -o Makefile
61
62 GCC=`which gcc`
63 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
64 used gcc=$GCC
65 EOF
66
67 check_job ${PRODUCT_DIR}/MAKE.LOG make 
68 cp -rf include lib ${PRODUCT_DIR}
69
70 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
71 cd ${PRODUCT_DIR}; rm -rf ${PRODUCT_WORK}
72
73 print_env
74 }
75
76 install_binary()
77 {
78 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
79 source ${INSTALL_WORK}/$SHRC
80
81 check_jb tar xfz ${SOURCE_DIR}/qwt-0.4.1.tar.gz -C ${INSTALL_ROOT}
82
83 print_env
84 }
85
86 export PROCEDURE=$1;
87 export INSTALL_WORK=$2;
88 export SOURCE_DIR=$3;
89 export INSTALL_ROOT=$4;
90 export PRODUCT_SEQUENCE=$5;
91 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="qwt" ; fi
92 export PRODUCT="qwt-0.4.1"
93 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
94 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
95 source ./common.sh
96 $PROCEDURE