author | immler@in.tum.de |
Tue, 02 Dec 2008 15:25:24 +0100 | |
changeset 34395 | 287f3ecdfc2a |
parent 34379 | c80f42933ac6 |
child 34413 | 10cdbba5af89 |
permissions | -rwxr-xr-x |
34332 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# makedist -- make Isabelle/jEdit distribution |
|
4 |
||
5 |
## self references |
|
6 |
||
7 |
PRG=$(basename "$0") |
|
8 |
THIS=$(cd "$(dirname "$0")"; pwd) |
|
9 |
SUPER=$(cd "$THIS/.."; pwd) |
|
10 |
||
11 |
||
12 |
## diagnostics |
|
13 |
||
14 |
JEDIT_HOME="/home/isajedit/jedit-orig/4.3pre15" |
|
15 |
SCALA_HOME="/home/scala/current" |
|
16 |
||
17 |
function usage() |
|
18 |
{ |
|
19 |
echo |
|
20 |
echo "Usage: $PRG [OPTIONS]" |
|
21 |
echo |
|
22 |
echo " Options are:" |
|
23 |
echo " -j DIR specify original jEdit distribution" |
|
24 |
echo " (default: $JEDIT_HOME)" |
|
25 |
echo " -s DIR specify Scala distribution" |
|
26 |
echo " (default: $SCALA_HOME)" |
|
27 |
echo |
|
28 |
echo " Produce Isabelle/jEdit distribution from Netbeans build" |
|
29 |
echo " in $THIS/dist" |
|
30 |
echo |
|
31 |
exit 1 |
|
32 |
} |
|
33 |
||
34 |
fail() |
|
35 |
{ |
|
36 |
echo "$1" >&2 |
|
37 |
exit 2 |
|
38 |
} |
|
39 |
||
40 |
||
41 |
## process command line |
|
42 |
||
43 |
# options |
|
44 |
||
45 |
while getopts "j:s:" OPT |
|
46 |
do |
|
47 |
case "$OPT" in |
|
48 |
j) |
|
49 |
JEDIT_HOME="$OPTARG" |
|
50 |
;; |
|
51 |
s) |
|
52 |
SCALA_HOME="$OPTARG" |
|
53 |
;; |
|
54 |
\?) |
|
55 |
usage |
|
56 |
;; |
|
57 |
esac |
|
58 |
done |
|
59 |
||
60 |
shift $(($OPTIND - 1)) |
|
61 |
||
62 |
||
63 |
# args |
|
64 |
||
65 |
[ "$#" -ne 0 ] && usage |
|
66 |
||
67 |
||
68 |
## main |
|
69 |
||
70 |
cd "$THIS/dist" || fail "Bad directory: $THIS/dist" |
|
71 |
||
72 |
||
73 |
# target name |
|
74 |
||
75 |
VERSION=$(basename "$JEDIT_HOME") |
|
76 |
JEDIT="jedit-${VERSION}" |
|
77 |
||
78 |
rm -rf "$JEDIT" jedit |
|
79 |
mkdir "$JEDIT" |
|
80 |
ln -s "$JEDIT" jedit |
|
81 |
||
82 |
||
83 |
# copy stuff |
|
84 |
||
85 |
[ "$JEDIT_HOME/jedit.jar" ] || fail "Bad original jEdit directory: $JEDIT_HOME" |
|
86 |
cp -R "$JEDIT_HOME/." "$JEDIT/." |
|
87 |
||
88 |
[ "$SCALA_HOME/lib/scala-library.jar" ] || fail "Bad Scala directory: $SCALA_HOME" |
|
89 |
cp "$SCALA_HOME/lib/scala-library.jar" "$JEDIT/jars/" |
|
90 |
||
91 |
cp -R "$THIS/dist-template/." "$JEDIT/." |
|
92 |
||
34379 | 93 |
cp jars/Isabelle-jEdit.jar "$JEDIT/jars/isabelle.jar" |
94 |
cp jars/lib/Pure.jar "$JEDIT/jars/isabelle-Pure.jar" |
|
95 |
cp jars/lib/core-renderer.jar "$JEDIT/jars/" |
|
34395
287f3ecdfc2a
include Sidekick its dependency ErrorList in dist
immler@in.tum.de
parents:
34379
diff
changeset
|
96 |
cp jars/lib/ErrorList.jar "$JEDIT/jars/" |
287f3ecdfc2a
include Sidekick its dependency ErrorList in dist
immler@in.tum.de
parents:
34379
diff
changeset
|
97 |
cp jars/lib/SideKick.jar "$JEDIT/jars/" |
34332 | 98 |
|
99 |
||
100 |
# build archive |
|
101 |
||
102 |
echo "${JEDIT}.tar.gz" |
|
103 |
tar czf "${JEDIT}.tar.gz" "$JEDIT" jedit |
|
104 |
ln -sf "${JEDIT}.tar.gz" jedit.tar.gz |