ceph/build_upload_debian_packages.sh

74 lines
1.7 KiB
Bash
Raw Normal View History

#!/bin/sh
2009-02-24 22:21:25 +00:00
vers=`grep AM_INIT_AUTOMAKE configure.ac | head -1 | cut '-d ' -f 2 | sed 's/)//'`
echo vers $vers
repo=$1
2009-02-24 22:13:37 +00:00
arch=$2
snapshot=$3
if [ "$repo" = "unstable" ]; then
versuffix=`date "+%Y%m%d%H%M%S"`
# if [ `echo $vers | sed 's/[^\.]//g'` = ".." ]; then
# finalvers="$vers$versuffix"
# else
# finalvers="$vers.$versuffix"
# fi
finalvers="${vers}git$versuffix"
debdate=`date "+%a, %d %b %Y %X %z"`
else
finalvers="$vers"
fi
echo final vers $finalvers
echo cleanup
rm *.deb *.tar.gz *.changes *.dsc
rm -rf ceph-$vers*
2009-09-10 22:10:29 +00:00
echo generating git version stamp
cd src
./make_version
grep GIT_VER ceph_ver.h
cd ..
echo building tarball
make dist
echo extracting
tar zxf ceph-$vers.tar.gz
if [ "$vers" != "$finalvers" ]; then
echo "renaming ceph-$vers to ceph-$finalvers, rebuilding tarball"
mv ceph-$vers ceph-$finalvers
sed -i "s/ceph, $vers/ceph, $finalvers/" ceph-$finalvers/configure.ac
mv ceph-$finalvers/debian/changelog ceph-$finalvers/debian/changelog.tmp
cat <<EOF > ceph-$finalvers/debian/changelog
ceph ($finalvers) unstable; urgency=low
* snapshot from git at $versuffix
-- sage <sage@newdream.net> $debdate
EOF
cat ceph-$finalvers/debian/changelog.tmp >> ceph-$finalvers/debian/changelog
tar zcf ceph-$finalvers.tar.gz ceph-$finalvers
fi;
if [ "$repo" == "stable" ]; then
scp ceph-$vers.tar.gz sage@ceph.newdream.net:ceph.newdream.net/downloads
fi
cd ceph-$finalvers
./autogen.sh
dpkg-buildpackage -rfakeroot
cd ..
2009-02-27 22:23:49 +00:00
# upload
2009-07-23 18:45:16 +00:00
rsync -v --progress *$arch.{deb,changes} sage@ceph.newdream.net:debian/dists/$repo/main/binary-$arch
2009-08-05 22:42:15 +00:00
rsync -v --progress ceph_* sage@ceph.newdream.net:debian/dists/$repo/main/source
# rebuild index
2009-07-23 18:45:16 +00:00
ssh sage@ceph.newdream.net build_debian_repo.sh