]> git.proxmox.com Git - ceph.git/blame - ceph/make-dist
bump version to 12.2.10-pve1
[ceph.git] / ceph / make-dist
CommitLineData
7c673cae
FG
1#!/bin/sh -e
2
3if [ ! -d .git ]; then
4 echo "no .git present. run this from the base dir of the git checkout."
5 exit 1
6fi
7
8version=$1
9[ -z "$version" ] && version=`git describe --match 'v*' | sed 's/^v//'`
10outfile="ceph-$version"
11
12echo "version $version"
13
14# update submodules
15echo "updating submodules..."
16force=$(if git submodule usage 2>&1 | grep --quiet 'update.*--force'; then echo --force ; fi)
17if ! git submodule sync || ! git submodule update $force --init --recursive; then
18 echo "Error: could not initialize submodule projects"
19 echo " Network connectivity might be required."
20 exit 1
21fi
22
b32b8144
FG
23download_boost() {
24 boost_version=$1
25 shift
26 boost_md5=$1
27 shift
28 boost_version_underscore=$(echo $boost_version | sed 's/\./_/g')
29 boost_fname=boost_${boost_version_underscore}.tar.bz2
30 set +e
31 while true; do
32 url_base=$1
33 shift
34 if [ -z $url_base ]; then
35 echo "Error: failed to download boost."
36 exit
37 fi
38 url=$url_base/$boost_fname
39 wget -c --no-verbose -O $boost_fname $url
40 if [ $? != 0 -o ! -e $boost_fname ]; then
41 echo "Download of $url failed"
42 elif [ $(md5sum $boost_fname | awk '{print $1}') != $boost_md5 ]; then
43 echo "Error: failed to download boost: MD5 mismatch."
44 else
45 break
46 fi
47 done
48 set -e
49 tar xjf $boost_fname -C src \
50 --exclude="$boost_version_underscore/libs/*/doc" \
51 --exclude="$boost_version_underscore/libs/*/example" \
52 --exclude="$boost_version_underscore/libs/*/examples" \
53 --exclude="$boost_version_underscore/libs/*/meta" \
54 --exclude="$boost_version_underscore/libs/*/test" \
55 --exclude="$boost_version_underscore/tools/boostbook" \
56 --exclude="$boost_version_underscore/tools/quickbook" \
57 --exclude="$boost_version_underscore/tools/auto_index" \
58 --exclude='doc' --exclude='more' --exclude='status'
59 mv src/boost_${boost_version_underscore} src/boost
60 tar cf ${outfile}.boost.tar ${outfile}/src/boost
61 rm -rf src/boost
62}
63
7c673cae
FG
64# clean out old cruft...
65echo "cleanup..."
66rm -f $outfile*
67
68# build new tarball
69echo "building tarball..."
70bin/git-archive-all.sh --prefix ceph-$version/ \
71 --verbose \
72 --ignore corpus \
73 $outfile.tar
74
75# populate files with version strings
76echo "including src/.git_version, ceph.spec"
77
78(git rev-parse HEAD ; git describe) 2> /dev/null > src/.git_version
79
80# if the version has '-' in it, it has a 'release' part,
81# like vX.Y.Z-N-g<shortsha1>. If it doesn't, it's just
82# vX.Y.Z. Handle both, and translate - to . for rpm
83# naming rules (the - separates version and release).
84
85if expr index $version '-' > /dev/null; then
86 rpm_version=`echo $version | cut -d - -f 1-1`
87 rpm_release=`echo $version | cut -d - -f 2- | sed 's/-/./'`
88else
89 rpm_version=$version
90 rpm_release=0
91fi
92
7c673cae
FG
93for spec in ceph.spec.in alpine/APKBUILD.in; do
94 cat $spec |
95 sed "s/@VERSION@/$rpm_version/g" |
96 sed "s/@RPM_RELEASE@/$rpm_release/g" |
97 sed "s/@TARBALL_BASENAME@/ceph-$version/g" > `echo $spec | sed 's/.in$//'`
98done
99ln -s . $outfile
100tar cvf $outfile.version.tar $outfile/src/.git_version $outfile/ceph.spec $outfile/alpine/APKBUILD
b32b8144
FG
101# NOTE: If you change this version number make sure the package is available
102# at the three URLs referenced below (may involve uploading to download.ceph.com)
103boost_version=1.66.0
104download_boost $boost_version b2dfbd6c717be4a7bb2d88018eaccf75 \
105 https://dl.bintray.com/boostorg/release/$boost_version/source \
106 https://downloads.sourceforge.net/project/boost/boost/$boost_version \
107 https://download.ceph.com/qa
108tar --concatenate -f $outfile.all.tar $outfile.version.tar
109tar --concatenate -f $outfile.all.tar $outfile.boost.tar
110tar --concatenate -f $outfile.all.tar $outfile.tar
111mv $outfile.all.tar $outfile.tar
7c673cae
FG
112rm $outfile
113rm -f $outfile.version.tar
b32b8144 114rm -f $outfile.boost.tar
7c673cae
FG
115
116echo "compressing..."
117bzip2 -9 $outfile.tar
118
119echo "done."