Debian Packaging 101

18 05 2007

I have recently decided to concentrate more on the development side of Linux, more importantly Ubuntu, KDE, and now Debian. The first stage I will cover in my endeavors will be packaging. Packaging consists of taking the upstream tarballs (programname-version.tar.gz or .tar.bz2) and converting them into packages that can easily be installed in Ubuntu as well as Debian without you having to compile (configure, make, make install) or worrying about dependencies. A successful package that a majority of you are used to in Ubuntu and Debian look like programname_version.deb. Some of you have even done a successfull dpkg -i programname_version.deb for an application that either is not in the repositories or was updated and packaged somewhere else. Well this post is to cover the necessities before you jump in and go nuts trying to figure out how to correctly create a package.

First things first! Reading material, and how and where you read it, we don’t need to know :)

  1. Debian New Maintainer’s Guide
  2. Debian Developer’s Reference
  3. Debian Policy Manual
  4. Ubuntu Packaging Guide

I would advise to try and read the documents in this order. Some of these guides are even available to be installed on your Ubuntu or Debian system. The Ubuntu Packaging Guide is named packaging-guide, the Debian Policy Manual is named debian-policy and there is also another Debian guide named debian-reference that also has a lot of good general Debian information.

Once you have read through these guides and are about ready to take a go at it, I would also like to recommend https://wiki.ubuntu.com/MOTU for more information which of course pertains mainly to Ubuntu. Seeing as we are just now starting a new development cycle, 90% of the work involved right now is with merging and syncing with Debian. So look over that documentation which is located in the wiki as well.

I will go ahead and save you some time and list the packages you should install in order to start your career in packaging. Since packaging is pretty much 110% command line oriented, I will give you the command to install via the command line:
sudo apt-get install build-essential devscripts debhelper dh-make diff patch gnupg fakeroot lintian linda pbuilder cdbs

Another utility you will need is debootstrap, and the latest version of it as well. To get the latest version download it from HERE. Grab the latest version (as of 2007-05-18 the latest version is 0.3.3.3ubuntu3) and then install it:
sudo dpkg -i /dir/to/deboostrap_x_x_x.deb
Replace the x’s with the correct version information.

Now you have all of the tools you will need to start building packages. Read the material, check the man pages for the applications you have just installed, and make sure you are comfortable with the command line. Also, if you haven’t created your GPG (gnupg) key yet, I suggest you do that now as you will need it in order to sign the packages you create. This is necessary for all packaging. If you are unsure howto, please read the GNU Privacy Guard (GPG) Howto.

Any question you may have is welcomed in the following locations:

  • #ubuntu-motu on IRC (Freenode) for Ubuntu Packaging
  • #debian-mentors on IRC (OFTC) for Debian Packaging
  • Ubuntu MOTU Mailing List - please subscribe - email address listed on linked page
  • Debian Mentors Mailing List - please subscribe - email address listed on linked page

Hopefully are are still awake! If so, please scour the websites of both Debian and Ubuntu, specifically their wikis. Thanks for staying awake!


Actions

Informations

4 responses to “Debian Packaging 101”

19 05 2007
19 05 2007
Porges (01:31:02) :
   (Using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Ubuntu Linux Ubuntu Linux)

One question: How much does debootstrap need to download?

I started to follow these guides to do packaging a short while ago, but got scared off when it said that debootstrap needed to download an entire base install… since I’m not on very fast internet (I live in New Zealand).

19 05 2007
Lure (02:18:00) :
   (Using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Ubuntu Linux Ubuntu Linux)

Very good guide for newcomers.

For Ubuntu, I would suggest to start with UbuntuDevelopment wiki (together with MOTU wiki) in order to understand how development works in Ubuntu.

https://wiki.ubuntu.com/UbuntuDevelopment

19 05 2007
nixternal (03:15:00) :
   (Using Konqueror Konqueror 3.5 on Kubuntu Linux Kubuntu Linux)

Enny, thanks for those links. I would recommend those for someone who has at least completed a couple of packages first. The only reason why is because they kind of teach a non-policy way of building a package, which there is nothing wrong, but I think they should learn the recommended way first, and then get comfortable. However I am using some of the bullets in the Google video for a Debian Packaging talk this Sunday :)

Porges, when it says base it means base. It isn’t a large install, it is just the very slim basics of an ubuntu install. It usually takes about 5 minutes max on a decent connection for me. It is probably something you can start, walk away for a bit, and return if your connection is that bad.

Lure, thanks for the UbuntuDev link. Forgot about that one :)

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">