-
Notifications
You must be signed in to change notification settings - Fork 4
/
buildenv
88 lines (76 loc) · 2.55 KB
/
buildenv
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
# Set up environment variables for general build tool to operate
# This buildenv is a sample. It describes the minimal environment
# variables required to set up a port environment.
export ZOPEN_CATEGORIES="utilities"
# The ZOPEN_BUILD_LINE is required. This indicates whether the Open-Source
# package contents are stored in a 'dev' format or a 'stable' format.
# All environment variables will be set up so they can use the overridden
# form, so that tests driving the code can test different paths of 'zopen build'
#
if [ -z "${ZOPEN_BUILD_LINE}" ]; then
export ZOPEN_BUILD_LINE="STABLE"
fi
#
# Given the ZOPEN_BUILD_LINE, 'zopen build' will then need to know what the
# underlying build line to use - either ZOPEN_STABLE... or ZOPEN_DEV...
#
# The default specified above is STABLE, so ZOPEN_STABLE_URL and ZOPEN_STABLE_DEPS need to be specified.
# The ZOPEN_[STABLE|DEV]_URL specifies where to download from (git, tar, gz formats supported).
# The ZOPEN_[STABLE|DEV]_DEPS lists each of the ported tools that are needed to perform a build.
# If you only need 'core' tools such as curl, gzip, tar, make, git, zoslib, then specify ZOPEN_STABLE_DEPS=' ' (it has to be defined)
#
# Packages could require basic tools like m4, perl, autoconf, etc.
if [ -z "${ZOPEN_STABLE_URL}" ]; then
export ZOPEN_STABLE_URL="https://github.com/ZOSOpenTools/zotsample/releases/download/zotsample-1.3/zotsample-1.3.tar.gz"
fi
if [ -z "${ZOPEN_STABLE_DEPS}" ]; then
export ZOPEN_STABLE_DEPS="make comp_clang"
fi
if [ -z "${ZOPEN_DEV_URL}" ]; then
export ZOPEN_DEV_URL="https://github.com/ZOSOpenTools/zotsample.git"
fi
if [ -z "${ZOPEN_DEV_BRANCH}" ]; then
export ZOPEN_DEV_BRANCH="dev"
fi
if [ -z "${ZOPEN_DEV_DEPS}" ]; then
export ZOPEN_DEV_DEPS="make comp_clang"
fi
#
# zopen_check_results _must_ be specified and it needs to print out 3 lines:
# actualFailures:<number>
# totalTests:<number>
# expectedFailures:<number>
#
# This enables the build to determine if the quality is sufficient to install the build
#
zopen_check_results()
{
dir="$1"
pfx="$2"
chk="$1/$2_check.log"
success=$(grep -c "All tests passed" ${chk})
totalTests=1
failures=$((totalTests-success))
cat <<ZZ
actualFailures:$failures
totalTests:$totalTests
expectedFailures:0
ZZ
}
#
# zopen_get_version _must_ be specified.
#
zopen_get_version()
{
echo "1.1"
}
zopen_append_to_env()
{
# Optional: Add additional environment variables to .env besides PATH, LIBPATH, MANPATH, PROJECT_ROOT
echo "export ZOT=\${PWD}"
}
zopen_post_install()
{
# Optional: Post processing of install path
echo "In Post Install: $1"
}