]> git.proxmox.com Git - ceph.git/blame - ceph/make-dist
drop patches applied upstream
[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
23# clean out old cruft...
24echo "cleanup..."
25rm -f $outfile*
26
27# build new tarball
28echo "building tarball..."
29bin/git-archive-all.sh --prefix ceph-$version/ \
30 --verbose \
31 --ignore corpus \
32 $outfile.tar
33
34# populate files with version strings
35echo "including src/.git_version, ceph.spec"
36
37(git rev-parse HEAD ; git describe) 2> /dev/null > src/.git_version
38
39# if the version has '-' in it, it has a 'release' part,
40# like vX.Y.Z-N-g<shortsha1>. If it doesn't, it's just
41# vX.Y.Z. Handle both, and translate - to . for rpm
42# naming rules (the - separates version and release).
43
44if expr index $version '-' > /dev/null; then
45 rpm_version=`echo $version | cut -d - -f 1-1`
46 rpm_release=`echo $version | cut -d - -f 2- | sed 's/-/./'`
47else
48 rpm_version=$version
49 rpm_release=0
50fi
51
52
53for spec in ceph.spec.in alpine/APKBUILD.in; do
54 cat $spec |
55 sed "s/@VERSION@/$rpm_version/g" |
56 sed "s/@RPM_RELEASE@/$rpm_release/g" |
57 sed "s/@TARBALL_BASENAME@/ceph-$version/g" > `echo $spec | sed 's/.in$//'`
58done
59ln -s . $outfile
60tar cvf $outfile.version.tar $outfile/src/.git_version $outfile/ceph.spec $outfile/alpine/APKBUILD
61tar --concatenate -f $outfile.both.tar $outfile.version.tar
62tar --concatenate -f $outfile.both.tar $outfile.tar
63mv $outfile.both.tar $outfile.tar
64rm $outfile
65rm -f $outfile.version.tar
66
67echo "compressing..."
68bzip2 -9 $outfile.tar
69
70echo "done."