15.3. Créer une archive de paquets pour APT
Les administrateurs de Falcot SA maintiennent désormais un certain nombre de paquets Debian modifiés ou créés par eux et qui leur servent à diffuser des données et programmes internes.
To make deployment easier, they want to integrate these packages in a package archive that can be directly used by APT. For obvious maintenance reasons, they wish to separate internal packages from locally-rebuilt packages. The goal is for the matching entries in a /etc/apt/sources.list.d/falcot.list
file to be as follows:
deb http://packages.falcot.com/ updates/
deb http://packages.falcot.com/ internal/
The administrators therefore configure a virtual host on their internal HTTP server, with /srv/vhosts/packages/
as the root of the associated web space. The management of the archive itself is delegated to the mini-dinstall
command (in the similarly-named package). This tool keeps an eye on an incoming/
directory (in our case, /srv/vhosts/packages/mini-dinstall/incoming/
) and waits for new packages there; when a package is uploaded, it is installed into a Debian archive at /srv/vhosts/packages/
. The mini-dinstall
command reads the *.changes
file created when the Debian package is generated. These files contain a list of all other files associated with the version of the package (*.deb
, *.dsc
, *.diff.gz
/*.debian.tar.gz
, *.orig.tar.gz
, or their equivalents with other compression tools), and these allow mini-dinstall
to know which files to install. *.changes
files also contain the name of the target distribution (often unstable
) mentioned in the latest debian/changelog
entry, and mini-dinstall
uses this information to decide where the package should be installed. This is why administrators must always change this field before building a package, and set it to internal
or updates
, depending on the target location. mini-dinstall
then generates the files required by APT, such as Packages.gz
.
La configuration de mini-dinstall
nécessite de mettre en place un fichier ~/.mini-dinstall.conf
, que les administrateurs de Falcot SA ont renseigné comme suit :
[DEFAULT]
archive_style = flat
archivedir = /srv/vhosts/packages
verify_sigs = 0
mail_to = admin@falcot.com
generate_release = 1
release_origin = Falcot SA
release_codename = stable
[updates]
release_label = Recompiled Debian Packages
[internal]
release_label = Internal Packages
Il est intéressant d'y remarquer la décision de générer des fichiers
Release
pour chacune des archives. Cela permettra éventuellement de gérer les priorités d'installation des paquets à l'aide du fichier de configuration
/etc/apt/preferences
(voir
Section 6.2.5, « Gérer les priorités associées aux paquets » pour les détails).
L'exécution de mini-dinstall
démarre en fait le démon en arrière-plan. Tant qu'il fonctionne, il vérifie toutes les demi-heures si un nouveau paquet est disponible dans le répertoire incoming/
, le place dans l'archive et régénère les différents fichiers Packages.gz
et Sources.gz
. Si la présence d'un démon constitue un problème, il est possible de l'invoquer en mode non interactif (ou batch), à l'aide de l'option -b
, à chaque fois qu'un paquet aura été déposé dans le répertoire incoming/
. Découvrez les autres possibilités offertes par mini-dinstall
en consultant sa page de manuel mini-dinstall(1).