Chapter 1. Getting started The Right Way

Table of Contents

1.1. Social dynamics of Debian
1.2. Programs needed for development
1.3. Documentation needed for development
1.4. Where to ask for help

This document tries to describe the building of a Debian package to ordinary Debian users and prospective developers. It uses fairly non-technical language, and it's well covered with working examples. There is an old Latin saying: Longum iter est per praecepta, breve et efficax per exempla (It's a long way by the rules, but short and efficient with examples).

This document has been updated for the Debian squeeze release. [1]

One of the things that makes Debian such a top-notch distribution is its package system. While there is a vast quantity of software already in the Debian format, sometimes you need to install software that isn't. You may be wondering how you can make your own packages; and perhaps you think it is a very difficult task. Well, if you are a real novice on Linux, it is hard, but if you were a rookie, you wouldn't be reading this document now :-) You do need to know a little about Unix programming but you certainly don't need to be a wizard. [2]

One thing is certain, though: to properly create and maintain Debian packages takes many hours. Make no mistake, for our system to work the maintainers need to be both technically competent and diligent.

If you need some help on packaging, please read Section 1.4, “Where to ask for help”.

Newer versions of this document should always be available online at http://www.debian.org/doc/maint-guide/ and in the maint-guide package. The translations may be available in packages such as maint-guide-es. Please note that this documentation may be slightly outdated.

Since this is a tutorial, I choose to explain each detailed step for some important topics. Some of them may look irrelevant to you. Please be patient. I have also intentionally skipped some corner cases and provided only pointers to keep this document simple.

Here are some observations of Debian's social dynamics, presented in the hope that it will prepare you for interactions with Debian.

  • We all are volunteers.

    • You cannot impose on others what to do.

    • You should be motivated to do things by yourself.

  • Friendly cooperation is the driving force.

    • Your contribution should not overstrain others.

    • Your contribution is valuable only when others appreciate it.

  • Debian is not your school where you get automatic attention of teachers.

    • You should be able to learn many things by yourself.

    • Attention from other volunteers is a very scarce resource.

  • Debian is constantly improving.

    • You are expected to make high quality packages.

    • You should adapt yourself to change.

There are several types of people interacting around Debian with different roles.

  • upstream author: the person who made the original program.

  • upstream maintainer: the person who currently maintains the program.

  • maintainer: the person making the Debian package of the program.

  • sponsor: a person who helps maintainers to upload packages to the official Debian package archive (after checking their contents).

  • mentor: a person who helps novice maintainers with packaging etc.

  • Debian Developer (DD): a member of the Debian project with full upload rights to the official Debian package archive.

  • Debian Maintainer (DM): a person with limited upload rights to the official Debian package archive.

Please note that you cannot become an official Debian Developer (DD) overnight, because it takes more than technical skill. Please do not be discouraged by this. If it is useful to others, you can still upload your package either as a maintainer through a sponsor or as a Debian Maintainer.

Please note that you do not need to create any new package to become an official Debian Developer. Contributing to the existing packages can provide a path to becoming an official Debian Developer too. There are many packages waiting for good maintainers (see Section 2.2, “Choose your program”).

Since we focus only on technical aspects of packaging in this document, please refer to the following to learn how Debian functions and how you can get involved.

Before you start anything, you should make sure that you have properly installed some additional packages needed for development. Note that the list doesn't contain any packages marked essential or required - we expect that you have those installed already.

The following packages come with the standard Debian installation, so you probably have them already (along with any additional packages they depend on). Still, you should check it with aptitude show package or with dpkg -s package.

The most important package to install on your development system is the build-essential package. Once you try to install that, it will pull in other packages required to have a basic build environment.

For some types of packages, that is all you will require; however, there is another set of packages that while not essential for all package builds are useful to have installed or may be required by your package:

The short descriptions that are given above only serve to introduce you to what each package does. Before continuing please read the documentation of each relevant program including ones installed through the package dependency such as make, at least, for the standard usage. It may seem like heavy going now, but later on you'll be very glad you read it. If you have specific questions later, I would suggest re-reading the documents mentioned above.

The following is the very important documentation which you should read along with this document:

  • debian-policy - the Debian Policy Manual includes explanations of the structure and contents of the Debian archive, several OS design issues, the Filesystem Hierarchy Standard (FHS, which says where each file and directory should be), etc. For you, the most important thing is that it describes requirements that each package must satisfy to be included in the distribution. (See the local copies of /usr/share/doc/debian-policy/policy.pdf.gz and /usr/share/doc/debian-policy/fhs/fhs-2.3.pdf.gz.)

  • developers-reference - the Debian Developer's Reference describes all matters not specifically about the technical details of packaging, like the structure of the archive, how to rename, orphan, or adopt packages, how to do NMUs, how to manage bugs, best packaging practices, when and where to upload etc. (See the local copy of /usr/share/doc/developers-reference/developers-reference.pdf.)

The following is the important documentation which you should read along with this document:

If this document contradicts any of the documents mentioned above, they are correct. Please file a bug report on the maint-guide package using reportbug.

The following is an alternative tutorial documentation which you may read along with this document:

Before you decide to ask your question in some public place, please read the fine documentation.

You can use web search engines more effectively by including search strings such as site:lists.debian.org to limit the domain.

Making a small test package is a good way to learn details of packaging. Inspecting existing well maintained packages is the best way to learn how other people make packages.

If you still have questions about packaging that you couldn't find answers to in the available documentation and web resources, you can ask them interactively.

The more experienced Debian developers will gladly help you, if you ask properly after making your required efforts.

When you receive a bug report (yes, actual bug reports!), you will know that it is time for you to dig into the Debian Bug Tracking System and read the documentation there, to be able to deal with the reports efficiently. I highly recommend reading the Debian Developer's Reference, 5.8. "Handling bugs".

Even if it all worked well, it's time to start praying. Why? Because in just a few hours (or days) users from all around the world will start to use your package, and if you made some critical error you'll get mailbombed by numerous angry Debian users... Just kidding. :-)

Relax and be ready for bug reports, because there is a lot more work to be done before your package will be fully in line with Debian policies and its best practice guidelines (once again, read the real documentation for details). Good luck!



[1] The document assumes you are using a squeeze or newer system. If you need to follow this text in an older system (including an older Ubuntu system etc.), you must install backported dpkg and debhelper packages, at least.

[2] You can learn about the basic handling of a Debian system from the Debian Reference. It contains some pointers to learn about Unix programming, too.

[3] There are also some more specialized but similar packages such as dh-make-perl, dh-make-php, etc.