Projet

Général

Profil

GitPackaging » Historique » Version 12

Daniel Dehennin, 23/01/2012 11:37
La branche de build est un checkout de la dernière version Debian

1 6 Daniel Dehennin
{{toc}}
2 6 Daniel Dehennin
3 1 Daniel Dehennin
h1. Gestion des paquets EOLE
4 1 Daniel Dehennin
5 2 Daniel Dehennin
h2. Environnement de compilation personel
6 1 Daniel Dehennin
7 2 Daniel Dehennin
Il existe plusieurs outils afin de mettre en place des environnements de compilation personels.
8 2 Daniel Dehennin
9 2 Daniel Dehennin
L’outil utilisé dans le projet "Debian":http://www.debian.org se nomme "sbuild":http://wiki.debian.org/sbuild.
10 2 Daniel Dehennin
11 2 Daniel Dehennin
Ce système peut se reposer sur un système de snapshot : on installe un système de base, propre, et la compilation se fait dans un snapshot temporarire de ce système.
12 2 Daniel Dehennin
13 2 Daniel Dehennin
Cela permet de lancer des compilations en parallèles au besoin.
14 2 Daniel Dehennin
15 2 Daniel Dehennin
Deux méthodes sont utilisables pour la mise en place des snapshots :
16 2 Daniel Dehennin
17 1 Daniel Dehennin
* [[eole:GitPackagingSbuildLVM|avec LVM]]
18 1 Daniel Dehennin
* [[eole:GitPackagingSbuildBtrfs|avec le système de fichier btrfs]]
19 2 Daniel Dehennin
20 2 Daniel Dehennin
21 2 Daniel Dehennin
Lorsque les schroots sont en place et sbuild configuré, la compilation d’un paquet peut se dérouler comme suit :
22 2 Daniel Dehennin
23 2 Daniel Dehennin
<pre>
24 2 Daniel Dehennin
buildd@build:~$ sudo apt-get install git-core git-buildpackage fakeroot build-essential debhelper cdbs
25 2 Daniel Dehennin
buildd@build:~$ git clone http://dev-eole.ac-dijon.fr/git/eole-debsums
26 2 Daniel Dehennin
buildd@build:~$ cd eole-debsums
27 2 Daniel Dehennin
buildd@build:~$ git checkout -b dist/ubuntu/lucid/build origin/dist/ubuntu/lucid/master
28 9 Daniel Dehennin
buildd@build:~$ git buildpackage --git-builder="sbuild -A -d eole-2.3-dev" --git-cleaner=/bin/true
29 2 Daniel Dehennin
</pre>
30 3 Daniel Dehennin
31 3 Daniel Dehennin
h2. TODO Proposition de workflow
32 3 Daniel Dehennin
33 4 Daniel Dehennin
h3. Partie développeur
34 4 Daniel Dehennin
35 4 Daniel Dehennin
# Création d’un tag signé contenant un nouveau numéro de version
36 4 Daniel Dehennin
# Envoi du tag sur le dépôt central dev-eole
37 4 Daniel Dehennin
38 10 Daniel Dehennin
h3. Partie packageur
39 10 Daniel Dehennin
 
40 10 Daniel Dehennin
# Fusion de la branche développeur dans la branche de packaging
41 10 Daniel Dehennin
# Création d’un tag signé contenant le nouveau numéro de version basé sur celui du développeur
42 10 Daniel Dehennin
# Envoi du tag sur le dépôt central dev-eole
43 1 Daniel Dehennin
44 10 Daniel Dehennin
Cette partie peut être automatisée si un mapping existe entre les branches de développement et les branches de packaging.
45 10 Daniel Dehennin
Dans ce cas, on pourra vérifier la signature du développeur.
46 10 Daniel Dehennin
47 10 Daniel Dehennin
h3. Partie builder : gestion du source Debian
48 10 Daniel Dehennin
49 10 Daniel Dehennin
Le but de cette partie est de créer l’ensemble des fichiers sources Debian :
50 10 Daniel Dehennin
51 10 Daniel Dehennin
* @<PAQUET>_<VERSION SOURCE>.orig.tar.gz@    : Les sources non packagées (dans le répertoire @debian/@)
52 10 Daniel Dehennin
* @<PAQUET>_<VERSION DEBIAN>.debian.tar.gz@  : Le packaging des sources (le répertoire @debian/@)
53 10 Daniel Dehennin
* @<PAQUET>_<VERSION DEBIAN>.dsc@            : Description du paquet source Debian (doit être signé)
54 10 Daniel Dehennin
* @<PAQUET>_<VERSION DEBIAN>_source.changes@ : Description des changements (mixe entre l’entrée de @debian/changelog@ de cette version et le fichier @.dsc@)
55 10 Daniel Dehennin
56 3 Daniel Dehennin
# Vérification de la signature: si nok => suppression du tag + report + quit
57 3 Daniel Dehennin
# Checkout du tag == récup de la conf gbp.conf
58 12 Daniel Dehennin
# Checkout de la branche de build depuis le dernier tag de version Debian
59 5 Daniel Dehennin
# Merge du tag dans la branche de build
60 5 Daniel Dehennin
# Mise à jour de @debian/changelog@ :
61 5 Daniel Dehennin
  <pre>git-dch -a -R/-S debian/</pre>
