-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.sh
executable file
·59 lines (47 loc) · 859 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /bin/sh
#
# Simple installer for Unix-like systems.
#
Z=`basename $0`
os=`uname`
me=`id -u`
warn() {
echo "$Z: $@" 1>&2
}
die() {
echo "$Z: $@" 1>&2
exit 1
}
e=
if [ $me -ne 0 ]; then
warn "Not root; running in dry-run mode .."
e=echo
fi
dest=
case $os in
Darwin)
for d in /opt/local /usr/local; do
if [ -d $d ]; then
dest=$d
break
fi
done
;;
*BSD)
dest=/usr/local
;;
Linux*)
dest=/usr/local
;;
*)
die "I don't know what to do on $os"
;;
esac
if [ "x$dest" = "x" ]; then
die "Dest dir not known for $os"
fi
$e mkdir -p $dest/bin $dest/man/man1
$e cp mkgetopt.py $dest/bin/
gzip -9 -c mkgetopt.1 > /tmp/a.gz
$e cp /tmp/a.gz $dest/man/man1/mkgetopt.py.1.gz
rm -f /tmp/a.gz