Kapitel 1. Einstieg, aber richtig!

Inhaltsverzeichnis

1.1. Social dynamics of Debian
1.2. Programme, die zum Entwickeln notwendig sind
1.3. Documentation needed for development
1.4. Wo man Hilfe bekommen kann

Dieses Dokument versucht, einem typischen Debian-Benutzer und zukünftigen Entwickler in einer verständlichen Sprache die Technik der Paketerstellung für Debian beizubringen, begleitet von funktionierenden Beispielen. Ein altes lateinisches Sprichwort lautet: Longum iter est per praecepta, breve et efficax per exempla! (Es ist ein langer Weg mit Regeln, aber ein kurzer und effizienter mit Beispielen!)

Dieses Dokument wurde für die Debian-Release Squeeze aktualisiert. [1]

Eines der Dinge, die Debian zu einer hervorragenden Distribution machen, ist das Paket-System. Obwohl massenhaft Software im Debian-Format vorhanden ist, muss man manchmal auch Software installieren, die nicht in diesem Format vorliegt. Sie fragen sich vermutlich, wie man eigene Pakete erstellt und vielleicht meinen Sie, es sei eine sehr komplizierte Aufgabe. Nun, wenn Sie ein absoluter Linux-Neuling sind, dann ist es wirklich schwierig, aber als Anfänger würden Sie dieses Dokument jetzt nicht lesen. :-) Sie sollten schon ein wenig Kenntnisse über die Unix-Programmierung mitbringen, aber Sie brauchen ganz sicher kein Guru zu sein. [2]

Eines ist wohl sicher: um Debian-Pakete richtig zu bauen und zu warten, brauchen Sie viel Zeit. Schätzen Sie das nicht falsch ein; damit unser System funktioniert, muss der Betreuer sowohl technisch kompetent sein als auch fleißig und sorgfältig arbeiten.

Wenn Sie Hilfe beim Erstellen des Pakets brauchen, lesen Sie bitte Abschnitt 1.4, „Wo man Hilfe bekommen kann“.

Neuere Versionen dieses Dokuments sollten immer online über http://www.debian.org/doc/maint-guide/ und in dem Paket maint-guide zu finden sein. Die Übersetzungen sind in Paketen wie beispielsweise maint-guide-es verfügbar. Bitte beachten Sie, dass diese Dokumentation etwas veraltet sein kann.

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.

1.1. Social dynamics of Debian

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.

  • Ursprünglicher Autor (»upstream author«): Die Person, die das ursprüngliche Programm geschrieben hat.

  • Ursprünglicher Betreuer (»upstream maintainer«): Die Person, die das Programm zurzeit betreut.

  • Betreuer (»maintainer«): Die Person, die ein Debian-Paket des Programms erstellt oder betreut.

  • Sponsor: Eine Person, die Betreuern hilft, Pakete in das offizielle Debian-Paketarchiv hochzuladen (nachdem sie den Inhalt überprüft hat).

  • Mentor: Eine Person, die neuen Betreuern beim Paketieren usw. hilft.

  • Debian-Entwickler (»Debian Developer«, DD): Ein Mitglied des Debian-Projekts mit unbeschränkten Rechten, Pakete in das offizielle Debian-Paketarchiv hochzuladen.

  • Debian-Betreuer (»Debian Maintainer«, DM): Eine Person, die beschränkte Rechte hat, Pakete in das offizielle Debian-Paketarchiv hochzuladen.

Bitte beachten Sie, dass Sie nicht über Nacht offizieller Debian-Entwickler (»Debian Developer«, DD) werden können, weil es dafür mehr als nur technische Fähigkeiten braucht. Bitte lassen Sie sich davon nicht entmutigen. Wenn Ihr Paket für andere nützlich ist, können Sie es entweder als Betreuer über einen Sponsor oder als Debian-Betreuer trotzdem hochladen.

Bitte beachten Sie, dass Sie kein neues Paket erstellen müssen, um offizieller Debian-Entwickler zu werden. Auch Beiträge zu existierenden Paketen können ein Weg sein, offizieller Debian-Entwickler zu werden. Es gibt viele Pakete, die auf einen guten Betreuer warten (siehe Abschnitt 2.2, „Ihr Programm auswählen“).

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.

1.2. Programme, die zum Entwickeln notwendig sind

Bevor Sie loslegen können, müssen Sie sicherstellen, dass einige zusätzliche Pakete richtig installiert sind, die für die Entwicklung benötigt werden. Beachten Sie, dass die Liste keine Pakete enthält, die als essential oder required markiert sind - wir gehen davon aus, dass Sie diese schon installiert haben.

