1. Panoramica degli strumenti del Debian Maintainer

Questa sezione contiene una panoramica generale degli strumenti disponibili per i maintainer. Ciò che segue non è affatto completo o definitivo, ma solo una guida per alcuni degli strumenti più popolari.

Gli strumenti del maintainer Debian hanno lo scopo di aiutare gli sviluppatori e liberare il loro tempo per attività critiche. Come dice Larry Wall, c'è più di un modo per farlo.

Some people prefer to use high-level package maintenance tools and some do not. Debian is officially agnostic on this issue; any tool that gets the job done is fine. Therefore, this section is not meant to stipulate to anyone which tools they should use or how they should go about their duties of maintainership. Nor is it meant to endorse any particular tool to the exclusion of a competing tool.

Most of the descriptions of these packages come from the actual package descriptions themselves. Further information can be found in the package documentation itself. You can also see more info with the command apt-cache show package-name.

1.1. Strumeti di base

I seguenti strumenti sono praticamente obbligatori per qualsiasi maintainer.

1.1.1. dpkg-dev

dpkg-dev contiene gli strumenti (compreso dpkg-source) necessari per spacchettare, creare e caricare pacchetti sorgenti Debian. Queste utilità contengono la fondamentale funzionalità di basso livello necessaria per creare e manipolare i pacchetti; in quanto tali, essi sono essenziali per qualsiasi maintainer Debian.

1.1.2. debconf

debconf fornisce un'interfaccia coerente per la configurazione di pacchetti interattiva.È indipendente dall'interfaccia utente, che consente agli utenti finali di configurare i pacchetti con un'interfaccia testuale, un'interfaccia HTML o un'interfaccia con riquadri di dialogo. Nuove interfacce possono essere aggiunte come moduli.

È possibile trovare la documentazione per questo pacchetto nel pacchetto debconf-doc.

Many feel that this system should be used for all packages that require interactive configuration; see Gestione della configurazione con debconf. debconf is not currently required by Debian Policy, but that may change in the future.

1.1.3. fakeroot

fakeroot simula i privilegi di root. Questo permette di compilare pacchetti senza essere root (i pacchetti di solito vogliono installare i file con i permessi di root). Se si ha fakeroot installato, è possibile compilare pacchetti come utente normale: dpkg-buildpackage-rfakeroot.

1.2. Strumenti per la pulizia di pacchetti

According to the Free On-line Dictionary of Computing (FOLDOC), lint is: "A Unix C language processor which carries out more thorough checks on the code than is usual with C compilers." Package lint tools help package maintainers by automatically finding common problems and policy violations in their packages.

1.2.1. lintian

lintian studia approfonditamente i pacchetti Debian e fornisce informazioni su bug e violazioni delle policy. Contiene controlli automatici per molti aspetti della policy Debian così come alcuni controlli per gli errori più frequenti.

Si dovrebbe ottenere periodicamente il più nuovo lintian da unstable e controllare tutti i propri pacchetti. Si noti che l'opzione -i fornisce spiegazioni dettagliate di ciò che ogni errore o avvertimento significa, quale sia la sua base nella Policy e come generalmente si può risolvere il problema.

Si consulti Testare del pacchetto per maggiori informazioni su come e quando utilizzare Lintian.

È anche possibile visualizzare un riepilogo di tutti i problemi segnalati da Lintian sui vostri pacchetti su https://lintian.debian.org/. Questi rapporti contengono gli ultimi output di lintian per l'intera distribuzione di sviluppo (unstable).

1.2.2. lintian-brush

lintian-brush contains a set of scripts that can automatically fix more than 80 common lintian issues in Debian packages.

It comes with a wrapper script that invokes the scripts, updates the changelog (if desired) and commits each change to version control.

1.2.3. piuparts

piuparts is the .deb package installation, upgrading, and removal testing tool.

piuparts tests that .deb packages handle installation, upgrading, and removal correctly. It does this by creating a minimal Debian installation in a chroot, and installing, upgrading, and removing packages in that environment, and comparing the state of the directory tree before and after. piuparts reports any files that have been added, removed, or modified during this process.

piuparts is meant as a quality assurance tool for people who create .deb packages to test them before they upload them to the Debian archive.

1.2.4. debdiff

debdiff (dal pacchetto devscripts, devscripts) confronta elenchi di file e file di controllo di due pacchetti. Si tratta di un test di regressione semplice, in quanto aiuterà a notare se il numero di pacchetti binari è cambiato dall'ultima operazione di caricamento, o se qualcosa è cambiato nel file di controllo. Naturalmente, alcune delle modifiche che segnalerà saranno a posto, ma può aiutare a prevenire vari incidenti.

