Ubuntu – How should I package the sources so Launchpad build the package for all versions of Ubuntu

launchpadppa

I have a package that should build for all versions of Ubuntu, so I hope that Launchpad builds all of them… well, it doesn't. I submitted just using trusty in the changelog release field, and Launchpad build it for Trusty. I changed it for precise and just built for Precise. Is there a way I can use the same sources for several release target?

ffc (1.3.20140513-1) trusty; urgency=medium

  * Non-maintainer upload.
  * Moving to git.
  * Syncronized debian/* with upstream

 -- redacted <redacted@example.com>  Fri, 16 May 2014 16:15:00 -0400

Best Answer

Yes and no.

There is currently no way to use dput to upload a package that builds for multiple Ubuntu releases. However, you can accomplish your goal using one of these two methods:

Create a Recipe

If you are building a package from a branch on Launchpad and you have Debian packaging, create a daily build recipe that targets the Ubuntu releases you wish to support. This is described in more detail in the latter half of this answer.

This is really the best solution since it also automates new builds every time you make a change (with a limit on one automatic build per day, although you can manually dispatch additional builds).

Upload Multiple Builds Manually

This is not an ideal solution - but it works. What you need to do to make this work is:

  • Adjust the version number in the changelog to match this format:

    [version]-1ppa1~[release]1
    

    ...where [version] is the package version and [release] is an Ubuntu release codename (like trusty, saucy, etc.).

  • Make sure the changelog is set to build the correct release. In other words, for Trusty, the first line of your changelog should look like this:

    ffc (1.3.20140513-1ppa1~trusty1) trusty; urgency=medium
    

Upload the package using dput and then repeat the two steps above for each release you want to upload packages for. You can see an example of how this works here.