-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathbuilddist
executable file
·163 lines (143 loc) · 4.49 KB
/
builddist
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#!/bin/bash
print_usage() {
echo "Usage: builddist <tag>"
echo ""
echo "Tags:"
echo " develop - build tarball of latest"
echo " v3.1.0"
}
# check that we got an argument or print usage
if [ $# -ne 1 ] ; then
print_usage
exit 1
fi
# for a given release, define tags for each component
if [ "$1" == "develop" ] ; then
# to build from latest branch of all repos
ORGS=(
"lwgrp" "llnl" "main"
"dtcmp" "llnl" "main"
"kvtree" "ecp-veloc" "main"
"axl" "ecp-veloc" "main"
"spath" "ecp-veloc" "main"
"shuffile" "ecp-veloc" "main"
"redset" "ecp-veloc" "main"
"er" "ecp-veloc" "main"
"rankstr" "ecp-veloc" "main"
"scr" "llnl" "develop"
)
#elif [ "$1" == "v3.0rc1" ] ; then
# # to build the scr-v3.0rc1 release
# ORGS=(
# "lwgrp" "llnl" "v1.0.3"
# "dtcmp" "llnl" "v1.1.2"
# "kvtree" "ecp-veloc" "v1.1.1"
# "axl" "ecp-veloc" "v0.4.0"
# "spath" "ecp-veloc" "v0.0.2"
# "shuffile" "ecp-veloc" "v0.0.4"
# "redset" "ecp-veloc" "v0.0.5"
# "er" "ecp-veloc" "v0.0.4"
# "rankstr" "ecp-veloc" "v0.0.3"
# "scr" "llnl" "v3.0rc1"
# )
#elif [ "$1" == "v3.0rc2" ] ; then
# # to build the scr-v3.0rc2 release
# ORGS=(
# "lwgrp" "llnl" "v1.0.4"
# "dtcmp" "llnl" "v1.1.3"
# "kvtree" "ecp-veloc" "v1.2.0"
# "axl" "ecp-veloc" "v0.5.0"
# "spath" "ecp-veloc" "v0.1.0"
# "shuffile" "ecp-veloc" "v0.1.0"
# "redset" "ecp-veloc" "v0.1.0"
# "er" "ecp-veloc" "v0.1.0"
# "rankstr" "ecp-veloc" "v0.1.0"
# "scr" "llnl" "v3.0rc2"
# )
#elif [ "$1" == "v3.0" ] ; then
# # to build the scr-v3.0 release
# ORGS=(
# "lwgrp" "llnl" "v1.0.5"
# "dtcmp" "llnl" "v1.1.4"
# "kvtree" "ecp-veloc" "v1.3.0"
# "axl" "ecp-veloc" "v0.6.0"
# "spath" "ecp-veloc" "v0.2.0"
# "shuffile" "ecp-veloc" "v0.2.0"
# "redset" "ecp-veloc" "v0.2.0"
# "er" "ecp-veloc" "v0.2.0"
# "rankstr" "ecp-veloc" "v0.2.0"
# "scr" "llnl" "v3.0"
# )
elif [ "$1" == "v3.1.0" ] ; then
# to build the scr-v3.1.0 release
ORGS=(
"lwgrp" "llnl" "v1.0.6"
"dtcmp" "llnl" "v1.1.5"
"kvtree" "ecp-veloc" "v1.5.0"
"axl" "ecp-veloc" "v0.9.0"
"spath" "ecp-veloc" "v0.4.0"
"shuffile" "ecp-veloc" "v0.4.0"
"redset" "ecp-veloc" "v0.4.0"
"er" "ecp-veloc" "v0.5.0"
"rankstr" "ecp-veloc" "v0.4.0"
"scr" "llnl" "v3.1.0"
)
else
echo "Error: unknown tag: $1"
echo ""
print_usage
exit 1
fi
set -x
# we assume everything is hosted at github
REPOHOST=https://github.com
# create a temporary directory to package things up
rm -rf dist
mkdir dist
cd dist
ARCH_DIR="archive"
rm -rf $ARCH_DIR
mkdir -p $ARCH_DIR
len=${#ORGS[@]}
for (( i=0; i<${len}; i=$(($i + 3)) )); do
# component name
component=${ORGS[$i]}
# github path to component
j=$(($i + 1))
repo=$REPOHOST/${ORGS[$j]}/$component
# repo tag to checkout
j=$(($i + 2))
TAG=${ORGS[$j]}
# clone the repo
git clone --depth 1 --branch $TAG $repo
# git archive the source files into a tarfile
cd $component
#TAG=`git describe --tags $(git rev-list --tags --max-count=1)`
git archive --format=tar --prefix=$component/ $TAG | gzip > $component-$TAG.tar.gz 2> /dev/null
cd ..
# unpack source files for this component in a directory with other components
cd $ARCH_DIR
tar -zxf ../$component/$component-$TAG.tar.gz
# hack out include of autotools config.h (not used anyway)
if [ "$component" == "lwgrp" ] ; then
sed -i 's@#include "../config/config.h"@@g' lwgrp/src/lwgrp_internal.h
fi
# remove doc and test directories for a smaller tarball
rm -rf ${component}/doc
rm -rf ${component}/doc-dev
if [ "$component" != "scr" ] ; then
rm -rf ${component}/test
fi
cd ..
done
# rename archive directory to scr-SCRTAG
mv $ARCH_DIR scr-$TAG
# copy in top-level CMake files
cp -r ../CMakeLists.txt ../NOTICE ../cmake scr-$TAG
# copy in README file
cp -r ../README.dist scr-$TAG/README
# zip up release tarball
tar -czf ../scr-${TAG}.tgz scr-$TAG
# delete prep directory
cd ..
rm -rf dist