BackportsHowToHelp

Revision 4 as of 2010-11-26 14:39:27

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 packporting 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  --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

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.

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.

Build in pbuilder

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

#FIXME

dpkg-buildpackage -S -rfakeroot

This will generate a new .dsc file according to your updated version in the changelog file. #FIXME will probably consider replacing this step with debuild per the ppa instructions.

debuild -S -sd

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

sudo pbuilder build ../*.dsc

This starts the pbuilder build using the updated .dsc created by the debuild command. It will include your changes in the changelog.

Build for PPA

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

debuild -S -sd

Creating ./dput.cfg

#FIXME https://help.launchpad.net/Packaging/PPA/Uploading#FTP #FIXME this section may be superfluous, consider using dput ppa:slavender/lucidbackports <source.changes>

Uploading to PPA

https://help.launchpad.net/Packaging/PPA/Uploading dput ppa:your-lp-id/ppa <source.changes>