author | wenzelm |
Tue, 20 Apr 1999 15:23:43 +0200 | |
changeset 6459 | 1d13a86bfa6c |
parent 6450 | 990e6e2dee26 |
child 6545 | a8a235a8a4a3 |
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:" |
6459 | 16 |
echo " -d DISTDIR refer to 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 |
||
6450 | 37 |
NO_OPTS=true |
38 |
||
5403 | 39 |
DISTDIR="$ISABELLE_HOME" |
6417 | 40 |
KDE="" |
41 |
BINDIR="" |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
42 |
|
6417 | 43 |
while getopts "d:kp:" OPT |
5403 | 44 |
do |
45 |
case "$OPT" in |
|
5404 | 46 |
d) |
5403 | 47 |
DISTDIR="$OPTARG" |
6450 | 48 |
NO_OPTS="" |
5403 | 49 |
;; |
6417 | 50 |
k) |
51 |
KDE=true |
|
6450 | 52 |
NO_OPTS="" |
6417 | 53 |
;; |
54 |
p) |
|
55 |
BINDIR="$OPTARG" |
|
6450 | 56 |
NO_OPTS="" |
6417 | 57 |
;; |
5403 | 58 |
\?) |
59 |
usage |
|
60 |
;; |
|
61 |
esac |
|
62 |
done |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
63 |
|
5403 | 64 |
shift $(($OPTIND - 1)) |
65 |
||
66 |
||
67 |
# args |
|
68 |
||
6450 | 69 |
[ $# -ne 0 -o -n "$NO_OPTS" ] && usage |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
70 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
71 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
72 |
## main |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
73 |
|
6459 | 74 |
echo "referring to distribution at $DISTDIR" |
6417 | 75 |
|
76 |
||
77 |
# standalone binaries |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
78 |
|
6082 | 79 |
#set by configure |
80 |
AUTO_BASH=/bin/bash |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
81 |
|
6417 | 82 |
if [ -n "$BINDIR" ]; then |
83 |
mkdir -p "$BINDIR" || fail "Bad directory: $BINDIR" |
|
84 |
||
85 |
for NAME in isatool isabelle Isabelle |
|
86 |
do |
|
87 |
BIN="$BINDIR/$NAME" |
|
88 |
DIST="$DISTDIR/bin/$NAME" |
|
89 |
echo "installing $BIN" |
|
90 |
echo "#!$AUTO_BASH" >$BIN || fail "Cannot write file: $BIN" |
|
91 |
echo >>$BIN |
|
92 |
echo "exec $DIST \"\$@\"" >>$BIN |
|
93 |
chmod +x $BIN |
|
94 |
done |
|
95 |
fi |
|
96 |
||
97 |
||
98 |
# install KDE application icon |
|
5403 | 99 |
|
6417 | 100 |
KDEHOME=~/.kde |
101 |
KDEAPP=~/Desktop/Isabelle.kdelnk |
|
102 |
||
103 |
if [ "$KDE" = true ]; then |
|
104 |
mkdir -p $KDEHOME/share/icons || fail "Bad directory: $KDEHOME/share/icons" |
|
105 |
||
106 |
ICON=$KDEHOME/share/icons/isabelle.xpm |
|
6459 | 107 |
[ -f $ICON ] || cp $ISABELLE_HOME/lib/logo/isabelle-tiny.xpm $ICON || fail "Cannot write file: $ICON" |
6417 | 108 |
|
109 |
echo "installing $KDEAPP" |
|
110 |
echo "# KDE Config File" >$KDEAPP || fail "Cannot write file: $KDEAPP" |
|
111 |
echo "[KDE Desktop Entry]" >>$KDEAPP |
|
112 |
echo "Type=Application" >>$KDEAPP |
|
113 |
echo "Exec=$DISTDIR/bin/Isabelle" >>$KDEAPP |
|
114 |
echo "Icon=isabelle.xpm" >>$KDEAPP |
|
115 |
echo "TerminalOptions=" >>$KDEAPP |
|
116 |
echo "Path=" >>$KDEAPP |
|
117 |
echo "Terminal=0" >>$KDEAPP |
|
118 |
echo "Name=Isabelle" >>$KDEAPP |
|
119 |
||
120 |
type -p kfmclient >/dev/null && kfmclient refreshDesktop |
|
121 |
fi |