author | wenzelm |
Tue, 13 Apr 1999 12:36:11 +0200 | |
changeset 6417 | 39941b906910 |
parent 6082 | 590f9e3bf4d8 |
child 6450 | 990e6e2dee26 |
permissions | -rwxr-xr-x |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
1 |
#!/bin/bash |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
2 |
# |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
3 |
# $Id$ |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
4 |
# |
6417 | 5 |
# DESCRIPTION: install standalone Isabelle executables |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
6 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
7 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
8 |
PRG=$(basename $0) |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
9 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
10 |
function usage() |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
11 |
{ |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
12 |
echo |
6417 | 13 |
echo "Usage: $PRG [OPTIONS]" |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
14 |
echo |
5403 | 15 |
echo " Options are:" |
16 |
echo " -d DISTDIR use DISTDIR as Isabelle distribution (default ISABELLE_HOME)" |
|
6417 | 17 |
echo " -k install KDE application icon on Desktop" |
18 |
echo " -p DIR install standalone binaries in DIR" |
|
5403 | 19 |
echo |
6417 | 20 |
echo " Install Isabelle executables with absolute references to the current" |
21 |
echo " distribution directory." |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
22 |
echo |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
23 |
exit 1 |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
24 |
} |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
25 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
26 |
function fail() |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
27 |
{ |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
28 |
echo "$1" >&2 |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
29 |
exit 2 |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
30 |
} |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
31 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
32 |
|
5403 | 33 |
## process command line |
34 |
||
35 |
# options |
|
36 |
||
37 |
DISTDIR="$ISABELLE_HOME" |
|
6417 | 38 |
KDE="" |
39 |
BINDIR="" |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
40 |
|
6417 | 41 |
while getopts "d:kp:" OPT |
5403 | 42 |
do |
43 |
case "$OPT" in |
|
5404 | 44 |
d) |
5403 | 45 |
DISTDIR="$OPTARG" |
46 |
;; |
|
6417 | 47 |
k) |
48 |
KDE=true |
|
49 |
;; |
|
50 |
p) |
|
51 |
BINDIR="$OPTARG" |
|
52 |
;; |
|
5403 | 53 |
\?) |
54 |
usage |
|
55 |
;; |
|
56 |
esac |
|
57 |
done |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
58 |
|
5403 | 59 |
shift $(($OPTIND - 1)) |
60 |
||
61 |
||
62 |
# args |
|
63 |
||
6417 | 64 |
[ $# -ne 0 ] && usage |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
65 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
66 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
67 |
## main |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
68 |
|
6417 | 69 |
echo "distribution at $DISTDIR" |
70 |
||
71 |
||
72 |
# standalone binaries |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
73 |
|
6082 | 74 |
#set by configure |
75 |
AUTO_BASH=/bin/bash |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
76 |
|
6417 | 77 |
if [ -n "$BINDIR" ]; then |
78 |
mkdir -p "$BINDIR" || fail "Bad directory: $BINDIR" |
|
79 |
||
80 |
for NAME in isatool isabelle Isabelle |
|
81 |
do |
|
82 |
BIN="$BINDIR/$NAME" |
|
83 |
DIST="$DISTDIR/bin/$NAME" |
|
84 |
echo "installing $BIN" |
|
85 |
echo "#!$AUTO_BASH" >$BIN || fail "Cannot write file: $BIN" |
|
86 |
echo >>$BIN |
|
87 |
echo "exec $DIST \"\$@\"" >>$BIN |
|
88 |
chmod +x $BIN |
|
89 |
done |
|
90 |
fi |
|
91 |
||
92 |
||
93 |
# install KDE application icon |
|
5403 | 94 |
|
6417 | 95 |
KDEHOME=~/.kde |
96 |
KDEAPP=~/Desktop/Isabelle.kdelnk |
|
97 |
||
98 |
if [ "$KDE" = true ]; then |
|
99 |
mkdir -p $KDEHOME/share/icons || fail "Bad directory: $KDEHOME/share/icons" |
|
100 |
||
101 |
ICON=$KDEHOME/share/icons/isabelle.xpm |
|
102 |
[ -f $ICON ] || cp $DISTDIR/lib/logo/isabelle-tiny.xpm $ICON || fail "Cannot write file: $ICON" |
|
103 |
||
104 |
echo "installing $KDEAPP" |
|
105 |
echo "# KDE Config File" >$KDEAPP || fail "Cannot write file: $KDEAPP" |
|
106 |
echo "[KDE Desktop Entry]" >>$KDEAPP |
|
107 |
echo "Type=Application" >>$KDEAPP |
|
108 |
echo "Exec=$DISTDIR/bin/Isabelle" >>$KDEAPP |
|
109 |
echo "Icon=isabelle.xpm" >>$KDEAPP |
|
110 |
echo "TerminalOptions=" >>$KDEAPP |
|
111 |
echo "Path=" >>$KDEAPP |
|
112 |
echo "Terminal=0" >>$KDEAPP |
|
113 |
echo "Name=Isabelle" >>$KDEAPP |
|
114 |
||
115 |
type -p kfmclient >/dev/null && kfmclient refreshDesktop |
|
116 |
fi |