Ubuntu – Versioning a package for uploading to PPA

launchpadpackagingppa

I've a package named Artha which I distribute as source and (deb) binaries for x86 and x86_64 architectures i.e. I've the experience in making deb files. I got quite a few requests for setting up a PPA. I thought I'll do it for the upcoming release. Artha in Ubuntu's repository is of version 1.0.2 and I'm trying to create a PPA for Artha 1.0.3.

I read Launchpad's Personal Package Archive docs, and the PPA is now set up, but this page on versioning says that for a package like Artha which is already in Ubuntu's repos, named artha-1.0.2-1ubuntu1 the PPA version should be artha-1.0.3-1ubuntu1ppa1, so that when Ubuntu's repos update to 1.0.3 of Artha, it supersedes my PPA's package.

When I usually make my .deb package, I get these files

  • artha_1.0.3.orig.tar.bz2
  • artha_1.0.3-1.debian.tar.gz
  • artha_1.0.3-1.dsc
  • artha_1.0.3-1_amd64.build
  • artha_1.0.3-1_amd64.changes
  • artha_1.0.3-1_amd64.deb

and their equivalents for i386. This page on uploading to a PPA says that the files .dsc, .changes and .debian.tar.gz will be uploaded.

Here's my confusion. How'd I make these files have the aforementioned version? i.e. with the "ppa" suffix? Surely, I feel, manually renaming Artha's source package extracted directory doesn't seem the right way.

Also should I debuild -S -sd or debuild -S -sa? The Launchpad page says alternative version of an existing package should use the former. This sounds ambiguous for me. What does this mean? Does an updated version count as an alternative version?

There're many detailed pages on setting up a PPA. But they're for setting up only once, while PPAs are all about giving updates to a particular package faster and maintainability is very important, I'd be great if someone could point me to such a document which talks about making updates, etc. i.e. about things that happen to a PPA after the initial upload.

Best Answer

The version of the resulting package comes from the version number provided in debian/changelog So you must have the appropriate version there.

1.0.3-1 will supersede an Ubuntu only upload versionized 1.0.3-0ubuntu1

$ dpkg --compare-versions 1.0.3-1 le 1.0.3-0ubuntu1 || echo "False"
False

But it will not supersede a version originating from Debian with Ubuntu changes, i.e. 1.0.3-1ubuntu1

$ dpkg --compare-versions 1.0.3-1 le 1.0.3-1ubuntu1 || echo "False"
$

The tilda (~) character has a special meaning in version numbers. For example:

$ dpkg --compare-versions 1.0.3-1 le 1.0.3-1~ppa1 || echo "False"
False

As your package is not originating from Debian, I go with a version number like 1.0.3-0~ppa1 This guarantees that it is less than either a version synced directly from Debian or introduced in Ubuntu,

So your change log should look like:

artha (1.0.3-0~ppa1) quantal; urgency=low

  * New upstream release.

 -- Your Name <foo@bar.com>  Sun, 07 Oct 2012 13:06:56 -0400

Whether to use debuild -S -sd or debuild -S -sa is really a different question, but here's a brief answer.

-sa ensures that the .orig.tar.bz2 will be uploaded. If you haven't made an upload of this upstream version before, use this.

-sd explicitly makes it so that only the debian.tar.gz or diff.tar.gz are uploaded. This is for when you are making a change to an upstream version that is already available in you target archive or PPA. This is because th original tarball should already be present there.

Related Question