author | alanb |
Sat, 30 Nov 2019 16:21:19 +0000 | |
changeset 59329 | 289000934908 |
parent 44831 | 4577394d5b98 |
permissions | -rw-r--r-- |
44726
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
1 |
#!/bin/bash -e |
44734 | 2 |
# |
3 |
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
|
4 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
5 |
# |
|
6 |
# This code is free software; you can redistribute it and/or modify it |
|
7 |
# under the terms of the GNU General Public License version 2 only, as |
|
8 |
# published by the Free Software Foundation. Oracle designates this |
|
9 |
# particular file as subject to the "Classpath" exception as provided |
|
10 |
# by Oracle in the LICENSE file that accompanied this code. |
|
11 |
# |
|
12 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
13 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
16 |
# accompanied this code). |
|
17 |
# |
|
18 |
# You should have received a copy of the GNU General Public License version |
|
19 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
20 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
21 |
# |
|
22 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
23 |
# or visit www.oracle.com if you need additional information or have any |
|
24 |
# questions. |
|
25 |
# |
|
44726
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
26 |
# Create a bundle in the current directory, containing what's needed to run |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
27 |
# the 'dot' program from the graphviz suite by the OpenJDK build. |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
28 |
|
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
29 |
TMPDIR=`mktemp -d -t graphvizbundle-XXXX` |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
30 |
trap "rm -rf \"$TMPDIR\"" EXIT |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
31 |
|
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
32 |
ORIG_DIR=`pwd` |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
33 |
cd "$TMPDIR" |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
34 |
GRAPHVIZ_VERSION=2.38.0-1 |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
35 |
PACKAGE_VERSION=1.1 |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
36 |
TARGET_PLATFORM=linux_x64 |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
37 |
BUNDLE_NAME=graphviz-$TARGET_PLATFORM-$GRAPHVIZ_VERSION+$PACKAGE_VERSION.tar.gz |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
38 |
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-$GRAPHVIZ_VERSION.el6.x86_64.rpm |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
39 |
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-libs-$GRAPHVIZ_VERSION.el6.x86_64.rpm |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
40 |
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-core-$GRAPHVIZ_VERSION.el6.x86_64.rpm |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
41 |
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-x-$GRAPHVIZ_VERSION.el6.x86_64.rpm |
44831
4577394d5b98
8179225: Update graphviz bundle script with up to date build instructions
erikj
parents:
44734
diff
changeset
|
42 |
wget http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm |
44726
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
43 |
|
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
44 |
mkdir graphviz |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
45 |
cd graphviz |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
46 |
for rpm in ../*.rpm; do |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
47 |
rpm2cpio $rpm | cpio --extract --make-directories |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
48 |
done |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
49 |
|
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
50 |
cat > dot << EOF |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
51 |
#!/bin/bash |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
52 |
# Get an absolute path to this script |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
53 |
this_script_dir=\`dirname \$0\` |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
54 |
this_script_dir=\`cd \$this_script_dir > /dev/null && pwd\` |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
55 |
export LD_LIBRARY_PATH="\$this_script_dir/usr/lib64:\$LD_LIBRARY_PATH" |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
56 |
exec \$this_script_dir/usr/bin/dot "\$@" |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
57 |
EOF |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
58 |
chmod +x dot |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
59 |
export LD_LIBRARY_PATH="$TMPDIR/graphviz/usr/lib64:$LD_LIBRARY_PATH" |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
60 |
# create config file |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
61 |
./dot -c |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
62 |
tar -cvzf ../$BUNDLE_NAME * |
04aa2c065f5c
8176785: Add build support to generate PNG file from .dot file
ihse
parents:
diff
changeset
|
63 |
cp ../$BUNDLE_NAME "$ORIG_DIR" |