È possibile eseguirlo su un paio di pacchetti binari:

debdiff package_1-1_arch.deb package_2-1_arch.deb

O anche su un paio di file di modifiche:

debdiff package_1-1_arch.changes package_2-1_arch.changes

Per ulteriori informazioni consultare debdiff1.

1.2.5. diffoscope

diffoscope provides in-depth comparison of files, archives, and directories.

diffoscope will try to get to the bottom of what makes files or directories different. It will recursively unpack archives of many kinds and transform various binary formats into more human readable form to compare them.

Originally developed to compare two .deb files or two changes files nowadays it can compare two tarballs, ISO images, or PDF just as easily and supports a huge variety of filetypes.

The differences can be shown in a text or HTML report or as JSON output.

1.2.6. duck

duck, the Debian Url ChecKer, processes several fields in the debian/control, debian/upstream, debian/copyright, debian/patches/* and systemd.unit files and checks if URLs, VCS links and email address domains found therein are valid.

1.2.7. adequate

adequate checks packages installed on the system and reports bugs and policy violations.

The following checks are currently implemented:

  • broken symlinks

  • missing copyright file

  • obsolete conffiles

  • Python modules not byte-compiled

  • /bin and /sbin binaries requiring /usr/lib libraries

  • missing libraries, undefined symbols, symbol size mismatches

  • license conflicts

  • program name collisions

  • missing alternatives

  • missing binfmt interpreters and detectors

  • missing pkg-config dependencies

1.2.8. i18nspector

i18nspector is a tool for checking translation templates (POT), message catalogues (PO) and compiled message catalogues (MO) files for common problems.

1.2.9. cme

cme is a tool from the libconfig-model-dpkg-perl package is an editor for dpkg source files with validation. Check the package description to see what it can do.

1.2.10. licensecheck

licensecheck attempts to determine the license that applies to each file passed to it, by searching the start of the file for text belonging to various licenses.

1.2.11. blhc

blhc is a tool which checks build logs for missing hardening flags.

1.3. Strumenti ausiliari per debian/rules

Gli strumenti per la compilazione dei pacchetti rendono il processo di scrittura dei file debian/rules più facile. Per ulteriori informazioni sul motivo per cui questi potrebbero o non potrebbero essere desiderati si consulti Script di supporto.

1.3.1. debhelper

debhelper is a collection of programs that can be used in debian/rules to automate common tasks related to building binary Debian packages. debhelper includes programs to install various files into your package, compress files, fix file permissions, and integrate your package with the Debian menu system.

Unlike some approaches, debhelper is broken into several small, simple commands, which act in a consistent manner. As such, it allows more fine-grained control than some of the other debian/rules tools.

Ci sono una serie di piccoli pacchetti aggiuntivi per debhelper, troppo effimeri da documentare. È possibile vedere l'elenco della maggior parte di loro invocando apt-cache search ^dh-.

When choosing a debhelper compatibility level for your package, you should choose the highest compatibility level that is supported in the most recent stable release. Only use a higher compatibility level if you need specific features that are provided by that compatibility level that are not available in earlier levels.

In the past the compatibility level was defined in debian/compat, however nowadays it is much better to not use that but rather to use a versioned build-dependency like debhelper-compat (=12).

1.3.2. dh-make

The dh-make package contains dh_make, a program that creates a skeleton of files necessary to build a Debian package out of a source tree. As the name suggests, dh_make is a rewrite of debmake, and its template files use dh_* programs from debhelper.

Mentre i file di rules generati da dh_make sono, in generale, una base sufficiente per un pacchetto funzionante, sono ancora solo le basi: il maintainer ha ancora l'onere per sintonizzare con precisione i file generati e rendere il pacchetto completamente funzionante e conforme alla Policy.

1.3.3. equivs

equivs è un altro pacchetto per fare i pacchetti. È spesso suggerito per uso locale, se si ha bisogno di creare un pacchetto semplicemente per soddisfare le dipendenze. A volte è anche utilizzato quando si costruiscono «meta-pacchetti», che sono pacchetti il cui unico scopo è quello di dipendere da altri pacchetti.

1.4. Strumenti di compilazione

The following packages help with the package building process, general driving of dpkg-buildpackage, as well as handling supporting tasks.

1.4.1. git-buildpackage

git-buildpackage fornisce la capacità di iniettare o importare pacchetti sorgenti Debian in un repository GIT, di compilare un pacchetto Debian dal repository GIT, ed aiuta a integrare i cambiamenti del codice originale nel repository.

Queste utilità forniscono un'infrastruttura per facilitare l'uso del GIT da parte del maintainer Debian. Questo permette di mantenere in GIT rami separati di un pacchetto per le distribuzioni stable, unstable e possibilmente experimental, con gli altri benefici di un sistema di controllo di versioni.

1.4.2. debootstrap

Il pacchetto e lo script debootstrap permettono di avviare un sistema Debian di base in qualsiasi parte del proprio filesystem. Per sistema di base, si intende il minimo dei pacchetti necessari al funzionamento e ad installare il resto del sistema.

Avere un sistema come questo può essere utile in molti modi. Ad esempio, è possibile effettuare chroot se si vuole testare le proprie dipendenze di compilazione. Oppure si può verificare come il pacchetto si comporta quando installato in un sistema di base puro. Gli strumenti di compilazione chroot usano questo pacchetto; si veda di seguito.

1.4.3. pbuilder

pbuilder constructs a chrooted system, and builds a package inside the chroot. It is very useful to check that a package's build dependencies are correct, and to be sure that unnecessary and wrong build dependencies will not exist in the resulting package.

A related package is cowbuilder, which speeds up the build process using a COW filesystem on any standard Linux filesystem.

1.4.4. sbuild

sbuild è un altro strumento per creazione di pacchetti automatizzato. Anch'esso può utilizzare ambienti chroot. Può essere utilizzato da solo, o come parte di un ambiente di compilazione distribuita in rete. In quest'ultimo caso, è parte del sistema utilizzato dagli autori di port per costruire pacchetti binari per tutte le architetture disponibili. Si consulti wanna-build per maggiori informazioni, e https://buildd.debian.org/ per vedere il sistema in azione.

1.5. Strumenti per caricare i pacchetti

I seguenti pacchetti consentono di automatizzare e semplificare il processo di caricamento dei pacchetti nell'archivio ufficiale.

1.5.1. dupload

dupload is a package and a script to automatically upload Debian packages to the Debian archive, to log the upload, and to optionally send mail about the upload of a package. It supports various kinds of hooks to extend its functionality, and can be configured for new upload locations or methods, although by default it provides various hooks performing checks and comes configured with all Debian upload locations.

1.5.2. dput

The dput package and script do much the same thing as dupload, but in a different way. Out of the box it supports to run dinstall in dry-run mode after the upload.

1.5.3. dcut

Lo script dcut (parte del pacchetto dput, dput) aiuta a rimuovere i file dalla cartella ftp di caricamento.

1.6. Automazione della manutenzione

I seguenti strumenti aiutano ad automatizzare diverse attività di manutenzione, ad aggiungere le voci changelog o la firma e a guardare bug in Emacs facendo uso dei più nuovi e ufficiali config.sub.

1.6.1. devscripts

devscripts is a package containing wrappers and tools that are very helpful for maintaining your Debian packages. Example scripts include debchange (or its alias, dch), which manipulates your debian/changelog file from the command-line, and debuild, which is a wrapper around dpkg-buildpackage. The bts utility is also very helpful to update the state of bug reports on the command line. uscan can be used to watch for new upstream versions of your packages (see https://wiki.debian.org/debian/watch for more info on that). suspicious-source outputs a list of files which are not common source files.

Si consulti la pagina di manuale devscripts 1 per un elenco completo degli script disponibili.

1.6.2. reportbug

reportbug is a tool designed to make the reporting of bugs in Debian and derived distributions relatively painless. Its features include:

  • Integration with mutt and mh/nmh mail readers.

  • Access to outstanding bug reports to make it easier to identify whether problems have already been reported.

  • Automatic checking for newer versions of packages.

reportbug is designed to be used on systems with an installed mail transport agent; however, you can edit the configuration file and send reports using any available mail server.

This package also includes the querybts script for browsing the Debian bug tracking system.

1.6.3. autotools-dev

autotools-dev contains best practices for people who maintain packages that use autoconf and/or automake. Also contains canonical config.sub and config.guess files, which are known to work on all Debian ports.

1.6.4. dpkg-repack

dpkg-repack creates a Debian package file out of a package that has already been installed. If any changes have been made to the package while it was unpacked (e.g., files in /etc were modified), the new package will inherit the changes.

This utility can make it easy to copy packages from one computer to another, or to recreate packages that are installed on your system but no longer available elsewhere, or to save the current state of a package before you upgrade it.

1.6.5. alien

alien converte i pacchetti binari tra vari formati, tra cui Debian, RPM (RedHat), LSB (Linux Standard Base), Solaris e Slackware.

1.6.6. dpkg-dev-el

dpkg-dev-el is an Emacs lisp package that provides assistance when editing some of the files in the debian directory of your package. For instance, there are handy functions for listing a package's current bugs, and for finalizing the latest entry in a debian/changelog file.

1.6.7. dpkg-depcheck

dpkg-depcheck (dal pacchetto devscripts, devscripts) esegue un comando sotto strace per determinare tutti i pacchetti che sono stati da esso utilizzati.

Per i pacchetti Debian, questo è utile quando si deve creare una voce Build-Depends per il proprio nuovo pacchetto: l'esecuzione del processo di generazione attraverso dpkg-depcheck fornirà una buona prima approssimazione delle dipendenze per la compilazione. Per esempio:

dpkg-depcheck -b debian/rules build

dpkg-depcheck può essere utilizzato anche per controllare le dipendenze in fase di esecuzione, soprattutto se il pacchetto usa exec 2 per eseguire altri programmi.

Per ulteriori informazioni consultare dpkg-depcheck 1.

1.7. Strumenti per i port

I seguenti strumenti sono utili per gli autori di port e per la cross-compilazione.

1.7.1. dpkg-cross

dpkg-cross è uno strumento per installare librerie e intestazioni per cross-compilare in modo simile a dpkg. Inoltre, le funzionalità di dpkg-buildpackage e dpkg-shlibdepssono state migliorate per supportare la cross-compilazione.

1.8. Documentazione ed informazioni

I seguenti pacchetti forniscono informazioni per i maintainer o aiutano con la scrittura di documentazione.

1.8.1. debian-policy

The debian-policy package contains the Debian Policy Manual and related documents, which are:

  • Debian Policy Manual

  • Filesystem Hierarchy Standard (FHS)

  • Debian Menu sub-policy

  • Debian Perl sub-policy

  • Debian configuration management specification

  • Machine-readable debian/copyright specification

  • Autopkgtest - automatic as-installed package testing

  • Authoritative list of virtual package names

  • Policy checklist for upgrading your packages

The Debian Policy Manual the policy relating to packages and details of the packaging mechanism. It covers everything from required gcc options to the way the maintainer scripts (postinst etc.) work, package sections and priorities, etc.

Also useful is the file /usr/share/doc/debian-policy/upgrading-checklist.txt.gz, which lists changes between versions of policy.

1.8.2. doc-debian

doc-debian contains lots of useful Debian-specific documentation:

  • Debian Linux Manifesto

  • Constitution for the Debian Project

  • Debian Social Contract

  • Debian Free Software Guidelines

  • Debian Bug Tracking System documentation

  • Introduction to the Debian mailing lists

1.8.3. developers-reference

The developers-reference package contains the document you are reading right now, the Debian Developer's Reference, a set of guidelines and best practices which has been established by and for the community of Debian developers.

1.8.4. maint-guide

The maint-guide package contains the Debian New Maintainers' Guide.

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.

1.8.5. packaging-tutorial

This tutorial is an introduction to Debian packaging. It teaches prospective developers how to modify existing packages, how to create their own packages, and how to interact with the Debian community.

In addition to the main tutorial, it includes three practical sessions on modifying the grep package, and packaging the gnujump game and a Java library.

1.8.6. how-can-i-help

how-can-i-help shows opportunities for contributing to Debian. how-can-i-help hooks into APT to list opportunities for contributions to Debian (orphaned packages, bugs tagged 'newcomer') for packages installed locally, after each APT invocation. It can also be invoked directly, and then lists all opportunities for contribution (not just the new ones).

1.8.7. docbook-xml

docbook-xml fornisce i DTD Docbook XML, che sono comunemente usati per la documentazione Debian (come il vecchio DTD debiandoc SGML). Questo manuale, per esempio, è stato scritto in DocBook XML.

Il pacchetto docbook-xsl fornisce i file XSL per l'applicazione di stili e la generazione dai sorgenti di vari output. Sara necessario un processore XSLT, come xsltproc, per utilizzare i fogli di stile XSL. La documentazione per i fogli di stile si può trovare nei vari pacchetti docbook-xsl-doc-*.

Per produrre un PDF da FO, è necessario un processore FO, come xmlroff o fop. Un altro strumento per generare PDF da DocBook XML è dblatex.

1.8.8. debiandoc-sgml

debiandoc-sgml provides the DebianDoc SGML DTD, which has been commonly used for Debian documentation, but is now deprecated (docbook-xml or python3-sphinx should be used instead).

1.8.9. debian-keyring

Contains the public OpenPGP keys of Debian Developers and Maintainers. See Mantenere la vostra chiave pubblica and the package documentation for more information.

1.8.10. debview

debview fornisce una modalità Emacs per la visualizzazione dei pacchetti binari Debian. Questo consente di esaminare un pacchetto senza estrarlo.