[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ A ] [ next ]
This document tries to describe building of a Debian package to the common Debian user, and prospectus developer. It uses pretty common language, and it's well covered with working examples. There is an old Roman saying, Longum iter est per preaecepta, breve et efficax per exempla! (It's a long way by the rules, but short and efficient with examples!).
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, if you are a real novice on Linux, it is hard, but if you were rookie, you wouldn't be reading this doc now. :-) You do need to know a little about Unix programming but you certainly don't need to be a wizard.
One thing is certain, though: to properly create and maintain Debian packages you need many hours. Make no mistake, for our system to work the maintainers need to be both technically competent and diligent.
This document will explain every little (at first maybe irrelevant) step, and help you create that first package, and to gain some experience in building next releases of that and maybe other packages later on.
Newer versions of this document should always be available online at http://www.debian.org/doc/maint-guide/
and in the `maint-guide' package.
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.
This revision of this document has been updated for the packages in Debian 5.0 (`lenny').
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 with `dpkg -s <package>`.
The most important package to install on your system is the
build-essential package. Once you try to install it, 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 install or may be required by your package:
file - this handy program can determine what type a file is. (see
file(1))
patch - this very useful utility will take a file containing a
difference listing (produced by the diff program) and apply it to the original
file, producing a patched version. (see patch(1))
perl - Perl is one of the most used interpreted scripting
languages on today's Unix-like systems, often referred to as "Unix's Swiss
Army Chainsaw". (see perl(1))
autoconf, automake and autotools-dev -
many newer programs use configure scripts and Makefiles preprocessed with help
of programs like these. (see `info autoconf`, `info automake`). The
autotools-dev keeps up-to-date versions of certain auto files and
has documentation about the best way to use those files.
dh-make and debhelper - dh-make is necessary to
create the skeleton of our example package, and it will use some of the
debhelper tools for creating packages. They are not essential for creation of
packages, but are highly recommended for new maintainers. It
makes the whole process very much easier to start, and control afterwards.
(see dh_make(1), debhelper(1),
/usr/share/doc/debhelper/README)
devscripts - this package contains some nice and useful scripts
that can be helpful to the maintainers, but they are also not necessary for
building packages. (see /usr/share/doc/devscripts/README.gz)
fakeroot - this utility lets you emulate being root which is
necessary for some parts of the build process. (see fakeroot(1))
gnupg - a tool that enables you to digitally sign
packages. This is especially important if you want to distribute it to other
people, and you will certainly be doing that when your work gets included in
the Debian distribution. (see gpg(1))
gfortran - the GNU Fortran 95 compiler, necessary if your program
is written in Fortran. (see gfortran(1))
gpc - the GNU Pascal compiler, necessary if your program is
written in Pascal. Worthy of note here is fp-compiler, the Free
Pascal Compiler, which is also good at this task. (see gpc(1),
ppc386(1))
xutils - some programs, usually those made for X11, also use these
programs to generate Makefiles from sets of macro functions. (see
imake(1), xmkmf(1))
lintian - this is the Debian package checker that can let you know
of any common mistakes after you build the package, and explain the errors
found. (see lintian(1),
/usr/share/doc/lintian/lintian.html/index.html)
pbuilder - this package contains programs which is used for
creating and maintaining chroot environment. Building Debian package in this
chroot environment verifies the proper build dependency and avoid FTBFS bugs.
(see pbuilder(8) and pdebuild(1))
The following is the very important documentation which you should read along with this document:
debian-policy - the Policy includes explanations of the structure
and contents of the Debian archive, several OS design issues, the Filesystem
Hierarchy Standard (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
/usr/share/doc/debian-policy/policy.html/index.html)
developers-reference - for all matters not specifically about the
technical details of packaging, like the structure of the archive, how to
rename, orphan, pick up packages, how to do NMUs, how to manage bugs, best
packaging practices, when and where to upload etc. (see
/usr/share/doc/developers-reference/index.en.html)
The short descriptions that are given above only serve to introduce you to what each package does. Before continuing please thoroughly read the documentation of each program, at least the standard usage. It may seem like heavy going now, but later on you'll be very glad you read it.
After you build your package (or while doing that), you may want to become an official Debian Developer to get your new package into the next distribution (if the program is useful, why not?).
You can not become an official Debian Developer over night because it takes
more than technical skill. Please do not be discouraged by this. You can
still upload your package, if useful to others, now as a maintainer through a
sponsor while applying yourself to the
Debian New Maintainer process. Here, the sponsor is an official
Debian Developer who helps maintainer to upload packages to the Debian archive.
More details of this procedure are explained in the debian-mentors
FAQ.
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 become an official Debian Developer too.
There are two types of packages you can make, source and binary. A source package contains code which you can compile into a program. A binary package contains just the finished program. Don't mix terms like source of the program and the source package of the program! Please read the other manuals if you need more details on terminology.
In Debian, the term `maintainer' is used for the person who makes packages, `upstream author' for the person that made the program, and `upstream maintainer' for the person who currently maintains that program, outside of Debian. Usually author and the upstream maintainer are the same person - and sometimes even the maintainer is the same person. If you made a program, and want it to get in Debian, feel free to submit your application to become a maintainer.
[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ A ] [ next ]
Debian New Maintainers' Guide
version 1.2.13, 5 June 2008.joy-mg@debian.org