2010-03-01 04:19:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
vers=`grep AM_INIT_AUTOMAKE configure.ac | head -1 | cut '-d ' -f 2 | sed 's/)//'`
|
|
|
|
echo vers $vers
|
|
|
|
|
|
|
|
repo=$1
|
|
|
|
force=$2
|
|
|
|
|
2010-05-05 22:26:45 +00:00
|
|
|
[ -z "$repo" ] && echo stable or testing or unstable && exit 1
|
2010-03-01 04:19:04 +00:00
|
|
|
|
|
|
|
if git diff --quiet ; then
|
|
|
|
echo repository is clean
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo "**** REPOSITORY IS DIRTY ****"
|
|
|
|
echo
|
|
|
|
if [ "$force" != "force" ]; then
|
|
|
|
echo "add 'force' argument if you really want to continue."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "forcing."
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo generating git version stamp
|
|
|
|
cd src
|
|
|
|
./make_version
|
|
|
|
gitver=`grep GIT_VER ceph_ver.h | awk '{print $3}' | cut -c 1-8`
|
|
|
|
echo gitver $gitver
|
|
|
|
cd ..
|
|
|
|
|
2010-05-05 22:26:45 +00:00
|
|
|
if [ "$repo" = "testing" ]; then
|
2010-03-01 04:19:04 +00:00
|
|
|
versuffix=`date "+%Y%m%d%H%M"`
|
2010-05-05 22:26:45 +00:00
|
|
|
finalvers="${vers}-testing${versuffix}-$gitver"
|
2010-03-01 04:19:04 +00:00
|
|
|
else
|
2010-05-05 22:26:45 +00:00
|
|
|
if [ "$repo" = "unstable" ]; then
|
|
|
|
versuffix=`date "+%Y%m%d%H%M"`
|
|
|
|
finalvers="${vers}-unstable${versuffix}-$gitver"
|
|
|
|
else
|
|
|
|
finalvers="$vers"
|
|
|
|
fi
|
2010-03-01 04:19:04 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo final vers $finalvers
|
|
|
|
|
|
|
|
echo building tarball
|
|
|
|
make dist
|
|
|
|
|
|
|
|
echo extracting
|
|
|
|
mkdir -p release/$finalvers
|
|
|
|
cd release/$finalvers
|
|
|
|
|
|
|
|
tar zxf ../../ceph-$vers.tar.gz
|
|
|
|
[ "$vers" != "$finalvers" ] && mv ceph-$vers ceph-$finalvers
|
|
|
|
tar zcf ceph_$finalvers.orig.tar.gz ceph-$finalvers
|
|
|
|
|
2010-03-10 05:38:30 +00:00
|
|
|
# add debian dir
|
|
|
|
cp -a ../../debian ceph-$finalvers
|
|
|
|
|
2010-03-01 04:19:04 +00:00
|
|
|
for dist in sid squeeze lenny
|
|
|
|
do
|
|
|
|
echo building $dist dsc
|
|
|
|
# mkdir $dist
|
|
|
|
# cd $dist
|
|
|
|
|
|
|
|
dvers="$finalvers-1"
|
|
|
|
[ "$dist" = "squeeze" ] && dvers="$dvers~bpo60+1"
|
|
|
|
[ "$dist" = "lenny" ] && dvers="$dvers~bpo50+1"
|
|
|
|
|
|
|
|
comment=""
|
|
|
|
[ -n "$versuffix" ] && comment="git snapshot "
|
|
|
|
[ "$dist" != "sid" ] && comment="${comment}$dist backport"
|
|
|
|
|
|
|
|
if [ -n "$comment" ]; then
|
|
|
|
cd ceph-$finalvers
|
|
|
|
DEBEMAIL="sage@newdream.net" dch -b -v "$dvers" "$comment"
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
|
|
|
dpkg-source -b ceph-*
|
|
|
|
|
|
|
|
# cd ..
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -r ceph-$finalvers
|
|
|
|
cp -a ceph_$finalvers.orig.tar.gz ceph-$finalvers.tar.gz
|
|
|
|
echo finished release $finalvers
|