#!/bin/sh
#### TODO ####
#
# This should loop through the releases rather than the same script copy and pasted
############ start feisty build ########################
#build counter
ppa=`more OSGPPA`
ppa=$(($ppa+1))
#grab the latest version
cvs -z3 -d:pserver:anonymous@opensg.cvs.sourceforge.net:/cvsroot/opensg co -P OpenSG
#remove all of the CVS dir's
find . -name "CVS" -print | xargs rm -rf
#move it to match the version etc
mv OpenSG opensg-cvs-1.8.0alpha1
#update the changelog
echo "opensg-cvs (1:1.8.0alpha1-0ubuntu1~ppa"$ppa") feisty; urgency=low" >> debian-feisty/changelog.temp
echo "" >> debian-feisty/changelog.temp
echo " * Automatic weekly build " >> debian-feisty/changelog.temp
echo "" >> debian-feisty/changelog.temp
echo " -- David Morris <david.morris@greenacre.no-ip.com> " `date --rfc-2822` >> debian-feisty/changelog.temp
echo "" >> debian-feisty/changelog.temp
mv debian-feisty/changelog.temp debian-feisty/changelog
#copy our debian control stuff in
cp -r debian-feisty opensg-cvs-1.8.0alpha1/debian
#copy in the pkg-config file
cp libopensg.pc opensg-cvs-1.8.0alpha1/.
#build the source package
cd opensg-cvs-1.8.0alpha1
dpkg-buildpackage -S -rfakeroot
cd ..
#sign the source package using the phraseless key
debsign -k<key-id> opensg-cvs_1.8.0alpha1-0ubuntu1~ppa*_source.changes
#upload the source package to ppa
dput opensg opensg-cvs_1.8.0alpha1-0ubuntu1~ppa*_source.changes
#save the PPA number
echo $ppa > OSGPPA
#clean up the checkout
rm -rf opensg-cvs-1.8.0alpha1
mv opensg-cvs_1.8.0alpha1-0ubuntu1~ppa* previous-builds/.
############ end feisty build ########################
############ start gutsy build #######################
#build counter
ppa=`more OSGPPA`
ppa=$(($ppa+1))
#grab the latest version
cvs -z3 -d:pserver:anonymous@opensg.cvs.sourceforge.net:/cvsroot/opensg co -P OpenSG
#remove all of the CVS dir's
find . -name "CVS" -print | xargs rm -rf
#move it to match the version etc
mv OpenSG opensg-cvs-1.8.0alpha1
#update the changelog
echo "opensg-cvs (1:1.8.0alpha1-0ubuntu1~ppa"$ppa") gutsy; urgency=low" >> debian-gutsy/changelog.temp
echo "" >> debian-gutsy/changelog.temp
echo " * Automatic weekly build " >> debian-gutsy/changelog.temp
echo "" >> debian-gutsy/changelog.temp
echo " -- David Morris <david.morris@greenacre.no-ip.com> " `date --rfc-2822` >> debian-gutsy/changelog.temp
echo "" >> debian-gutsy/changelog.temp
mv debian-gutsy/changelog.temp debian-gutsy/changelog
#copy our debian control stuff in
cp -r debian-gutsy opensg-cvs-1.8.0alpha1/debian
#copy in the pkg-config file
cp libopensg.pc opensg-cvs-1.8.0alpha1/.
#build the source package
cd opensg-cvs-1.8.0alpha1
dpkg-buildpackage -S -rfakeroot
cd ..
#sign the source package using the phraseless key
debsign -k<key-id> opensg-cvs_1.8.0alpha1-0ubuntu1~ppa*_source.changes
#upload the source package to ppa
dput opensg opensg-cvs_1.8.0alpha1-0ubuntu1~ppa*_source.changes
#save the PPA number
echo $ppa > OSGPPA
#clean up the checkout
rm -rf opensg-cvs-1.8.0alpha1
mv opensg-cvs_1.8.0alpha1-0ubuntu1~ppa* previous-builds/.
############ end gutsy build #######################