-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·60 lines (46 loc) · 1020 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
60
#!/bin/sh
user=$USER
depcheck () {
success="success"
for p in $*; do
prog=`which $p`
if [ "$prog" = "" ]; then
echo "Couldn't find $p"
success=""
fi
done
if [ "$success" = "" ]; then
return 1
fi
return 0
}
depcheck lowdown xmllint sqlite3
if [ "$?" = "1" ]; then
echo Missing dependencies, aborting installation
exit 1
fi
if [ "$user" = "root" ]; then
group=wheel
mode=555
destination=/usr/local/bin
docmode=444
docdestination=/usr/local/man
else
group=`groups | sed 's/ .*//'`
mode=700
destination=$HOME/.local/bin
docmode=600
docdestination=$HOME/.local/man
fi
for f in src/*; do
filename=${f#src/}
install -m $mode -o $user -g $group -D $f \
$destination/$filename
done
for d in doc/*; do
section=${d##*.}
filename=${d#doc/}
install -m $mode -o $user -g $group -D $d \
$docdestination/man${section}/$filename
done
# vi: et sts=4 ts=4 sw=4