make/devkit/createGraphvizBundle.sh
changeset 44726 04aa2c065f5c
child 44734 70bbd6884287
equal deleted inserted replaced
44725:8747b14eb49c 44726:04aa2c065f5c
       
     1 #!/bin/bash -e
       
     2 # Create a bundle in the current directory, containing what's needed to run
       
     3 # the 'dot' program from the graphviz suite by the OpenJDK build.
       
     4 
       
     5 TMPDIR=`mktemp -d -t graphvizbundle-XXXX`
       
     6 trap "rm -rf \"$TMPDIR\"" EXIT
       
     7 
       
     8 ORIG_DIR=`pwd`
       
     9 cd "$TMPDIR"
       
    10 GRAPHVIZ_VERSION=2.38.0-1
       
    11 PACKAGE_VERSION=1.1
       
    12 TARGET_PLATFORM=linux_x64
       
    13 BUNDLE_NAME=graphviz-$TARGET_PLATFORM-$GRAPHVIZ_VERSION+$PACKAGE_VERSION.tar.gz
       
    14 wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-$GRAPHVIZ_VERSION.el6.x86_64.rpm
       
    15 wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-libs-$GRAPHVIZ_VERSION.el6.x86_64.rpm
       
    16 wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-core-$GRAPHVIZ_VERSION.el6.x86_64.rpm
       
    17 wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-x-$GRAPHVIZ_VERSION.el6.x86_64.rpm
       
    18 
       
    19 mkdir graphviz
       
    20 cd graphviz
       
    21 for rpm in ../*.rpm; do
       
    22   rpm2cpio $rpm | cpio --extract --make-directories
       
    23 done
       
    24 
       
    25 cat > dot << EOF
       
    26 #!/bin/bash
       
    27 # Get an absolute path to this script
       
    28 this_script_dir=\`dirname \$0\`
       
    29 this_script_dir=\`cd \$this_script_dir > /dev/null && pwd\`
       
    30 export LD_LIBRARY_PATH="\$this_script_dir/usr/lib64:\$LD_LIBRARY_PATH"
       
    31 exec \$this_script_dir/usr/bin/dot "\$@"
       
    32 EOF
       
    33 chmod +x dot
       
    34 export LD_LIBRARY_PATH="$TMPDIR/graphviz/usr/lib64:$LD_LIBRARY_PATH"
       
    35 # create config file
       
    36 ./dot -c
       
    37 tar -cvzf ../$BUNDLE_NAME *
       
    38 cp ../$BUNDLE_NAME "$ORIG_DIR"