5
Invoke this script from a $package bzr branch to build source packages for
6
all target distributions and upload them to a PPA.
10
-p=<PPA>|--ppa=<PPA> The PPA to upload to. This gets passed to dput, please
11
make sure you have a matching stanza in your ~/.dput.cf
13
-k=<KEY>|--key=<KEY> The GPG key used to sign the packages
15
-s|--snapshot Tweak the Debian revision by including the current bzr
16
revision number in it (e.g. 1.4.0~bzr178-0ubuntu0.8.04)
18
-h|--help Print this help and exit
25
# Check if we are in a bzr branch
27
if ! [ -d .bzr ] || ! [ -f debian/changelog ]; then
28
echo "Error: not in a package bzr branch"
34
# Set defaults and parse command line arguments
37
key=free.ekanayaka@canonical.com
39
package=$(dpkg-parsechangelog |grep ^Source|cut -f 2 -d " ")
40
version=$(dpkg-parsechangelog |grep ^Version|cut -f 2 -d " ")
41
upstream=$(echo $version | cut -f 1 -d "-")
46
ppa=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
49
key=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
58
echo "Error: unknown option $i"
65
if [ "$snapshot" = "yes" ]; then
66
bzr_rev=$(bzr log -l 1|grep ^revno|cut -f 2 -d " ")
67
upstream="$upstream~bzr$bzr_rev"
71
# Clean up from possible previous runs
73
rm -fR ../${package}-*
79
bzr export ../${package}-${upstream}
81
cp -a ${package}-${upstream} ${package}-${upstream}.orig
82
rm -R ${package}-${upstream}.orig/debian
83
cd ${package}-${upstream}
86
# Build source packages and upload them
88
releases="dapper_6.06 hardy_8.04 intrepid_8.10 jaunty_9.04 karmic_9.10"
90
if [ "$snapshot" = "yes" ]; then
91
# Snapshot, we'll add a dummy changelog entry like for all releases
93
releases="$releases lucid_10.04"
95
# Actual release, use the latest changelog entry and upload now
96
dpkg-buildpackage -S -sa -k$key
97
dput $ppa ../${package}_${version}_source.changes
101
for release in $releases; do
103
codename=$(echo $release|cut -f 1 -d _)
104
revision=0ubuntu0.$(echo $release|cut -f 2 -d _)
105
if ! [ "$snapshot" = "yes" ]; then
106
revision=${revision}.0~landscape1
108
version=$upstream-$revision
110
if [ "$snapshot" = "yes" ]; then
111
message="Snapshot build for $codename"
113
message="Built for $codename, no source changes"
115
cp debian/changelog ../
116
dch --force-distribution -b -v $version -D $codename -m $message
117
dpkg-buildpackage -S $source_opt -k$key
118
dput $ppa ../${package}_${version}_source.changes
119
mv ../changelog debian