Die folgenden Pakete sind in der Standardinstallation von Debian enthalten, also werden Sie sie vermutlich schon haben (und zusätzliche Pakete, von denen diese abhängen). Sie sollten es dennoch mit aptitude show Paket oder dpkg -s Paket überprüfen.

Das wichtigste Paket, dass auf Ihrem Entwicklungssystem installiert werden sollte, ist das Paket build-essential. Wenn Sie es installieren, wird es andere Pakete hinterherziehen (»pull in«), die für eine grundlegende Build-Umgebung notwendig sind.

Für manche Arten von Paketen ist das alles, was Sie benötigen. Es gibt allerdings noch eine weitere Sammlung von Paketen, die - obwohl sie nicht essenziell für jede Paketerstellung sind - sinnvoll installiert werden können oder sogar von Ihrem Paket benötigt werden:

  • autoconf, automake, and autotools-dev - many newer programs use configure scripts and Makefile files preprocessed with the help of programs like these (see info autoconf, info automake). autotools-dev keeps up-to-date versions of certain auto files and has documentation about the best way to use those files.

  • dh-make und debhelper - dh-make wird benötigt, um eine Vorlage des Beispielpakets zu erstellen. Es verwendeteinige der debhelper-Werkzeuge für die Paketerstellung. Sie sind nicht zwingend erforderlich, um Pakete zu erstellen, aber für neue Betreuer sehr empfohlen. Sie vereinfachen den Einstieg in den ganzen Prozess sehr, ebenso die spätere Kontrolle (siehe dh_make(8), debhelper(1), /usr/share/doc/debhelper/README). [3]

  • devscripts - this package contains some useful scripts that can be helpful for maintainers, but they are also not necessary for building packages. Packages recommended and suggested by this package are worth looking into. (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).)

  • file - this handy program can determine what type a file is. (See file(1).)

  • gfortran - the GNU Fortran 95 compiler, necessary if your program is written in Fortran. (See gfortran(1).)

  • git - this package provides a popular version control system designed to handle very large projects with speed and efficiency; it is used for many high profile open source projects, most notably the Linux kernel. (See git(1), git Manual (/usr/share/doc/git-doc/index.html).)

  • 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).)

  • 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).)

  • lintian - this is the Debian package checker, which can let you know of any common mistakes after you build the package, and explains the errors found. (See lintian(1), Lintian User's Manual.)

  • 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).)

  • patchutils - Dieses Paket enthält einige Hilfsprogramme, um mit Patches zu arbeiten, beispielsweise die Befehle lsdiff, interdiff und filterdiff.

  • pbuilder - Dieses Paket enthält Programme, um eine chroot-Umgebung aufzubauen und zu betreuen. Beim Bauen eines Debian-Pakets in dieser chroot-Umgebung wird geprüft, ob die Build-Abhängigkeiten stimmen, wodurch FTBFS-Fehler (»Fails To Build From Source«, kann nicht aus der Quelle gebaut werden) verhindert werden (siehe pbuilder(8) und pdebuild(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).)

  • python - Python is another of the most used interpreted scripting languages on the Debian system, combining remarkable power with very clear syntax. (See python(1).)

  • quilt - this package helps you to manage large numbers of patches by keeping track of the changes each patch makes. Patches can be applied, un-applied, refreshed, and more. (See quilt(1), and /usr/share/doc/quilt/quilt.pdf.gz.)

  • xutils-dev - some programs, usually those made for X11, also use these programs to generate Makefile files from sets of macro functions. (See imake(1), xmkmf(1).)

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.

1.3. Documentation needed for development

Das Folgende sind sehr wichtige Dokumente, die Sie neben diesem Dokument auch lesen sollten:

  • 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:

1.4. Wo man Hilfe bekommen kann

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".

Selbst wenn alles gut funktioniert hat, ist es jetzt an der Zeit, mit dem Beten anzufangen. Warum? Weil in wenigen Stunden (oder Tagen) Benutzer überall auf der Welt Ihr Paket verwenden werden, und wenn Sie einen kritischen Fehler gemacht haben, werden Sie von unzähligen verärgerten Debian-Benutzern mit E-Mails überschüttet ... war nur ein Scherz. :-)

Entspannen Sie sich und stellen Sie sich auf Fehlerberichte ein, denn es ist noch viel mehr Arbeit zu erledigen, bevor Ihr Paket vollständig im Einklang mit den Debian-Richtlinien sowie dessen bewährten Verfahren ist (nochmals: lesen Sie die wirkliche Dokumentation für Details). Viel Glück!



[1] In diesem Dokument wird davon ausgegangen, dass Sie ein Squeeze-System oder ein neueres System verwenden. Wenn Sie diesen Text auf einem älteren System (auch einem älteren Ubuntu-System o.ä.) lesen, müssen Sie mindestens die zurückportierten Pakete dpkg und debhelper installieren.

[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.