BackportsHowToHelp

Revision 13 as of 2010-11-29 17:50:32

Clear message

Abstract

This page was created to help define how to backport applications for the Ubuntu Studio team and is linked from UbuntuStudio/Backports.

The scope of the article presumes that the user has a current Maverick install and will be backporting to Lucid.

Process Overview

First, we need to identify prerequisites. Many (if not all) of these will not be in the scope of this article.

Next, we will set up a pbuilder environment for a Lucid environment. This will assist us to ensure the application builds correctly, and help identify the reason if not.

We will need some packages to help us build the packages.

The next step is to get get the source code. Again, this article presumes this step is performed in a Maverick install.

Updating the changelog to reflect our effects is next.

Then we will test build in our pbuilder environment. This will help save time by identify any missing or inadequate dependencies through a local build instead of waiting for the PPA.

If the pbuilder test build was successful then we will need to run debuild to generate a sources file.

And finally we will upload it to our PPA to be built where anyone can access it.

Prerequisites

Several things will be needed before beginning the backporting process.

Setting Up Pbuilder

This is the Pbuilder section.

First we need to get the pbuilder and other required packages.

sudo apt-get install pbuilder debootstrap devscripts

Note, when installing/configuring postfix (comes with devscripts) you will be asked about configuring it, I usually tell it "no configuration".

Next, we create the environment, but for Lucid. Create a base tarball that will contain your chroot environment to build packages with.

sudo pbuilder create --distribution lucid  --debootstrapopts --variant=buildd  --othermirror "deb http://archive.ubuntu.com/ubuntu lucid universe"

Let's expand on some of these commands and options. Firstly, sudo pbuilder create is creating your pbuilder environment as root. The --distribution lucid compels the environment to be built for the Lucid release. Next, --variant=buildd installs some necessary building packages into the environment; if you do not do this the pbuilder environment will download them each time you build a package. Lastly, --othermirror "deb http://archive.ubuntu.com/ubuntu lucid universe activates that universe repository in the pbuilder environment; this is especially important since a majority of our packages will be pulled from this repository.

Packages for Building

You will need some additional packages to help build your package.

sudo apt-get install build-essential quilt cdbs

Note that the devscripts package was already installed during the pbuilder section above. Also that patch will already be installed with either devscripts or build-essential (don't remember which one, possibly both however).

Get the Source Code

This section again presumes that you are working in a Maverick install. For this example we will considering the qjackctl package because the version in Lucid is 0.3.4 and is 0.3.6 in Maverick.

It is well worth noting that the version in Natty is also 0.3.6. While the complete version in Natty (0.3.6-1ubuntu2) is later than that in Maverick (0.3.6-1build1) however, it is based on the same upstream version, therefore most likely will not provide any additional functionality (although it could possible correct a bug).

Open a terminal, it will open in your /home directory. Create a build directory and move to it.

mkdir build && cd build

Next, we will be creating a directory for the current package we are backporting and will then change to that directory.

mkdir qjackctl && cd qjackctl

Next, we actually get the source code for Maverick from the repository.

apt-get source qjackctl

Notice that we did not need to use sudo in the above command as it is not required to obtain the source code.

File Bug Report

File a bug report for backporting.

Make sure to file the bug against lucid-backports.

Note the bug number, you will include this number in the changelog file.

If possible, assign yourself in the "Assigned To" and the Status to "In Progress". Note that typically it is usually bad form to change the status of a bug you created from "New", but the Ubuntu Studio team is working from a very specific, preselected group of packages.

Updating changelog

In this article we will presume that the package will not require any modifications to dependencies in order to backport. However, we will still need to make some changes to the changelog to reflect our efforts.

Make sure to include (LP: #Bugnumber) at the end of the backports comment line.

Also note that if you bumped the version number then you should note that here as well.

Build in pbuilder

We will need to be under the proper directory, in this case it will be qjackctl-0.3.6.

Make sure you are in the source directory, in this case it will be the ~/build/qjackctl/qjackctl-0.3.6 directory before running the debuild command.

debuild -S -sd

This will, among other files, create the required updated .dsc file for pbuilder.

If you get a Lintian error about standards version, you can edit the /qjackctl-0.3.6/debian/control file and change the standards version to the one noted in the Lintian warning. Then also add it to changelog.

We need to move up one directory:

cd ..

Now, we need to locate the proper (i.e. the one we just created) .dsc file. There will be two, but the one we want will match the package version number we put into the changelog file.

ls *.dsc

Now we can run pbuilder:

sudo pbuilder build ../<input-correct-filename>.dsc

This starts the pbuilder build using the updated .dsc created by the debuild command. It will include your changes in the changelog. Of course, replace <input-correct-filename> with the proper filename from the ls command, if you are suave you can even copy the test from your ls output and paste it into the sudo pbuilder command.

Build for PPA

https://help.launchpad.net/Packaging/PPA/BuildingASourcePackage

debuild -S -sd

Uploading to PPA

If the pbuilder built correctly, i.e. without any errors, you can now send the changes (i.e. the differences between the source code and what you built) to your PPA which will take the original source code, apply your differences, and build the package. See https://help.launchpad.net/Packaging/PPA/Uploading for more information.

Find the .changes file:

ls *.changes

Now, send the changes to your PPA to build.

dput ppa:your-lp-id/ppa <source.changes>