62 5 Daniel Dehennin
# Ajout de @debian/changelog@ à l’index pour le prochain commit :
63 5 Daniel Dehennin
  <pre>git add debian/changelog</pre>
64 1 Daniel Dehennin
# Commit en utilisant le numéro de version du nouveau paquet :
65 1 Daniel Dehennin
  <pre>git commit -m "Nouveau paquet debian version: $(dpkg-parsechangelog | awk '/^Version/ {print $2}')"</pre>
66 10 Daniel Dehennin
# Construction du source debian et envoi sur un dépôt debian, sans faire de nettoyage, ni de vérification de dépendance:
67 5 Daniel Dehennin
  <pre>git buildpackage \
68 10 Daniel Dehennin
  --git-builder="dpkg-buildpackage -nc -d -S" \
69 10 Daniel Dehennin
  --git-postbuild='dput eole "${GBP_CHANGES_FILE}"'
70 1 Daniel Dehennin
  --git-cleaner=/bin/true</pre>
71 10 Daniel Dehennin
72 10 Daniel Dehennin
Cette partie peut être automatisée.
73 10 Daniel Dehennin
74 10 Daniel Dehennin
h3. Partie dépôt : gestion du source Debian
75 10 Daniel Dehennin
76 10 Daniel Dehennin
Cette partie peut être prise en charge automatiquement par "différente méthode":http://git.debian.org/?p=mirrorer/reprepro.git;a=blob_plain;hb=HEAD;f=docs/manual.html (section "Processing an incoming queue") :
77 10 Daniel Dehennin
78 10 Daniel Dehennin
* "cron":http://fr.wikipedia.org/wiki/cron
79 10 Daniel Dehennin
* "inotify":http://fr.wikipedia.org/wiki/Inotify
80 10 Daniel Dehennin
* "dput/dupload":http://www.debian.org/doc/manuals/maint-guide/upload.en.html
81 10 Daniel Dehennin
82 10 Daniel Dehennin
L’utilisation de @dput@ ou @dupload@ requiert de mettre en place une configuration et des autorisation pour chaque « uploader ».
83 10 Daniel Dehennin
84 10 Daniel Dehennin
La solution @inotify@ est le meilleur compromis :
85 10 Daniel Dehennin
86 10 Daniel Dehennin
* Ne requiert une configuration qu’à un endroit ;
87 10 Daniel Dehennin
* Prise en compte rapide des uploads.
88 10 Daniel Dehennin
89 10 Daniel Dehennin
h3. Partie builder : gestion des paquets binaires
90 10 Daniel Dehennin
91 10 Daniel Dehennin
La construction des paquets binaires est dépendante de l’"architecture":http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Architecture déclarée dans @debian/control@ :
92 10 Daniel Dehennin
93 10 Daniel Dehennin
* Une seule fois pour les paquets déclarés avec l’architecture *all*
94 10 Daniel Dehennin
* Pour chaque architecture supportée pour les paquets déclarés avec l’architecture *any* ou une liste d’architecture
95 10 Daniel Dehennin
96 10 Daniel Dehennin
# Téléchargement des sources depuis le dépôt :
97 10 Daniel Dehennin
  <pre>apt-get source <PAQUET></pre>
98 10 Daniel Dehennin
# Construction du paquet en utilisant l’[[GitPackaging#Environnement de compilation personel|environnement de build]] correspondant à la distribution du paquet :
99 10 Daniel Dehennin
  <pre>cd <PAQUET>-<VERSION>/ \
100 10 Daniel Dehennin
  && sbuild -A -d $(dpkg-parsechangelog | awk '/^Distribution/ {print $2}')"</pre>
101 8 Daniel Dehennin
# Si build OK :
102 8 Daniel Dehennin
## On tag la version du paquet :
103 8 Daniel Dehennin
    <pre>git buildpackage --git-tag-only</pre>
104 8 Daniel Dehennin
## On envoi le tag sur le dépôt central :
105 8 Daniel Dehennin
    <pre>git push</pre>
106 8 Daniel Dehennin
## On supprime la branche de build qui est inutile
107 8 Daniel Dehennin
## On envoi le paquet sur le dépôt des paquets debian
108 7 Daniel Dehennin
109 7 Daniel Dehennin
h2. Webographie
110 7 Daniel Dehennin
111 7 Daniel Dehennin
* "PackagingGuide/Python":https://wiki.ubuntu.com/PackagingGuide/Python
112 11 Daniel Dehennin
* "Rebuildd":http://julien.danjou.info/software/rebuildd
113 11 Daniel Dehennin
* "Rebuildd on Debian":http://packages.qa.debian.org/rebuildd
114 11 Daniel Dehennin
* "Rebuildd for building a Private PPA on Ubuntu":http://inodes.org/2009/09/14/building-a-private-ppa-on-ubuntu/