Projet

Général

Profil

GitPackaging » Historique » Version 5

Daniel Dehennin, 11/01/2012 10:10
Description des étapes et fix des commandes

1 1 Daniel Dehennin
h1. Gestion des paquets EOLE
2 1 Daniel Dehennin
3 2 Daniel Dehennin
h2. Environnement de compilation personel
4 1 Daniel Dehennin
5 2 Daniel Dehennin
Il existe plusieurs outils afin de mettre en place des environnements de compilation personels.
6 2 Daniel Dehennin
7 2 Daniel Dehennin
L’outil utilisé dans le projet "Debian":http://www.debian.org se nomme "sbuild":http://wiki.debian.org/sbuild.
8 2 Daniel Dehennin
9 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.
10 2 Daniel Dehennin
11 2 Daniel Dehennin
Cela permet de lancer des compilations en parallèles au besoin.
12 2 Daniel Dehennin
13 2 Daniel Dehennin
Deux méthodes sont utilisables pour la mise en place des snapshots :
14 2 Daniel Dehennin
15 1 Daniel Dehennin
* [[eole:GitPackagingSbuildLVM|avec LVM]]
16 1 Daniel Dehennin
* [[eole:GitPackagingSbuildBtrfs|avec le système de fichier btrfs]]
17 2 Daniel Dehennin
18 2 Daniel Dehennin
19 2 Daniel Dehennin
Lorsque les schroots sont en place et sbuild configuré, la compilation d’un paquet peut se dérouler comme suit :
20 2 Daniel Dehennin
21 2 Daniel Dehennin
<pre>
22 2 Daniel Dehennin
buildd@build:~$ sudo apt-get install git-core git-buildpackage fakeroot build-essential debhelper cdbs
23 2 Daniel Dehennin
buildd@build:~$ git clone http://dev-eole.ac-dijon.fr/git/eole-debsums
24 2 Daniel Dehennin
buildd@build:~$ cd eole-debsums
25 2 Daniel Dehennin
buildd@build:~$ git checkout -b dist/ubuntu/lucid/build origin/dist/ubuntu/lucid/master
26 2 Daniel Dehennin
buildd@build:~$ git buildpackage --git-builder="sbuild -A -d eole2.3-dev" --git-cleaner=/bin/true
27 2 Daniel Dehennin
</pre>
28 3 Daniel Dehennin
29 3 Daniel Dehennin
h2. TODO Proposition de workflow
30 3 Daniel Dehennin
31 4 Daniel Dehennin
h3. Partie développeur
32 4 Daniel Dehennin
33 4 Daniel Dehennin
# Création d’un tag signé contenant un nouveau numéro de version
34 4 Daniel Dehennin
# Envoi du tag sur le dépôt central dev-eole
35 4 Daniel Dehennin
36 4 Daniel Dehennin
h3. Partie serveur
37 4 Daniel Dehennin
38 3 Daniel Dehennin
# Vérification de la signature: si nok => suppression du tag + report + quit
39 3 Daniel Dehennin
# Checkout du tag == récup de la conf gbp.conf
40 3 Daniel Dehennin
# Switch sur la branche de build
41 3 Daniel Dehennin
# Merge du tag dans la branche de build
42 5 Daniel Dehennin
# Mise à jour de @debian/changelog@ :
43 5 Daniel Dehennin
  <pre>git-dch -a -R/-S debian/</pre>
44 5 Daniel Dehennin
# Ajout de @debian/changelog@ à l’index pour le prochain commit :
45 5 Daniel Dehennin
  <pre>git add debian/changelog</pre>
46 5 Daniel Dehennin
# Commit en utilisant le numéro de version du nouveau paquet :
47 5 Daniel Dehennin
  <pre>git commit -m "Nouveau paquet debian version: $(dpkg-parsechangelog | awk '/^Version/ {print $2}')"</pre>
48 5 Daniel Dehennin
# Construction du paquet en utilisant l’environnement de build correspondant à la distribution du paquet :
49 5 Daniel Dehennin
  <pre>git buildpackage \
50 5 Daniel Dehennin
  --git-builder="sbuild -A -d $(dpkg-parsechangelog | awk '/^Distribution/ {print $2}')" \
51 5 Daniel Dehennin
  --git-cleaner=/bin/true</pre>
52 3 Daniel Dehennin
# Si build OK => git buildpackage --git-tag-only + git push