Warning:This article is out of date and should not
be used for creating new packages. Please refer to the
Debian New Maintainers Guide
instead.
Making a Debian Package
Introduction and getting started.
One of the things that makes Debian such a top-notch Linux 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 I've recently started
working with Debian packages and I was pleasantly surprised at how easy it is to make
them. You do need to know a little about Unix programming but you certainly don't need to
be a wizard.
This is the second version of this article. Nothing stands still in the Debian world so
I've made some big changes to keep things accurate. I've also included some tips picked up
from the Debian Users and Developers mailing lists or suggested by readers.
Before you start you will need to install and configure the following packages. I am
assuming you are using Hamm currently the "unstable" distribution of Debian.
Actually in this context unstable means "still in development." Hamm will become
the next version of Debian (2.0)
These packages are in the devel section of the distribution.
- binutils
The programs in this package are used to assemble and link object files--the stuff
programs are made of.
- gcc
This is the GNU C compiler. Most Linux programs are written in the C programming language.
- libc6-dev
These are the C libraries and header files gcc needs to link with to create object files.
As I write this, Debian is in a transition between libc5 and libc6. Any new packages
should be created using libc6. For instructions on upgrading to libc6 read the mini-HOWTO by Scott
Ellis.
- libg++272
The C++ libraries. Fakeroot needs them.
- make
Typically creating a program will take several steps. Rather than having to type out the
same commands over and over again, you can use the make program to automate the process.
- fakeroot
As the name suggests this lets you emulate being root which is neccessary for part of the
build process. Although at this time it is still in development, fakeroot is quite usable.
Previously you had to either have root access or use a program like sudo but this is a lot
more convenient and should be more secure.
This package is in the interpreters section of the distribution
These packages are in the utils section of the distribution
- cpio
This is an archiver like tar or zip. Dpkg-dev needs it.
- file
This handy program can determine what type a file is. Dpkg-dev needs it.
- debmake
This is a higher level set of tools for creating Debian packages. You don't really need it
to create a package but I recommend it. It makes the whole process tremendously easier
especially for beginners. We will be using debmake to create our example package.
- dpkg-dev
This package contains the tools needed to create Debian archives. It also contains the
Debian Programmers and Packaging manuals.
- devscripts
This package is a companion to debmake and contains useful scripts to make the creation
and maintenance of packages easier.
- patch
Patch will take a file containing a difference listing produced by the diff program and
apply it to an original fan, producing a patched version.
These packages are in the doc section of the distribution.
- debian-policy
This is the definitive work on creating software for Debian. If you see any contradiction
between the policy manual and this article, the policy manual takes precedence.
- developers-reference
Information for people who want to become official Debian maintainers.
Also you need the encryption package pgp to digitally "sign"
your package. This is especially important if you want to distribute your package to other
people. However due to a rather wacky U.S. law, you cannot simply download this from your
nearest Debian ftp site. The ftp site will however have a file called README.non-us in its
root directory which will tell you how to get a copy of pgp.
The short descriptions I have given above only serve to introduce you to what each
package does. Before continuing please thoroughly read the documentation of each program.
It may seem like heavy going but later on you'll be glad you did.
Previous page
Next Page