3 ####################################################################################
4 # File : graphviz-2.16.1.sh
5 # Created : Thu Dec 18 12:01:00 2002
6 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 # Module : Installation Wizard
9 # Copyright : 2002-2007 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
17 isdot=`which dot 2>/dev/null`
18 if [ -n "$isdot" ]; then
19 ver=`dot -V 2>&1 | awk '{print $5}'`
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 20203 ] ; then
33 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
34 #$DELIM ${PRODUCT_TYPE} $DELIM
35 export GRAPHVIZHOME=\${INSTALL_ROOT}/${SINGLE_DIR:-${PRODUCT}}
36 export PATH=\${GRAPHVIZHOME}/bin:\${PATH}
37 export LD_LIBRARY_PATH=\${GRAPHVIZHOME}/lib:\${GRAPHVIZHOME}/lib/graphviz:\${LD_LIBRARY_PATH}
40 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
41 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
46 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
47 #$DELIM ${PRODUCT_TYPE}_src $DELIM
51 (test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
52 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
56 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
57 try_existing ${PRODUCT_SRC_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
63 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
64 source ${INSTALL_WORK}/$SHRC
67 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
69 # to generate environment scripts
73 install_source_and_build()
80 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
81 if test `uname -m` = "x86_64" ; then
82 check_job ${PRODUCT_DIR}/CONFIGURE.LOG configure --prefix=${PRODUCT_DIR} --with-mylibgd --with-gdlibdir=/usr/lib64 --with-fontconfiglibdir=/usr/lib64 --with-expatlibdir=/usr/lib64 --with-freetypelibdir=/usr/lib64 --with-tcl=${TCLHOME} --disable-rpath --enable-perl=no CFLAGS=-m64 CXXFLAGS=-m64
84 check_job ${PRODUCT_DIR}/CONFIGURE.LOG configure --prefix=${PRODUCT_DIR} --with-tcl=${TCLHOME} --disable-rpath --enable-perl=no
87 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
90 check_job ${PRODUCT_DIR}/MAKE.LOG make
91 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
93 #du -sk ${PRODUCT_SRC_DIR} > ${PRODUCT_DIR}/size.log
96 # remove sources and temporary files after building
97 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
98 test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
101 # to generate environment scripts
107 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
108 source ${INSTALL_WORK}/$SHRC
110 # create a product directory
111 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
113 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}
114 cd ${PRODUCT_DIR}/lib/graphviz
116 for l in `ls *.la`; do
117 libdir=`grep -e "libdir=.*" $l | sed -e "s/libdir=[\'|\"]\(.*\)[\'|\"]/\1/g"`
118 sed -e "s%${libdir}%${PRODUCT_DIR}/lib/graphviz%g" $l > _$l
119 libdir=`dirname $libdir`
120 sed -e "s%${libdir}%${PRODUCT_DIR}/lib/graphviz%g" _$l > $l
122 if [ -n "${TCLHOME}" ]; then
123 tmp="-L${TCLHOME}/lib"
125 sed -e "s%-L[^[:space:]]*/tcltk-[0-9]\+\.[0-9]\+\.[0-9]\+/lib[[:space:]]%$tmp %g" $l > _$l
130 # to generate environment scripts
135 export INSTALL_WORK=$2;
136 export SOURCE_DIR=$3;
137 export INSTALL_ROOT=$4;
138 export PRODUCT_SEQUENCE=$5;
139 export PRODUCT_TYPE=$6;
140 export INSTALL_PRODUCTS=$7;
143 test $# == 10 && shift && SINGLE_DIR=$9
144 export PRODUCT="graphviz-2.16.1"
145 export PRODUCT_DIR=${INSTALL_ROOT}/${SINGLE_DIR:-${PRODUCT}}
146 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
147 export PRODUCT_SRC_DIR=${INSTALL_ROOT}/${PRODUCT}_SRC