]> SALOME platform Git repositories - tools/install.git/blob - config_files/graphviz-1.9.sh
Salome HOME
1) remove required size calculations for each product: just read its from XML and...
[tools/install.git] / config_files / graphviz-1.9.sh
1 #!/bin/bash -noprofile
2
3 ####################################################################################
4 #  File      : graphviz-1.9.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 isdot=`which dot 2>/dev/null`
18 if [ -n "$isdot" ]; then
19   ver=`dot -V 2>&1 | awk '{print $3}'`
20   if [ "$ver" == "1.9" ]; then
21     return 0
22   fi
23 fi
24 return 1
25 }
26
27 print_env_bin()
28 {
29 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
30 #$DELIM ${PRODUCT_TYPE} $DELIM
31 export PATH=\${INSTALL_ROOT}/${PRODUCT}/bin:\${PATH}
32 export LD_LIBRARY_PATH=\${INSTALL_ROOT}/${PRODUCT}/lib/graphviz:\${LD_LIBRARY_PATH}
33 ##
34 EOF
35 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
36 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
37 }
38
39 print_env_src()
40 {
41 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
42 #$DELIM ${PRODUCT_TYPE}_src $DELIM
43 # nothing to do
44 ##
45 EOF
46 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
47 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
48 }
49
50 try_preinstalled(){
51 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
52 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
53 return $?
54 }
55
56 install_source()
57 {
58 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}""${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
59 source ${INSTALL_WORK}/$SHRC
60
61 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
62
63 # to generate environment scripts
64 try_preinstalled
65 }
66
67 install_source_and_build()
68 {
69 # install sources
70 install_source
71
72 # build sources
73 cd ${PRODUCT_DIR}_SRC
74 makedir ${PRODUCT_DIR}
75
76 check_job ${PRODUCT_DIR}/CONFIGURE.LOG configure --prefix=${PRODUCT_DIR} --with-tcl=${TCLHOME} --disable-rpath 
77 GCC=`which gcc`
78 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
79 used gcc=$GCC
80 EOF
81 check_job ${PRODUCT_DIR}/MAKE.LOG make
82 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
83
84 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
85 cd ${PRODUCT_DIR};
86
87 # remove sources and temporary files after building
88 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
89     test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
90 fi
91
92 # to generate environment scripts
93 try_preinstalled
94 }
95
96 install_binary()
97 {
98 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
99 source ${INSTALL_WORK}/$SHRC
100
101 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
102 cd ${PRODUCT_DIR}/lib/graphviz
103 for l in `ls *.la`; do
104     libdir=`grep -e "libdir=.*" $l | sed -e "s/libdir=[\'|\"]\(.*\)[\'|\"]/\1/g"`
105     sed -e "s%${libdir}%${PRODUCT_DIR}/lib/graphviz%g" $l > _$l
106     libdir=`dirname $libdir`
107     sed -e "s%${libdir}%${PRODUCT_DIR}/lib/graphviz%g" _$l > $l
108     rm -f _$l
109     chmod a+x $l
110 done
111
112 # to generate environment scripts
113 try_preinstalled
114 }
115
116 export PROCEDURE=$1;
117 export INSTALL_WORK=$2;
118 export SOURCE_DIR=$3;
119 export INSTALL_ROOT=$4;
120 export PRODUCT_SEQUENCE=$5;
121 export PRODUCT_TYPE=$6;
122 export INSTALL_PRODUCTS=$7;
123 shift
124 REMOVE_SRC_TMP=$8;
125 export PRODUCT="graphviz-1.9"
126 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
127 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
128 source ./common.sh
129 $PROCEDURE