Ubuntu logo

Developer

Traditional Packaging

Der Großteil dieses Leitfadens beschäftigt sich mit verteilter Ubuntu Entwicklung (UDD), die das verteilte Versionsverwaltungssystem (DVCS) Bazaar verwendet, um Paketquellen abzurufen und Fehlerbehebungen mit Zusammenführungsvorschlägen einzureichen. Dieser Artikel diskutiert, was wir aus Mangel eines besseren Wortes traditionelle Paketierung nennen. Vor der Einführung von Bazaar für die Ubuntu Entwicklung waren das typische Methoden, um zu Ubuntu beizutragen.

In some cases, you may need to use these tools instead of UDD. So it is good to be familiar with them. Before you begin, you should already have read the article Getting Set Up.

Den Quelltext bekommen

In order to get a source package, you can simply run:

$ apt-get source <package_name>

This method has some draw backs though. It downloads the version of the source that is available on your system. You are likely running the current stable release, but you want to contribute your change against the package in the development release. Luckily, the ubuntu-dev-tools package provides a helper script:

$ pull-lp-source <package_name>

By default, the latest version in the development release will be downloaded. You can also specify a version or Ubuntu release like:

$ pull-lp-source <package_name> precise

to pull the source from the precise release, or:

$ pull-lp-source <package_name> 1.0-1ubuntu1

to download version 1.0-1ubuntu1 of the package. For more information on the command, see man pull-lp-source.

For our example, let’s pretend we got a bug report saying that “colour” in the description of xicc should be “color,” and we want to fix it. (Note: This is just an example of something to change and not really a bug.) To get the source, run:

$ pull-lp-source xicc 0.2-3

Einen Debdiff erstellen

A debdiff shows the difference between two Debian packages. The name of the command used to generate one is also debdiff. It is part of the devscripts package. See man debdiff for all the details. To compare two source packages, pass the two dsc files as arguments:

$ debdiff <package_name>_1.0-1.dsc <package_name>_1.0-1ubuntu1.dsc

To continue with our example, let’s edit the debian/control and “fix” our “bug”:

$ cd xicc-0.2
$ sed -i 's/colour/color/g' debian/control

We also must adhere to the Debian Maintainer Field Spec and edit debian/control to replace:

Maintainer: Ross Burton <ross@debian.org>

mit:

Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Ross Burton <ross@debian.org>

You can use the update-maintainer tool (in the ubuntu-dev-tools package) to do that.

Remember to document your changes in debian/changelog using dch -i and then we can generate a new source package:

$ debuild -S

Now we can examine our changes using debdiff:

$ cd ..
$ debdiff xicc_0.2-3.dsc xicc_0.2-3ubuntu1.dsc | less

To create a patch file that you can send to others or attach to a bug report for sponsorship, run:

$ debdiff xicc_0.2-3.dsc xicc_0.2-3ubuntu1.dsc > xicc_0.2-3ubuntu1.debdiff

Einen Debdiff anwenden

In order to apply a debdiff, first make sure you have the source code of the version that it was created against:

$ pull-lp-source xicc 0.2-3

Then in a terminal, change to the directory where the source was uncompressed:

$ cd xicc-0.2

A debdiff is just like a normal patch file. Apply it as usual with:

$ patch -p1 < ../xicc_0.2.2ubuntu1.debdiff