| author | wenzelm | 
| Fri, 02 Jul 1999 15:05:16 +0200 | |
| changeset 6887 | 12b5fb35a688 | 
| parent 6545 | a8a235a8a4a3 | 
| child 7887 | eedfff88ee40 | 
| 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  | 
|
| 6545 | 102  | 
KDEICONS=$KDEHOME/share/icons  | 
| 6417 | 103  | 
|
104  | 
if [ "$KDE" = true ]; then  | 
|
| 6545 | 105  | 
mkdir -p $KDEICONS || fail "Bad directory: $KDEICONS"  | 
106  | 
mkdir -p $KDEICONS/mini || fail "Bad directory: $KDEICONS/mini"  | 
|
| 6417 | 107  | 
|
| 6545 | 108  | 
[ -f $KDEICONS/isabelle.xpm ] || cp $ISABELLE_HOME/lib/icons/isabelle.xpm $KDEICONS || \  | 
109  | 
fail "Cannot write file: $KDEICONS/isabelle.xpm"  | 
|
110  | 
[ -f $KDEICONS/mini/isabelle.xpm ] || \  | 
|
111  | 
cp $ISABELLE_HOME/lib/icons/isabelle-mini.xpm $KDEICONS/mini/isabelle.xpm || \  | 
|
112  | 
fail "Cannot write file: $KDEICONS/mini/isabelle.xpm"  | 
|
| 6417 | 113  | 
|
114  | 
echo "installing $KDEAPP"  | 
|
115  | 
echo "# KDE Config File" >$KDEAPP || fail "Cannot write file: $KDEAPP"  | 
|
116  | 
echo "[KDE Desktop Entry]" >>$KDEAPP  | 
|
117  | 
echo "Type=Application" >>$KDEAPP  | 
|
118  | 
echo "Exec=$DISTDIR/bin/Isabelle" >>$KDEAPP  | 
|
119  | 
echo "Icon=isabelle.xpm" >>$KDEAPP  | 
|
120  | 
echo "TerminalOptions=" >>$KDEAPP  | 
|
121  | 
echo "Path=" >>$KDEAPP  | 
|
122  | 
echo "Terminal=0" >>$KDEAPP  | 
|
123  | 
echo "Name=Isabelle" >>$KDEAPP  | 
|
124  | 
||
125  | 
type -p kfmclient >/dev/null && kfmclient refreshDesktop  | 
|
126  | 
fi  |