summaryrefslogtreecommitdiff
path: root/tools/packaging
diff options
context:
space:
mode:
authorLorry <lorry@roadtrain.codethink.co.uk>2012-08-22 15:47:16 +0100
committerLorry <lorry@roadtrain.codethink.co.uk>2012-08-22 15:47:16 +0100
commit25335618bf8755ce6b116ee14f47f5a1f2c821e9 (patch)
treed889d7ab3f9f985d0c54c534cb8052bd2e6d7163 /tools/packaging
downloadbzr-tarball-25335618bf8755ce6b116ee14f47f5a1f2c821e9.tar.gz
Tarball conversion
Diffstat (limited to 'tools/packaging')
-rwxr-xr-xtools/packaging/build-packages.sh13
-rwxr-xr-xtools/packaging/lp-upload-release82
-rwxr-xr-xtools/packaging/update-changelogs.sh34
-rwxr-xr-xtools/packaging/update-control.sh32
-rwxr-xr-xtools/packaging/update-packaging-branches.sh25
5 files changed, 186 insertions, 0 deletions
diff --git a/tools/packaging/build-packages.sh b/tools/packaging/build-packages.sh
new file mode 100755
index 0000000..be94ef0
--- /dev/null
+++ b/tools/packaging/build-packages.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+# Helper to build packages for the various distributions
+
+if [ -z "$UBUNTU_RELEASES" ]; then
+ echo "Configure the distro platforms that you want to"
+ echo "build with a line like:"
+ echo ' export UBUNTU_RELEASES="dapper feisty gutsy hardy intrepid jaunty"'
+ exit 1
+fi
+
+for DISTRO in $UBUNTU_RELEASES; do
+ (cd "$PACKAGE-$DISTRO" && bzr builddeb -S)
+done
diff --git a/tools/packaging/lp-upload-release b/tools/packaging/lp-upload-release
new file mode 100755
index 0000000..fd61f7a
--- /dev/null
+++ b/tools/packaging/lp-upload-release
@@ -0,0 +1,82 @@
+#! /bin/zsh -e
+
+# upload a release file to Launchpad
+#
+# usage: lp-upload-release [--staging] bzr-1.2.3.tgz
+
+setopt extended_glob
+
+if [ "$1" = "--staging" ]
+then
+ shift
+ server="staging.launchpad.net"
+else
+ server="launchpad.net"
+fi
+
+if [ $# -ne 1 ]
+then
+ echo "usage: lp-upload-release VERSION FILENAME"
+ exit 2
+fi
+
+if [ -z "$EMAIL" ]
+then
+ echo "please set $EMAIL to an address registered with Launchpad"
+ exit 2
+fi
+
+upfile="$1"
+if [ \! -f "$1" ]
+then
+ echo "$upfile is not a file"
+ exit 2
+fi
+
+sigfile="$upfile.sig"
+if [ \! -f "$sigfile" ]
+then
+ echo "couldn't find gpg signature $sigfile"
+ exit 2
+fi
+
+# just in case
+gpg $sigfile
+
+# parse the product and release number out of a filename like
+# "bzr-foo-1.23rc1.tar.gz"
+
+# need to strip off the .tar too for .tar.gz files
+headpart=${${upfile:r}%.tar}
+filetype="${upfile#${headpart}}"
+basename="${${headpart:t}%%-[0-9].*}"
+version="${${headpart:t}##*-}"
+echo $basename $version $filetype
+
+# bzr puts just the first part of the version into the series, e.g. 1.8 from 1.8rc1
+series=${version%(rc|beta|alpha)*}
+
+for v in basename version filetype series
+do
+ echo "$v=${(P)v}"
+done
+
+curl -u "$EMAIL" \
+ https://$server/$basename/$series/$version/+adddownloadfile \
+ -F field.description="$basename $version source" \
+ -F field.filecontent="@${upfile}" \
+ -F field.contenttype=CODETARBALL \
+ -F field.actions.add=Upload
+
+reported_md5=$( curl https://$server/$basename/$series/$version/+download/$filetail/+md5 )
+expected_md5="$(md5sum "$upfile")"
+expected_md5=${${(z)expected_md5}[1]}
+
+for v in reported_md5 expected_md5
+do
+ echo "$v=${(P)v}"
+done
+
+[ $reported_md5 = $expected_md5 ]
+
+# vim: sw=4
diff --git a/tools/packaging/update-changelogs.sh b/tools/packaging/update-changelogs.sh
new file mode 100755
index 0000000..3d1dcbc
--- /dev/null
+++ b/tools/packaging/update-changelogs.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# Helper to insert a new entry in debian/changelog
+
+if [ -z "$UBUNTU_RELEASES" ]; then
+ echo "Configure the distro platforms that you want to"
+ echo "build with a line like:"
+ echo ' export UBUNTU_RELEASES="dapper feisty gutsy hardy intrepid jaunty"'
+ exit 1
+fi
+
+if [ "x$VERSION" = "x" ]; then
+ echo "Missing version"
+ echo "You want something like:"
+ echo " VERSION=1.6~rc1-1~bazaar1 update-changelogs.sh"
+ echo "or"
+ echo " VERSION=1.6-1~bazaar1 update-changelogs.sh"
+ exit
+fi
+
+if [ -z "$1" ]; then
+ MSG="New upstream release"
+else
+ MSG=$1
+fi
+
+for DISTRO in $UBUNTU_RELEASES; do
+ PPAVERSION="$VERSION~${DISTRO}1"
+ (
+ echo "Updating changelog for $DISTRO"
+ cd "$PACKAGE-$DISTRO" &&
+ dch -v $PPAVERSION -D $DISTRO "$MSG." &&
+ bzr commit -m "$MSG: $PPAVERSION"
+ )
+done
diff --git a/tools/packaging/update-control.sh b/tools/packaging/update-control.sh
new file mode 100755
index 0000000..ae5cd80
--- /dev/null
+++ b/tools/packaging/update-control.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+# Helper to run sed on versions in dependencies in debian/control
+
+if [ -z "$UBUNTU_RELEASES" ]; then
+ echo "Configure the distro platforms that you want to"
+ echo "build with a line like:"
+ echo ' export UBUNTU_RELEASES="dapper feisty gutsy hardy intrepid jaunty"'
+ exit 1
+fi
+
+OLD_VERSION=$1
+NEW_VERSION=$2
+NEXT_VERSION=$3
+if [ -z "$OLD_VERSION" -o -z "$NEW_VERSION" -o -z "$NEXT_VERSION" ]; then
+ echo "Missing version"
+ echo "You want something like:"
+ echo " update-control.sh 1.5 1.6 1.7"
+ exit
+fi
+
+if [ "$PACKAGE" = "bzr" ]; then
+ continue
+fi
+for DISTRO in $UBUNTU_RELEASES; do
+ PPAVERSION="$VERSION~${DISTRO}1"
+ (
+ echo "Updating control for $DISTRO"
+ cd "$PACKAGE-$DISTRO" &&
+ sed -i -e "s/$NEW_VERSION~/$NEXT_VERSION~/;s/$OLD_VERSION~/$NEW_VERSION~/" control &&
+ bzr commit -m "New upstream release: $PPAVERSION, update control"
+ )
+done
diff --git a/tools/packaging/update-packaging-branches.sh b/tools/packaging/update-packaging-branches.sh
new file mode 100755
index 0000000..c56f457
--- /dev/null
+++ b/tools/packaging/update-packaging-branches.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+# Helper for updating all of the packaging branches
+
+if [ -z "$UBUNTU_RELEASES" ]; then
+ echo "Configure the distro platforms that you want to"
+ echo "build with a line like:"
+ echo ' export UBUNTU_RELEASES="dapper feisty gutsy hardy intrepid jaunty"'
+ exit 1
+fi
+
+for DISTRO in $UBUNTU_RELEASES; do
+ if [ -d "$PACKAGE-$DISTRO" ] ; then
+ echo "Updating $PACKAGE-$DISTRO"
+ bzr update $PACKAGE-$DISTRO
+ if [ "$PACKAGE" = "bzr-svn" ] ; then
+ cd $PACKAGE-$DISTRO
+ bzr merge http://bzr.debian.org/pkg-bazaar/bzr-svn/unstable/
+ cd ..
+ fi
+ else
+ SRC="lp:~bzr/ubuntu/$DISTRO/$PACKAGE/bzr-ppa"
+ echo "Checking out $SRC"
+ bzr co $SRC $PACKAGE-$DISTRO
+ fi
+done