-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·98 lines (63 loc) · 1.7 KB
/
setup.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
#!/bin/bash
JAR_FILE=si-iws-builder-latest.jar
OPENSRC_DIR=/QOpenSys/pkgs/bin
################################################################################
#
# Procedures.
#
################################################################################
# exist_directory dest
#
# dest is an directory to check
#
# exit 1 (succeeds) directort exist, else 0.
exist_directory()
{
[ -d "${1}" ] && return 0 || return 1
}
#
# install_yum_dependencies
#
install_yum_dependencies()
{
yum -y install 'make-gnu' 'curl' 'jq'
}
#
# install_jar_dependencies
#
install_jar_dependencies()
{
if [ -f "$1" ]; then
echo "All Jar dependencies are present."
else
echo "$1 does not exist. It will be downloaded ..."
curl http://files.sranko-informatik.de/getGithubPackage.php?package=si-iws-builder --output $1
fi
}
#
# build_project
#
build_project()
{
gmake all
}
################################################################################
#
# Main
#
################################################################################
if exist_directory "${OPENSRC_DIR}"; then
echo "5733-OPS product is installed ..."
else
echo "Please install 5733-OPS product first."
fi
# set path to OpenSource
echo "setting path to OpenSource ..."
export PATH=${OPENSRC_DIR}:$PATH
echo "installing dependencies for si-iws-builder-example ..."
echo "installing yum dependencies ..."
install_yum_dependencies
echo "installing jar dependencies ..."
install_jar_dependencies ${JAR_FILE}
echo "build si-iws-builder-example ..."
build_project