-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·104 lines (89 loc) · 1.91 KB
/
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
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
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# Install script for themispkg created manually.
# Pre-Req: gawk, GNUcore-utils, git, gcc.
#
# Builded structures:
# directories:
# /usr/share/themis
# /usr/share/themis/openssl
# /usr/share/themis/repositories
# /etc/themis
# /usr/local/lib/bash/5.17
# /usr/local/lib/bash/5.17/themis
# specific files:
# /etc/bash_completion.d/themis.sh
# /etc/themis/repositories.baml
# /usr/share/themis/packages.db
# /usr/bin/themis
export cwd="${PWD}"
[[ "${UID}" != 0 ]] && { echo "Run this with root privalages!" ; exit 1 ;}
die() {
echo "${1}"
exit "${2}"
}
check() {
echo -n "checking for '${1}'.. "
command -v "${1}" &> /dev/null && echo "ok" || die "no" "$?"
}
# it does not cover the dependencies of dependencies
check git
check tar
check gcc
check install
check awk
check chmod
check chown
check cp
check ln
check ls
check mkdir
check mv
check rm
check rmdir
check touch
check basename
check cat
check comm
check cut
check dirname
check echo
check expand
check false
check true
check head
check seq
check sort
check tail
check tee
check tr
check uniq
check wc
check env
check date
# if you can't pass this stage then try to install 'Pre-Reqs'.
echo "building baml.."
cp ./lib/baml.h ./src/baml/baml.h
gcc ./src/baml/main.c ./src/baml/baml.c -o ./src/baml/baml
echo "creating directories.."
mkdir -p "/etc/themis" "/usr/share/themis/repositories" "/usr/share/themis/openssl" "/usr/local/lib/bash/5.17/themis"
echo "Installing bash libraries"
git clone "https://github.com/themispkg/bash-utils"
cd "bash-utils"
make install || die "could not getting 'bash-utils'" "$?"
cd "${cwd}"
git clone "https://github.com/themispkg/bashtextbank"
cd "bashtextbank"
make install || die "could not getting 'bashtextbank'" "$?"
cd "${cwd}"
# Sqlite3
if ! command -v sqlite3 &> /dev/null ; then
:
fi
# OpenSSL
if ! command -v openssl &> /dev/null ; then
:
fi
# Yap
if ! command -v yap &> /dev/null ; then
:
fi