]> SALOME platform Git repositories - tools/install.git/blob - config_files/graphviz-2.2.1.sh
Salome HOME
Update for version 3.0.0
[tools/install.git] / config_files / graphviz-2.2.1.sh
1 #!/bin/sh
2
3 check_version()
4 {
5 isdot=`which dot 2>/dev/null`
6 if [ -n isdot ]; then
7   ver=`dot -V 2>&1 | awk '{print $3}'`
8   if [ "$ver" == "2.2.1" ]; then
9     return 0
10   fi
11 fi
12 return 1
13 }
14
15 print_env()
16 {
17 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
18 #$DELIM ${PRODUCT_TYPE} $DELIM
19 export PATH=\${INSTALL_ROOT}/${PRODUCT}/bin:\${PATH}
20 export LD_LIBRARY_PATH=\${INSTALL_ROOT}/${PRODUCT}/lib/graphviz:\${LD_LIBRARY_PATH}
21 ##
22 EOF
23 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
24 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
25 }
26
27 # looks for the native product and collects it's environment (used by make_env())
28 try_native(){
29 check_version
30 if [ $? -eq 0 ] ; then
31     dot="`find_in_path dot ${PATH}`"
32     dot=`cd ${dot}/..; pwd`
33     tmp="${dot}/bin ${dot}/bin \${PATH} ${PATH}";  
34     path=`sort_path ${tmp}`
35     tmp="${dot}/lib/graphviz ${dot}/lib/graphviz \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
36     ld_library_path=`sort_path ${tmp}`
37     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
38 #$DELIM ${PRODUCT_TYPE} $DELIM
39 export PATH=${path}
40 export LD_LIBRARY_PATH=${ld_library_path}
41 ##
42 EOF
43     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
44     return 0
45 fi
46 return 1;
47 }
48
49 try_preinstalled(){
50 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
51 return $?
52 }
53
54 install_source()
55 {
56 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
57 source ${INSTALL_WORK}/$SHRC
58
59 check_jb tar xfz ${SOURCE_DIR}/graphviz-2.2.1.tar.gz -C ${INSTALL_WORK}
60
61 cd ${PRODUCT_WORK}
62 makedir ${PRODUCT_DIR}
63 check_job ${PRODUCT_DIR}/CONFIGURE.LOG configure --prefix=${PRODUCT_DIR} --with-tcl=${TCLHOME} --disable-rpath 
64 GCC=`which gcc`
65 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
66 used gcc=$GCC
67 EOF
68 check_job ${PRODUCT_DIR}/MAKE.LOG make
69 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
70
71 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
72 rm -fr ${PRODUCT_WORK}
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}/graphviz-2.2.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="graphviz" ; fi
92 export PRODUCT="graphviz-2.2.1"
93 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
94 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
95 source ./common.sh
96 $PROCEDURE