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 $3}'`
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}/${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_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
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_DIR}_SRC ${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 makedir ${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_DIR}_SRC > ${PRODUCT_DIR}/size.log
96 # remove sources and temporary files after building
97 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
98 test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
101 # to generate environment scripts
107 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
108 source ${INSTALL_WORK}/$SHRC
110 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
111 cd ${PRODUCT_DIR}/lib/graphviz
113 for l in `ls *.la`; do
114 libdir=`grep -e "libdir=.*" $l | sed -e "s/libdir=[\'|\"]\(.*\)[\'|\"]/\1/g"`
115 sed -e "s%${libdir}%${PRODUCT_DIR}/lib/graphviz%g" $l > _$l
116 libdir=`dirname $libdir`
117 sed -e "s%${libdir}%${PRODUCT_DIR}/lib/graphviz%g" _$l > $l
119 if [ -n "${TCLHOME}" ]; then
120 tmp="-L${TCLHOME}/lib"
122 sed -e "s%-L[^[:space:]]*/tcltk-[0-9]\+\.[0-9]\+\.[0-9]\+/lib[[:space:]]%$tmp %g" $l > _$l
127 # to generate environment scripts
132 export INSTALL_WORK=$2;
133 export SOURCE_DIR=$3;
134 export INSTALL_ROOT=$4;
135 export PRODUCT_SEQUENCE=$5;
136 export PRODUCT_TYPE=$6;
137 export INSTALL_PRODUCTS=$7;
140 export PRODUCT="graphviz-2.16.1"
141 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
142 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}