forked from zopencommunity/zotsampleport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildenv
74 lines (67 loc) · 2.77 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
# 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.
# The ZOPEN_TYPE is required. This indicates whether the Open-Source
# package contents are stored in a 'git' format or a 'tarball' format.
# At some point, other formats (perhaps pax) may be supported
# For this example, we are specifying that we will use a zipped tarball format
# for our build.
#
export ZOPEN_TYPE="TARBALL"
#
# Given the ZOPEN_TYPE, build.sh will then need to know where to download from,
# and what other software is required to be able to build this code.
# Since a TARBALL was selected, the environment variables
# ZOPEN_TARBALL_URL and ZOPEN_TARBALL_DEPS are required to be specified.
# The ZOPEN_TARBALL_URL is the fully-qualified location of the tar.gz format of
# tarball, or the tar.xz format of tarball.
# The ZOPEN_TARBALL_DEPS lists each of the ported tools that are required to be
# able to build the code. In the simplest case, this will include:
# - curl: required to be able to download the tarball
# - gz or xz: required to be able to unzip the tarball
# - git: required by build.sh to be able to apply patches
# Many packages will require basic tools like m4, make.
#
# Regarding the URL for the binaries. Using ../releases/download.. vs raw/main...
# The releases version picks the first version. The raw will pick the last version.
#
# zotsample 1.0
# export ZOPEN_TARBALL_URL="https://github.com/ZOSOpenTools/zotsampleport/releases/download/zotsample-1.0/zotsample-1.0.tar.gz"
# zotsample 1.1
export ZOPEN_TARBALL_URL="https://github.com/ZOSOpenTools/zotsampleport/raw/main/tarballs/zotsample-1.1.tar.gz"
#
export ZOPEN_TARBALL_DEPS="curl gzip make tar zoslib"
#
# It can be convenient to include the environment variables for the 'other' format in
# buildenv so that if you want to switch from tarball to git (and back), you just need
# to change the ZOPEN_TYPE variable.
# The GIT environment variables are analagous to the TARBALL environment variables.
# The minimal required list of dependencies will be:
# - git: required to be able to clone the tarball and apply patche
#
export ZOPEN_GIT_URL="[email protected]:ZOSOpenTools/zotsampleport.git"
export ZOPEN_GIT_DEPS="git make"
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_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"
}