Differences between revisions 1 and 2
Revision 1 as of 2008-07-24 16:17:55
Size: 1137
Editor: SandroTosi
Comment:
Revision 2 as of 2008-07-24 18:17:19
Size: 2254
Editor: SandroTosi
Comment:
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
x.(y+1)-z
   or > x.y+foo-z > x.y-z > x.y~bar-z
x.(y+1)-1
   or > x.y+foo-1 > x.y-z > x.y~bar-1
Line 21: Line 21:
 1. if x.y-z is in sid and you're packaging the new version "without a name", then go with x.y+svn<rev>-z  1. if x.y-z is in sid and you're packaging the new version "without a name", then go with x.y+svn<rev>-1
Line 23: Line 23:

=== Update the {{{debian/changelog}}} ===

now that you have your new package version what you have to do is:

{{{
$ dch -v "<new version>" "New upstream SVN snapshot"
}}}

=== Create {{{get-orig-source}}} target for {{{debian/rules}}} ===

We are almost done, we need to create the {{{get-orig-source}}} target in {{{debian/rules}}} file.


{{{

PACKAGE = checkgmail
SRC_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | sed 's/^Version: \(.*\)-.*/\1/')
SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz

get-orig-source:
        TMPDIR = $(shell mktemp -d)
        svn export -r $(SVN_REVISION) https://checkgmail.svn.sourceforge.net/svnroot/checkgmail $(TMPDIR)/$(PACKAGE)-$(SRC_VERSION)
        tar czf $TARBALL -C $TMPDIR $(PACKAGE)-$(SRC_VERSION)



}}}

=== Thanks to ===

 * fatal_ and themill from #debian-mentors@OFTC
 * http://lists.debian.org/debian-mentors/2008/06/msg00364.html
 * http://lists.alioth.debian.org/pipermail/pkg-multimedia-commits/2008-March/000649.html

I want to describe how to write a nice get-orig-source target for debian/rules in presence of an upstream SVN repository.

Let's first consider that <pkg> is currently in sid with version x.y-z (upstream version = x.y, Debian revision = z).

Choose the right version

There are two differents path here, based on what "version" of the upstream code you're packaging

  1. the code in the svn is the update for the version x.y but you don't know yet how upstream would call it
  2. the code in the svn is the preliminary version the new upstream release, be it x.(y+1) or x.y.n

A couple of magic characters you can use in version come in our help here: '~' and '+'; here are how they are interpreted

x.(y+1)-1
   or     > x.y+foo-1 > x.y-z > x.y~bar-1
x.y.n-1

So, here it is how you have to choose the version number for the svn snapshot:

  1. if x.y-z is in sid and you're packaging the new version "without a name", then go with x.y+svn<rev>-1

  2. if x.y-z is in sid and you're packaging the new version x.(y+1) or x.y.n, then go with x.(y+1)~svn<rev>-1 or x.y.n~svn<rev>-1

Update the {{{debian/changelog}}}

now that you have your new package version what you have to do is:

$ dch -v "<new version>" "New upstream SVN snapshot"

Create {{{get-orig-source}}} target for {{{debian/rules}}}

We are almost done, we need to create the get-orig-source target in debian/rules file.

PACKAGE = checkgmail
SRC_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | sed 's/^Version: \(.*\)-.*/\1/')
SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz

get-orig-source:
        TMPDIR = $(shell mktemp -d)
        svn export -r $(SVN_REVISION) https://checkgmail.svn.sourceforge.net/svnroot/checkgmail $(TMPDIR)/$(PACKAGE)-$(SRC_VERSION)
        tar czf $TARBALL -C $TMPDIR $(PACKAGE)-$(SRC_VERSION)

Thanks to