Debian Codegraph @

modules/hwloc/contrib/dist/make_dist_tarball

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 # Copyright © 2004-2005 The Trustees of Indiana University and Indiana
4 # University Research and Technology
5 # Corporation. All rights reserved.
6 # Copyright © 2004-2005 The University of Tennessee and The University
7 # of Tennessee Research Foundation. All rights
8 # reserved.
9 # Copyright © 2004-2005 High Performance Computing Center Stuttgart,
10 # University of Stuttgart. All rights reserved.
11 # Copyright © 2004-2005 The Regents of the University of California.
12 # All rights reserved.
13 # Copyright © 2008-2013 Cisco Systems, Inc. All rights reserved.
14 # Copyright © 2012-2022 Inria. All rights reserved.
15 # $COPYRIGHT$
16 #
17 # Additional copyrights may follow
18 #
19 # $HEADER$
20 #
21
22 #########################################################################
23 # Make greek and non-greek distribution (i.e., non-snapshot) tarballs
24 #########################################################################
25
26 #
27 # Version of auto tools that we want
28 #
29
30 AM_TARGET_VERSION=1.16.5
31 AC_TARGET_VERSION=2.71
32 LT_TARGET_VERSION=2.4.7
33
34 #
35 # First things first -- check that the auto versions that we have are
36 # the ones that we want.
37 #
38
39 check_gnu_versionscip-shell shell shell-project 0.0.0 check_gnu_version().() {
40 prog="$1"
41 target="$2"
42
43 ver="`$prog --version | headscip-shell system . . head. -n 1 | cutscip-shell system . . cut. -d\ -f 4`"
44 if testscip-shell system . . test. "$ver" != "$target"; then
45 catscip-shell system . . cat. <<EOF
46 ERROR: Program "$prog" does not have the correct/expected version:
47 Found: $ver
48
49 Expected versions:
50 Automake: $AM_TARGET_VERSION
51 Autoconf: $AC_TARGET_VERSION
52 Libtool: $LT_TARGET_VERSION
53
54 Either change this script to match the found version, or install
55 the correct version of the tools.
56 EOF
57 exit 1
58 fi
59 }
60
61 #
62 # Subroutine to actually make a tarball
63 #
64
65 make_tarballscip-shell shell shell-project 0.0.0 make_tarball().() {
66 #
67 # Autogen
68 #
69 echoscip-shell system . . echo. "*** Removing old configure..."
70 # Ensure that configure is re-generated -- sometimes it won't be
71 # (if it hasn't changed), and therefore VERSION could be newer
72 # than configure, and that leads to all kinds of problems
73 rmscip-shell system . . rm. -f configure
74
75 echoscip-shell system . . echo. "*** Running autogen.sh..."
76 rmscip-shell system . . rm. -f success
77 (./autogen.sh 2>&1 && touchscip-shell system . . touch. success) | teescip-shell system . . tee. auto.out
78 if testscip-shell system . . test. ! -f success; then
79 echoscip-shell system . . echo. "Autogen failed. Aborting"
80 exit 1
81 fi
82
83 #
84 # Configure
85 #
86 echoscip-shell system . . echo. "*** Running configure..."
87 rmscip-shell system . . rm. -f success
88 (./configure 2>&1 && touchscip-shell system . . touch. success) | teescip-shell system . . tee. config.out
89 if testscip-shell system . . test. ! -f success; then
90 echoscip-shell system . . echo. "Configure failed. Aborting"
91 exit 1
92 fi
93
94 #
95 # Explicitly create the doxygen docs
96 #
97 echoscip-shell system . . echo. "*** Making doxygen docs..."
98 cd doc
99 rmscip-shell system . . rm. -rf doxygen-doc
100 rmscip-shell system . . rm. -f success
101 (makescip-shell system . . make. doc 2>&1 && touchscip-shell system . . touch. success) | teescip-shell system . . tee. doc.out
102 if testscip-shell system . . test. ! -f success; then
103 echoscip-shell system . . echo. "Making doxygen docs failed. Aborting"
104 exit 1
105 fi
106
107 #
108 # Explicitly create the README file
109 #
110 echoscip-shell system . . echo. "*** Making README..."
111 rmscip-shell system . . rm. -rf ../README
112 rmscip-shell system . . rm. -f success
113 (makescip-shell system . . make. readme 2>&1 && touchscip-shell system . . touch. success) | teescip-shell system . . tee. readme.out
114 if testscip-shell system . . test. ! -f success; then
115 echoscip-shell system . . echo. "Making README failed. Aborting"
116 exit 1
117 fi
118 rmscip-shell system . . rm. -f success
119 cd ..
120
121 #
122 # make tarball
123 #
124 echoscip-shell system . . echo. "*** Running make distcheck..."
125 save_LD=$LD_LIBRARY_PATH
126 LD_LIBRARY_PATH=
127 rmscip-shell system . . rm. -f success
128 (makescip-shell system . . make. distcheck 2>&1 && touchscip-shell system . . touch. success) | teescip-shell system . . tee. dist.out
129 if testscip-shell system . . test. ! -f success; then
130 echoscip-shell system . . echo. "Make distcheck failed. Aborting"
131 exit 1
132 fi
133 rmscip-shell system . . rm. -f success
134 LD_LIBRARY_PATH=$save_LD
135
136 echoscip-shell system . . echo. "*** All done"
137 }
138
139 #########################################################################
140 # main
141 #########################################################################
142
143 echoscip-shell system . . echo. "*** Checking GNU tools versions..."
144 check_gnu_versionscip-shell shell shell-project 0.0.0 check_gnu_version(). automake $AM_TARGET_VERSION
145 check_gnu_versionscip-shell shell shell-project 0.0.0 check_gnu_version(). autoconf $AC_TARGET_VERSION
146 check_gnu_versionscip-shell shell shell-project 0.0.0 check_gnu_version(). libtool $LT_TARGET_VERSION
147
148 #
149 # Verify that we're in a top hwloc dir
150 #
151 echoscip-shell system . . echo. "*** Checking to ensure in top-level HWLOC directory..."
152 if testscip-shell system . . test. -f VERSION -a -f configure.ac -a -f config/hwloc.m4 -a -e .git; then
153 happy=1
154 else
155 echoscip-shell system . . echo. "Do not appear to be in a hwloc git clone top directory. Abort!"
156 exit 1
157 fi
158
159 #
160 # Set VERSION to not build a snapshot
161 #
162 echoscip-shell system . . echo. "*** Git reverting VERSION files..."
163 gitscip-shell system . . git. diff VERSION | patchscip-shell system . . patch. -p1 -R
164
165 #
166 # Substitute in the release date and disable snapshot build
167 #
168 echoscip-shell system . . echo. "*** Substituting in release date and disabling snapshot..."
169 release_date=`export LANG=; export LC_ALL=; export LC_TIME=; datescip-shell system . . date. '+%b %d, %Y'`
170 sedscip-shell system . . sed. -e "s/^date=.*/date=\"$release_date\"/" \
171 -e "s/^snapshot=.*/snapshot=0/" \
172 VERSION > VERSION.new
173 cpscip-shell system . . cp. -f VERSION.new VERSION
174 rmscip-shell system . . rm. -f VERSION.new
175
176 #
177 # Make 2 tarballs:
178 #
179 # - one with the greek
180 # - one without the greek
181 #
182 # unless the user specifically said --greekonly, then only make the
183 # greek tarball. Making both tarballs at once allows us to guarantee
184 # to have two tarballs -- one greek and one not -- that have exactly
185 # the same git describe (as opposed to, for example, running this
186 # script to make a greek tarball, then running it again to make a
187 # non-greek tarball -- there is a race condition that someone could
188 # commit in the meantime and change the git describe number in the 2nd
189 # tarball)
190 #
191
192 # First, make greek tarball
193
194 echoscip-shell system . . echo. "*** Making greek tarball"
195 make_tarballscip-shell shell shell-project 0.0.0 make_tarball().
196
197 # Now if ! --greekonly, make the non-greek tarball
198
199 if testscip-shell system . . test. "$1" != "-greekonly" -a "$1" != "--greekonly"; then
200 echoscip-shell system . . echo. "*** REMOVING ALL GREEK FROM VERSION NUMBERS!!"
201 sedscip-shell system . . sed. -e 's/^greek=.*/greek=/' VERSION > VERSION.new
202 cpscip-shell system . . cp. -f VERSION.new VERSION
203 rmscip-shell system . . rm. -f VERSION.new
204 echoscip-shell system . . echo. "Making non-greek tarball"
205 make_tarballscip-shell shell shell-project 0.0.0 make_tarball().
206 fi
207
208 # Put the VERSION and README files back the way they were
209 echoscip-shell system . . echo. "*** Reverting VERSION and README files"
210 gitscip-shell system . . git. diff VERSION README | patchscip-shell system . . patch. -p1 -R