3 SCRIPTNAME
="$(basename "${0}")"
4 BASEDIR
="$(readlink -f "$
(dirname "${0}")")"
7 echo "$SCRIPTNAME: Full path to the script: $BASEDIR/$SCRIPTNAME"
8 echo "$SCRIPTNAME: No .git present. Run this from the base dir of the git checkout."
12 # Running the script from a directory containing a colon anywhere in the path
13 # will expose us to the dreaded "[BUG] npm run [command] failed if the directory
14 # path contains colon" bug https://github.com/npm/cli/issues/633
15 # (see https://tracker.ceph.com/issues/39556 for details)
16 if [[ "$BASEDIR" == *:* ]] ; then
17 echo "$SCRIPTNAME: Full path to the script: $BASEDIR/$SCRIPTNAME"
18 echo "$SCRIPTNAME: The path to the script contains a colon. Their presence has been known to break the script."
23 [ -z "$version" ] && version
=$
(git describe
--long --match 'v*' |
sed 's/^v//')
24 if expr index
$version '-' > /dev
/null
; then
25 rpm_version
=$
(echo $version | cut
-d - -f 1-1)
26 rpm_release
=$
(echo $version | cut
-d - -f 2- |
sed 's/-/./')
32 outfile
="ceph-$version"
33 echo "version $version"
36 echo "updating submodules..."
37 force
=$
(if git submodule usage
2>&1 |
grep --quiet 'update.*--force'; then echo --force ; fi)
38 if ! git submodule sync ||
! git submodule update
$force --init --recursive; then
39 echo "Error: could not initialize submodule projects"
40 echo " Network connectivity might be required."
53 if [ -z $url_base ]; then
54 echo "Error: failed to download $name."
58 wget
-c --no-verbose -O $fname $url
59 if [ $?
!= 0 -o ! -e $fname ]; then
60 echo "Download of $url failed"
61 elif [ $
(sha256sum
$fname |
awk '{print $1}') != $sha256 ]; then
62 echo "Error: failed to download $name: SHA256 mismatch."
75 boost_version_underscore
=$
(echo $boost_version |
sed 's/\./_/g')
76 boost_fname
=boost_
${boost_version_underscore}.
tar.bz2
77 download_from
$boost_fname $boost_sha256 $
*
78 tar xjf
$boost_fname -C src \
79 --exclude="$boost_version_underscore/libs/*/doc" \
80 --exclude="$boost_version_underscore/libs/*/example" \
81 --exclude="$boost_version_underscore/libs/*/examples" \
82 --exclude="$boost_version_underscore/libs/*/meta" \
83 --exclude="$boost_version_underscore/libs/*/test" \
84 --exclude="$boost_version_underscore/tools/boostbook" \
85 --exclude="$boost_version_underscore/tools/quickbook" \
86 --exclude="$boost_version_underscore/tools/auto_index" \
87 --exclude='doc' --exclude='more' --exclude='status'
88 mv src
/boost_
${boost_version_underscore} src
/boost
89 tar cf
${outfile}.boost.
tar ${outfile}/src
/boost
98 liburing_fname
=liburing-
${liburing_version}.
tar.gz
99 download_from
$liburing_fname $liburing_sha256 $
*
100 tar xzf
$liburing_fname -C src \
105 # normalize the names, liburing-0.7 if downloaded from git.kernel.dk,
106 # liburing-liburing-0.7 from github.com
107 mv src
/liburing-
* src
/liburing
108 tar cf
${outfile}.liburing.
tar ${outfile}/src
/liburing
117 pmdk_fname
=pmdk-
${pmdk_version}.
tar.gz
118 download_from
$pmdk_fname $pmdk_sha256 $
*
119 tar xzf
$pmdk_fname -C src \
120 --exclude="pmdk-${pmdk_version}/doc" \
121 --exclude="pmdk-${pmdk_version}/src/test" \
122 --exclude="pmdk-${pmdk_version}/src/examples" \
123 --exclude="pmdk-${pmdk_version}/src/benchmarks"
124 mv src
/pmdk-
${pmdk_version} src
/pmdk
125 tar cf
${outfile}.pmdk.
tar ${outfile}/src
/pmdk
129 build_dashboard_frontend
() {
133 $CURR_DIR/src
/tools
/setup-virtualenv.sh
$TEMP_DIR
134 $TEMP_DIR/bin
/pip
install nodeenv
135 $TEMP_DIR/bin
/nodeenv
--verbose -p --node=12.18.2
136 cd src
/pybind
/mgr
/dashboard
/frontend
138 .
$TEMP_DIR/bin
/activate
139 NG_CLI_ANALYTICS
=false timeout
1h npm ci
140 echo "Building ceph-dashboard frontend with build:localize script";
141 # we need to use "--" because so that "--prod" survives accross all
142 # scripts redirections inside package.json
143 npm run build
:localize
-- --prod
147 tar cf dashboard_frontend.
tar $outfile/src
/pybind
/mgr
/dashboard
/frontend
/dist
150 generate_rook_ceph_client
() {
151 $outfile/src
/pybind
/mgr
/rook
/generate_rook_ceph_client.sh
152 tar cf rook_ceph_client.
tar $outfile/src
/pybind
/mgr
/rook
/rook_client
/*.py
155 # clean out old cruft...
160 echo "building tarball..."
161 bin
/git-archive-all.sh
--prefix ceph-
$version/ \
166 # populate files with version strings
167 echo "including src/.git_version, ceph.spec"
169 (git rev-parse HEAD
; echo $version) 2> /dev
/null
> src
/.git_version
171 for spec
in ceph.spec.
in; do
173 sed "s/@PROJECT_VERSION@/$rpm_version/g" |
174 sed "s/@RPM_RELEASE@/$rpm_release/g" |
175 sed "s/@TARBALL_BASENAME@/ceph-$version/g" > `echo $spec | sed 's/.in$//'`
178 tar cvf
$outfile.version.
tar $outfile/src
/.git_version
$outfile/ceph.spec
179 # NOTE: If you change this version number make sure the package is available
180 # at the three URLs referenced below (may involve uploading to download.ceph.com)
182 download_boost
$boost_version 4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402 \
183 https
://boostorg.jfrog.io
/artifactory
/main
/release
/$boost_version/source \
184 https
://downloads.sourceforge.net
/project
/boost
/boost
/$boost_version \
185 https
://download.ceph.com
/qa
186 download_liburing
0.7 8e2842cfe947f3a443af301bdd6d034455536c38a455c7a700d0c1ad165a7543 \
187 https
://github.com
/axboe
/liburing
/archive \
188 https
://git.kernel.dk
/cgit
/liburing
/snapshot
190 download_pmdk
$pmdk_version 08dafcf94db5ac13fac9139c92225d9aa5f3724ea74beee4e6ca19a01a2eb20c \
191 https
://github.com
/pmem
/pmdk
/releases
/download
/$pmdk_version
192 build_dashboard_frontend
193 generate_rook_ceph_client
194 for tarball
in $outfile.version \
201 tar --concatenate -f $outfile.all.
tar $tarball.
tar
204 mv $outfile.all.
tar $outfile.
tar
207 echo "compressing..."
208 bzip2 -9 $outfile.
tar