issue52:tutoubuntudev
                Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| issue52:tutoubuntudev [2011/08/12 20:35] – créée fredphil91 | issue52:tutoubuntudev [2011/10/04 16:11] (Version actuelle) – auntiee | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | Basic Overview of the debian/ Directory | + | **Basic Overview of the debian/ Directory | 
| This article will briefly explain the different files important to the packaging of Ubuntu packages which are contained in the debian/ directory. The most important of them are changelog, control, copyright, and rules. These are required for all packages. A number of additional files in debian/ may be used in order to customize and configure the behavior of the package. Some of these files are discussed in this article, but this is not meant to be a complete list. | This article will briefly explain the different files important to the packaging of Ubuntu packages which are contained in the debian/ directory. The most important of them are changelog, control, copyright, and rules. These are required for all packages. A number of additional files in debian/ may be used in order to customize and configure the behavior of the package. Some of these files are discussed in this article, but this is not meant to be a complete list. | ||
| Ligne 11: | Ligne 11: | ||
| * even more change details | * even more change details | ||
| - | -- maintainer name <email address> | + | -- maintainer name <email address> | 
| - | The format (especially of the date) is important. The date should be in RFC 5322 format, which can be obtained by using the command date -R. For convenience, | + | Présentation rapide du répertoire debian/ | 
| + | |||
| + | Cet article va vous expliquer brièvement les différents fichiers nécessaires à la fabrication des paquets Ubuntu et contenus dans le répertoire debian/. Les plus importants en sont changelog, control, copyright et rules. Ils sont obligatoires pour tous les paquets. Certains fichiers supplémentaires dans debian/ peuvent être utilisés afin de personnaliser et de configurer le comportement du paquet. Nous verrons certains de ces fichiers dans cet article, mais ma liste n'est pas censée être exhaustive. | ||
| + | |||
| + | Le fichier changelog | ||
| + | |||
| + | Ce fichier contient, comme son nom l' | ||
| + | |||
| + | paquet (version) distribution; | ||
| + | |||
| + | * détails des changements | ||
| + | - encore plus de détails des changements | ||
| + | * et encore d' | ||
| + | |||
| + | -- nom du responsable < | ||
| + | |||
| + | **The format (especially of the date) is important. The date should be in RFC 5322 format, which can be obtained by using the command date -R. For convenience, | ||
| Here is a sample changelog file for hello: | Here is a sample changelog file for hello: | ||
| Ligne 20: | Ligne 36: | ||
| * New upstream release with lots of bug fixes and feature improvements. | * New upstream release with lots of bug fixes and feature improvements. | ||
| + | |||
| + | -- Jane Doe < | ||
| + | |||
| + | Le format (surtout celui de la date) est important. La date doit être dans le format RFC 5322, que l'on peut obtenir en utilisant la commande date -R. Pour plus de commodité, la commande dch peut être utilisée pour modifier le fichier changelog ; elle mettra à jour la date automatiquement. Les changements mineurs sont indiqués par un tiret « - » et les changements majeurs par une astérisque « * ». Si vous fabriquez un paquet à partir de zéro, dch --create (dch est dans le paquet devscripts) va créer pour vous un fichier debian/ | ||
| + | |||
| + | Voici un exemple de fichier changelog pour le paquet « hello » : | ||
| + | |||
| + | hello (2.6-0ubuntu1) natty; urgency=low | ||
| + | |||
| + | * Nouvelle version amont, avec beaucoup de corrections de bugs et améliorations de fonctionnalités. | ||
| -- Jane Doe < | -- Jane Doe < | ||
| - | Notice that the version has a -0ubuntu1 appended to it, this is the distro revision, used so that the packaging can be updated (to fix bugs for example) with new uploads within the same source release version. | + | **Notice that the version has a -0ubuntu1 appended to it, this is the distro revision, used so that the packaging can be updated (to fix bugs for example) with new uploads within the same source release version. | 
| Ubuntu and Debian have slightly different package versioning schemes to avoid conflicting packages with the same source version. If a Debian package has been changed in Ubuntu, it has ubuntuX (where X is the Ubuntu revision number) appended to the end of the Debian version. So, if the Debian hello 2.6-1 package was changed by Ubuntu, the version string would be 2.6-1ubuntu1. If a package for the application does not exist in Debian, then the Debian revision is 0 (e.g. 2.6-0ubuntu1). | Ubuntu and Debian have slightly different package versioning schemes to avoid conflicting packages with the same source version. If a Debian package has been changed in Ubuntu, it has ubuntuX (where X is the Ubuntu revision number) appended to the end of the Debian version. So, if the Debian hello 2.6-1 package was changed by Ubuntu, the version string would be 2.6-1ubuntu1. If a package for the application does not exist in Debian, then the Debian revision is 0 (e.g. 2.6-0ubuntu1). | ||
| Ligne 29: | Ligne 55: | ||
| For further information, | For further information, | ||
| The control file | The control file | ||
| - | The control file contains the information that the package manager (such as apt-get, synaptic, and adept) uses, build-time dependencies, | + | The control file contains the information that the package manager (such as apt-get, synaptic, and adept) uses, build-time dependencies, | 
| + | |||
| + | Remarquez que le numéro de version se termine par -0ubuntu1, c'est la révision de la distrib., utilisée pour que le paquet puisse être mis à jour (pour corriger les bogues par exemple) lors des nouveaux ajouts au sein des sources de la même version. | ||
| + | |||
| + | Ubuntu et Debian ont des schémas de versions de paquets légèrement différents pour éviter les conflits de paquets au sein des sources d'une même version. Si un paquet Debian a été modifié dans Ubuntu, il a un ubuntuX (où X est le numéro de révision Ubuntu) ajouté à la fin de la version Debian. Ainsi, si le paquet Debian « hello 2.6-1 » a été modifié par Ubuntu, le numéro de version serait 2.6-1ubuntu1. Si un paquet pour une application n' | ||
| + | |||
| + | Pour plus d' | ||
| + | |||
| + | Le fichier control | ||
| + | |||
| + | Le fichier control contient les informations que le gestionnaire de paquets (comme apt-get, synaptic, ou adept) utilise, les dépendances de dates de build, des informations du mainteneur et beaucoup plus. | ||
| - | For the Ubuntu hello package, the control file looks something like: | + | **For the Ubuntu hello package, the control file looks something like: | 
| Source: hello | Source: hello | ||
| Ligne 52: | Ligne 88: | ||
| an example of how to do a Debian package. It is the Debian version of | an example of how to do a Debian package. It is the Debian version of | ||
| the GNU Project' | the GNU Project' | ||
| - | for the GNU Project). | + | for the GNU Project).** | 
| - | The first paragraph describes the source package - including the list of packages required to build the package from source in the Build-Depends field. It also contains some meta-information such as the maintainer’s name, the version of Debian Policy that the package complies with, the location of the packaging version control repository, and the upstream home page. | + | Pour le paquet « hello » d' | 
| + | |||
| + | Source: hello | ||
| + | Section: devel | ||
| + | Priority: optional | ||
| + | Maintainer: Ubuntu Developers < | ||
| + | XSBC-Original-Maintainer: | ||
| + | Standards-Version: | ||
| + | Build-Depends: | ||
| + | Bzr-Vcs: lp: | ||
| + | Homepage: http:// | ||
| + | |||
| + | Package: hello | ||
| + | Architecture: | ||
| + | Depends: ${shlibs: | ||
| + | Description: | ||
| + | Le programme GNU hello produit une message de bienvenue habituel et | ||
| + | chaleureux. Ceci permet aux personnes non programmeurs d' | ||
| + | informatique classique dont ils ne disposeraient pas autrement. | ||
| + | Sérieusement, | ||
| + | paquet Debian. C'est la version Debian du programme « hello world » du | ||
| + | projet GNU (qui sert, lui-même d' | ||
| + | |||
| + | **The first paragraph describes the source package - including the list of packages required to build the package from source in the Build-Depends field. It also contains some meta-information such as the maintainer’s name, the version of Debian Policy that the package complies with, the location of the packaging version control repository, and the upstream home page. | ||
| Note that, in Ubuntu, we set the Maintainer field to a general address because anyone can change any package (this differs from Debian where changing packages is usually restricted to an individual or a team). Packages in Ubuntu should generally have the Maintainer field set to Ubuntu Developers < | Note that, in Ubuntu, we set the Maintainer field to a general address because anyone can change any package (this differs from Debian where changing packages is usually restricted to an individual or a team). Packages in Ubuntu should generally have the Maintainer field set to Ubuntu Developers < | ||
| - | Each additional paragraph describes a binary package to be built. | + | Each additional paragraph describes a binary package to be built.** | 
| - | For further information, | + | Le premier paragraphe décrit le paquet source - y compris la liste des paquets nécessaires pour construire le paquet depuis les sources dans le champ Build-Depends. Il contient également certaines méta-informations comme le nom du mainteneur, la version de Charte Debian à laquelle se conforme le paquet, l' | 
| + | |||
| + | Notez que, dans Ubuntu, nous avons indiqué une adresse générique dans le champ Maintainer parce que n' | ||
| + | |||
| + | Chaque paragraphe supplémentaire décrit un paquet binaire à construire. | ||
| + | |||
| + | **For further information, | ||
| The copyright file | The copyright file | ||
| This file gives the copyright information for both the upstream source and the packaging. Ubuntu and Debian Policy (Section 12.5) require that each package installs a verbatim copy of its copyright and license information to / | This file gives the copyright information for both the upstream source and the packaging. Ubuntu and Debian Policy (Section 12.5) require that each package installs a verbatim copy of its copyright and license information to / | ||
| Generally, copyright information is found in the COPYING file in the program’s source directory. This file should include such information as the names of the author and the packager, the URL from which the source came, a Copyright line with the year and copyright holder, and the text of the copyright itself. An example template would be: | Generally, copyright information is found in the COPYING file in the program’s source directory. This file should include such information as the names of the author and the packager, the URL from which the source came, a Copyright line with the year and copyright holder, and the text of the copyright itself. An example template would be: | ||
| + | |||
| + | Format: http:// | ||
| + | Upstream-Name: | ||
| + | Source: ftp:// | ||
| + | |||
| + | Pour plus d' | ||
| + | |||
| + | Le fichier copyright | ||
| + | |||
| + | Ce fichier donne les informations de copyright à la fois pour la source en amont et pour le paquet. Les chartes Ubuntu et Debian (Section 12.5) exigent que chaque paquet installe une copie intégrale des informations de licence et de copyright dans / | ||
| + | |||
| + | En règle générale, les informations de copyright se trouvent dans le fichier COPYING dans le répertoire source du programme. Ce fichier doit contenir des informations telles que les noms de l' | ||
| Format: http:// | Format: http:// | ||
| Ligne 70: | Ligne 147: | ||
| Source: ftp:// | Source: ftp:// | ||
| - | Files: * | + | **Files: * | 
| Copyright: Copyright 1998 John Doe < | Copyright: Copyright 1998 John Doe < | ||
| License: GPL-2+ | License: GPL-2+ | ||
| Ligne 92: | Ligne 169: | ||
| On Debian systems, the full text of the GNU General Public | On Debian systems, the full text of the GNU General Public | ||
| License version 2 can be found in the file | License version 2 can be found in the file | ||
| - | `/ | + | `/ | 
| - | Files: debian/* | + | Files: * | 
| + | Copyright: Copyright 1998 John Doe < | ||
| + | License: GPL-2+ | ||
| + | Ce programme est un logiciel libre ; vous pouvez le redistribuer | ||
| + | et/ou le modifier conformément aux dispositions de la Licence | ||
| + | Publique Générale GNU, telle que publiée par la Free Software | ||
| + | Foundation ; version 2 de la licence, ou encore (à votre choix) | ||
| + | toute version ultérieure. | ||
| + | . | ||
| + | Ce programme est distribué dans l’espoir qu’il sera utile, mais | ||
| + | SANS AUCUNE GARANTIE ; sans même la garantie implicite de | ||
| + | COMMERCIALISATION ou D’ADAPTATION A UN USAGE PARTICULIER. Pour | ||
| + | plus de détails, voir la Licence Publique Générale GNU. | ||
| + | . | ||
| + | Un exemplaire de la Licence Publique Générale GNU doit être | ||
| + | fourni avec ce programme ; si ce n’est pas le cas, écrivez à la | ||
| + | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, | ||
| + | Boston, MA 02110-1301 USA | ||
| + | . | ||
| + | Sur les systèmes Debian, le texte complet de la Licence Générale | ||
| + | Publique GNU version 2 peut être trouvé dans le fichier | ||
| + | / | ||
| + | |||
| + | **Files: debian/* | ||
| Copyright: Copyright 1998 Jane Doe < | Copyright: Copyright 1998 Jane Doe < | ||
| License: GPL-2+ | License: GPL-2+ | ||
| Ligne 108: | Ligne 208: | ||
| # Uncomment this to turn on verbose mode. | # Uncomment this to turn on verbose mode. | ||
| + | #export DH_VERBOSE=1 | ||
| + | |||
| + | %: | ||
| + | dh $@** | ||
| + | |||
| + | Files: debian/* | ||
| + | Copyright: Copyright 1998 Jane Doe < | ||
| + | License: GPL-2+ | ||
| + | |||
| + | Cet exemple suit la proposition Debian DEP-5 : debian/ | ||
| + | |||
| + | Le fichier rules | ||
| + | |||
| + | Le dernier fichier que nous devons examiner est rules [Ndt : les règles]. Celui-ci fait tout le travail pour la création de notre paquet. Il s'agit d'un Makefile avec des cibles pour compiler et installer l' | ||
| + | |||
| + | Voici une version simplifiée du fichier rules créé par dh_make (que vous trouverez dans le paquet dh-make) : | ||
| + | |||
| + | # | ||
| + | # -*- makefile -*- | ||
| + | |||
| + | # décommentez la ligne suivante pour passe en mode verbeux | ||
| #export DH_VERBOSE=1 | #export DH_VERBOSE=1 | ||
| Ligne 113: | Ligne 234: | ||
| dh $@ | dh $@ | ||
| - | Let us go through this file in some detail. What this does is pass every build target that debian/ | + | **Let us go through this file in some detail. What this does is pass every build target that debian/ | 
| dh runs a sequence of debhelper commands. The supported sequences correspond to the targets of a debian/ | dh runs a sequence of debhelper commands. The supported sequences correspond to the targets of a debian/ | ||
| Ligne 119: | Ligne 240: | ||
| dh binary-arch --no-act | dh binary-arch --no-act | ||
| - | Commands in the binary-indep sequence are passed the “-i” option to ensure they work only on binary independent packages, and commands in the binary-arch sequences are passed the “-a” option to ensure they work only on architecture dependent packages. | + | Commands in the binary-indep sequence are passed the “-i” option to ensure they work only on binary independent packages, and commands in the binary-arch sequences are passed the “-a” option to ensure they work only on architecture dependent packages.** | 
| - | Each debhelper command will record when it’s successfully run in debian/package.debhelper.log. (Which dh_clean deletes.) So dh can tell which commands have already been run, for which packages, and skip running those commands again. Each time dh is run, it examines the log, and finds the last logged command that is in the specified sequence. It then continues with the next command in the sequence. The --until, --before, --after, and --remaining options can override this behavior. | + | Regardons ce fichier en détail. Il va passer chaque cible de construction correspondant à l'un des arguments passés lors de l' | 
| - | If debian/ | + | dh exécute une séquence de commandes debhelper. Les séquences supportées correspondent aux cibles d'un fichier | 
| - | Have a look at / | + | dh binary-arch --no-act | 
| + | |||
| + | Les commandes dans la séquence binary-indep sont appelées avec l' | ||
| + | |||
| + | **Each debhelper command will record when it’s successfully run in debian/ | ||
| + | |||
| + | If debian/ | ||
| + | |||
| + | Chaque commande debhelper va l' | ||
| + | |||
| + | Si debian/ | ||
| + | |||
| + | **Have a look at / | ||
| Additional Files | Additional Files | ||
| The install file | The install file | ||
| Ligne 135: | Ligne 268: | ||
| In the first case, the install file should have one line per file installed, specifying both the file and the installation directory. For example, the following install file would install the script foo in the source package’s root directory to usr/bin, and a desktop file in the debian directory to usr/ | In the first case, the install file should have one line per file installed, specifying both the file and the installation directory. For example, the following install file would install the script foo in the source package’s root directory to usr/bin, and a desktop file in the debian directory to usr/ | ||
| + | |||
| + | foo usr/bin | ||
| + | debian/ | ||
| + | |||
| + | Jetez un oeil à / | ||
| + | |||
| + | Fichiers supplémentaires | ||
| + | |||
| + | Le fichier d' | ||
| + | |||
| + | Le fichier d' | ||
| + | |||
| + | * pour installer les fichiers dans votre paquet qui ne sont pas traitées par le système de build en amont ; | ||
| + | * pour fractionner un seul paquet source de grande taille en plusieurs paquets binaires. | ||
| + | |||
| + | Dans le premier cas, le fichier d' | ||
| foo usr/bin | foo usr/bin | ||
| debian/ | debian/ | ||
| - | When a source package is producing multiple binary packages, dh will install the files into debian/tmp rather than directly into debian/< | + | **When a source package is producing multiple binary packages, dh will install the files into debian/tmp rather than directly into debian/< | 
| usr/bin/ | usr/bin/ | ||
| Ligne 145: | Ligne 294: | ||
| While foo-common.install containing only the architecture independent file might look like: | While foo-common.install containing only the architecture independent file might look like: | ||
| + | |||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | |||
| + | Quand un paquet source produit plusieurs paquets binaires, dh installera les fichiers dans debian/tmp plutôt que directement dans debian/< | ||
| + | |||
| + | usr/bin/ | ||
| + | usr/ | ||
| + | |||
| + | Alors que foo-common.install ne contenant que les fichiers indépendants de l' | ||
| / | / | ||
| Ligne 151: | Ligne 312: | ||
| / | / | ||
| - | This would create two binary packages, foo and foo-common. Both would require their own paragraph in debian/ | + | **This would create two binary packages, foo and foo-common. Both would require their own paragraph in debian/ | 
| See man dh_install and the install file section (Section 5.11) of the Debian New Maintainers’ Guide for additional details. | See man dh_install and the install file section (Section 5.11) of the Debian New Maintainers’ Guide for additional details. | ||
| The watch file | The watch file | ||
| The debian/ | The debian/ | ||
| + | |||
| + | version=3 | ||
| + | http:// | ||
| + | |||
| + | Ceci créerait deux paquets binaires, foo et foo-commun. Les deux auraient besoin de leur propre paragraphe dans debian/ | ||
| + | |||
| + | Voyez « man dh_install » et la section d' | ||
| + | |||
| + | Le fichier watch | ||
| + | |||
| + | Le fichier debian/ | ||
| version=3 | version=3 | ||
| http:// | http:// | ||
| - | Running uscan in the root source directory will now compare the upstream version number in debian/ | + | **Running uscan in the root source directory will now compare the upstream version number in debian/ | 
| $ uscan | $ uscan | ||
| Ligne 169: | Ligne 341: | ||
| and symlinked hello_2.7.orig.tar.gz to it | and symlinked hello_2.7.orig.tar.gz to it | ||
| - | For further information, | + | For further information, | 
| - | For a list of packages where the watch file reports they are not in sync with upstream, see Ubuntu External Health Status. | + | Exécuter uscan dans le répertoire racine source comparera maintenant le numéro de la version en amont dans debian/ | 
| + | |||
| + | $ uscan | ||
| + | hello: Nouvelle version (2.7) disponible sur le site distant : | ||
| + |  | ||
| + | (la version locale est la 2.6) | ||
| + | hello: téléchargement du paquet hello-2.7.tar.gz mis à jour réussi | ||
| + | et création d'un lien symbolique à hello_2.7.orig.tar.gz | ||
| + | |||
| + | Pour plus d' | ||
| + | |||
| + | **For a list of packages where the watch file reports they are not in sync with upstream, see Ubuntu External Health Status. | ||
| The source/ | The source/ | ||
| This file indicates the format of the source package. Currently, the package source format defaults to 1.0 if this file does not exist. You are encouraged to use the newer 3.0 source format. In this case, the file should contain a single line indicating the desired format: | This file indicates the format of the source package. Currently, the package source format defaults to 1.0 if this file does not exist. You are encouraged to use the newer 3.0 source format. In this case, the file should contain a single line indicating the desired format: | ||
| Ligne 179: | Ligne 362: | ||
| - | If, for some reason, you wish to keep using the old format, please create this file and put 1.0 in it to be explicit about the source package version. This allows for the future removal of the 1.0 default for the package source format. | + | If, for some reason, you wish to keep using the old format, please create this file and put 1.0 in it to be explicit about the source package version. This allows for the future removal of the 1.0 default for the package source format.** | 
| - | http:// | + | Pour une liste des paquets pour lesquels le fichier watch signale qu'ils ne sont pas synchronisés avec l' | 
| + | |||
| + | Le fichier source/ | ||
| + | |||
| + | Ce fichier indique le format du paquet source. Actuellement, | ||
| + | |||
| + | * 3.0 (native) pour les paquets Debian natifs (pas de version en amont) ou | ||
| + | * 3.0 (quilt) pour les paquets avec une archive distincte en amont | ||
| + | |||
| + | Si pour une raison quelconque vous souhaitez continuer à utiliser l' | ||
| + | |||
| + | **http:// | ||
| See man dpkg-source and the source/ | See man dpkg-source and the source/ | ||
| Additional Resources | Additional Resources | ||
| - | In addition to the links to the Debian Policy Manual in each section above, the Debian New Maintainers’ Guide has more detailed descriptions of each file. Chapter 4, “Required files under the debian directory” further discusses the control, changelog, copyright, and rules files. Chapter 5, “Other files under the debian directory” discusses additional files that may be used. | + | In addition to the links to the Debian Policy Manual in each section above, the Debian New Maintainers’ Guide has more detailed descriptions of each file. Chapter 4, “Required files under the debian directory” further discusses the control, changelog, copyright, and rules files. Chapter 5, “Other files under the debian directory” discusses additional files that may be used.** | 
| + | |||
| + | http:// | ||
| + | |||
| + | Voyez « man dpkg-source » et la section source/ | ||
| + | |||
| + | Ressources supplémentaires | ||
| + | |||
| + | En plus des liens vers la Charte Debian dans chaque section ci-dessus, le Guide du Nouveau Responsable Debian contient des descriptions plus détaillées de chaque fichier. Le chapitre 4, « Fichiers obligatoires dans le répertoire debian » présente en détail les fichiers control, changelog, copyright et rules. Le chapitre 5, « Autres fichiers dans le répertoire debian » parle des fichiers supplémentaires qui peuvent être utilisés. | ||
issue52/tutoubuntudev.1313174141.txt.gz · Dernière modification : 2011/08/12 20:35 de fredphil91
                
                