-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall-dependencies.sh
executable file
·94 lines (73 loc) · 1.87 KB
/
install-dependencies.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
set -e
test -z "$Build_Debug" || set -x
test -z "$Build_Deps_Default_Paths" || {
test -n "$SRC_PREFIX" || {
test -w /src/ \
&& SRC_PREFIX=/src/ \
|| SRC_PREFIX=$HOME/build
}
test -n "$PREFIX" || {
test -w /usr/local/ \
&& PREFIX=/usr/local/ \
|| PREFIX=$HOME/.local
}
}
test -n "$sudo" || sudo=
test -z "$sudo" || pref="sudo $pref"
test -z "$dry_run" || pref="echo $pref"
test -n "$SRC_PREFIX" || {
echo "Not sure where checkout"
exit 1
}
test -n "$PREFIX" || {
echo "Not sure where to install"
exit 1
}
test -d $SRC_PREFIX || ${pref} mkdir -vp $SRC_PREFIX
test -d $PREFIX || ${pref} mkdir -vp $PREFIX
install_docopt()
{
test -n "$install_f" || install_f="$py_setup_f"
git clone https://github.com/dotmpe/docopt-mpe.git $SRC_PREFIX/docopt-mpe
( cd $SRC_PREFIX/docopt-mpe \
&& git checkout 0.6.x \
&& $pref python ./setup.py install $install_f )
}
install_mkdoc()
{
test -n "$MKDOC_BRANCH" || MKDOC_BRANCH=master
echo "Installing mkdoc ($MKDOC_BRANCH)"
(
cd $SRC_PREFIX
test -e mkdoc ||
git clone https://github.com/dotmpe/mkdoc.git
cd mkdoc
git checkout $MKDOC_BRANCH
./configure $PREFIX && ./install.sh
)
rm Makefile || printf ""
ln -s $PREFIX/share/mkdoc/Mkdoc-full.mk Makefile
}
main_entry()
{
test -n "$1" || set -- all
case "$1" in all|python|project|docopt)
# Using import seems more robust than scanning pip list
python -c 'import docopt' || { install_docopt || return $?; }
;; esac
case "$1" in all|mkdoc)
test -e Makefile \
|| install_mkdoc || return $?
;; esac
echo "OK. All pre-requisites for '$1' checked"
}
test "$(basename $0)" = "install-dependencies.sh" && {
test -n "$1" || set -- all
while test -n "$1"
do
main_entry "$1" || exit $?
shift
done
} || printf ""
# Id: uriref/0 install-dependencies.sh