summaryrefslogtreecommitdiff
path: root/gbp.mdwn
blob: 6e45a23e6c1387f51dc04bf80dc74b463c53275b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
---
title: Debian Pakete in Git entwickeln
tags: [Debian, Git]
author: Guido Günther <agx@sigxcpu.org>
rights:  (c) 2014 Guido Günther, CC BY-SA
...

# Warum

* Versionskontrolle
* Mehrere Branches: experimental, sid, stable, backports
* Arbeit im Team

---

# Warum II

Erleichterung wiederkehrender Aufgaben

* Bestehendes Debian Paket importieren - um mal schnell was zu ändern
* ändern, bauen, testen, ändern, bauen, testen, ändern, ...
* Neue Upstream Version importieren
* debian/changelog schreiben
* Patches hinzufügen, aktualisieren, entfernen

---

# Die Werkzeuge

* git-buildpackage
* git
* cowdancer aka cowbuilder
* pristine-tar

<div class="notes">
gbp benutzt jede Menge andere Tools:
dpkg-buildpackage, debuild, cowbuilder, ...
</div>

---

# gbp supercommand

* buildpackage - Bauen von Paketen
* import-orig - Upstream Tarball importieren
* import-dsc - Debian Paket importieren
* config - gbp Konfiguration anzeigen

<div class="notes">
Die wichtigsten Tools
</div>

---

# gbp supercommand II

* dch - Changelog generieren
* pq - Patches managen
* import-dscs - mehrere Versionen importieren

<div class="notes">
Sollte man kennen, erleichtern das Leben
</div>

---

# gbp supercommand III

* clone - Git Repository clonen
* pull - Git Repository aktualsieren
* create-remote-repo - Remote repository erzeugen

* (import-srpm)
* (pq-rpm)

<div class="notes">
 * Eher selten
 * RPM support
</div>

---

# Layout

![Gbp Branches](branches.png)

<div class="notes">
* Packaging Branch, Uptream Branch, Tags
</div>

---

# Layout

* Packaging Branch - pro Debian Release
* Upstream Branch
* pristine-tar Branch - ein mal pro Repository

![pristine-tar](pristine_tar.png)

---

# Vorbereitungen

---

## Konfiguration

    cat <<EOF > ~/.gbp.conf
	[DEFAULT]
	sign-tags = True
	keyid = 0xB999CDB58C8DDBD2
	pristine-tar = True

	[buildpackage]
	postbuild = lintian $GBP_CHANGES_FILE
	cleaner = /bin/true
	pbuilder = True
	EOF

---

## Konfiguration II

* /etc/git-buildpackage/gbp.conf
* ~/.gbp.conf
* Im Repsitory
    * .gbp.conf
    * debian/gbp.conf
    * .git/gbp.conf
* Anzeigen mit

        gbp config <command>

---

## Chroots erstellen

    git-pbuilder create
	DIST=wheezy git-pbuilder create
    DIST=wheezy-backports git-pbuilder create

---

# Wie anfangen?

## Mit bestehendem Paket

	gbp import-dsc python-dateutil_1.4.3-2.dsc
	gbp import-dsc --download http://.../python-dateutil_1.4.3-2.dsc
	gbp import-dsc --download python-dateutil

---

# Debian Paket bauen

    gbp buildpackge [--git-ignore-new]

---

## Der Ablauf

* Repository aufräumen
* Orig Tarball erstellen (von Tag)
* Builder aufrufen
* Hooks aufrufen

---

![gbp buildpackage](gbp-buildpackage.png)

---

# Neue Upstream Version importieren

---

## Aus Tarball

    gbp import-orig python-dateutil_1.4.3.orig.tar.gz
	gbp import-orig --uscan

---

# Upstream benutzt Git

* Debian Branch erstellen

        gbp checkout -b debian/sid

* Konfiguration anpassen

        [DEFAULT]
        debian-branch = debian/sid
        upstream-tag = v%(version)s
        upstream-branch = master

* ``gbp import-orig`` entfällt
* sonst alles beim alten

---

## Neue Upstream Version paketieren

        gbp checkout debian/sid
        git merge v1.0.0
        gbp dch --snapshot --auto
		gbp buildpackage --git-pristinte-tar-commit

---

# ChangeLogs

---

## Commit Message

    commit a629df279795cd703b1815f3363541256ddbab6a
    Author: Guido Günther <agx@sigxcpu.org>
    Date:   Sat May 10 10:48:41 2014 +0200

        Set safer env vars

        We can't expect to have a $HOME and we don't want to default to anything
        than the test driver.

        Closes: #734975, #738383

## debian/changelog
    * [a629df2] Set safer env vars.  We can't expect to have a $HOME and we don't
      want to default to anything than the test driver.
      (Closes: #734975, #738383)

---

## Konfiguration

    cat <<EOF >> ~/.gbp.conf

	[dch]
	meta = True
	id-length = 7
	full = True
	git-author = True
	multimaint-merge = True
    EOF

---

## Changlogs erstellen

	gbp dch --snapshot --auto
    gbp dch --release --auto

---

# Patches

---

## Das Konzept

* Debian Source Format 3.0 (quilt)
    * hat Patches in debian/patches
    * werden während des Builds angewendet

            cat <<EOF >> debian/source/local-options
            unapply-patches
		    EOF

* "``gbp pq import``" importiert diese in Git Branch
* "``gbp pq export``" exportiert diese wieder

<div class="notes">
* Am Beispiel von libvirt vorführen
* --commit
* drop
* gbp pq apply --topic=foo <patch>
</div>

---

### Vorteile
* orientiert sich stark an der Arbeit mit Quilt
* patches leicht an Upstream mailbar
* Upstream Sourcen immer unmodifiziert
* Patches leicht kategorisierbar (Gbp-Pq: Topic topic)

### Nachteile
* Upstream kann nicht einfach cherry-picken
* Bei Merges muss man PQ selber pflegen

---

## Konfiguration

    cat <<EOF >> ~/.gbp.conf

    [pq]
    patch-numbers = False
	EOF

---

## Alternativen

* Gepatchter Packaging Branch

        cat <<EOF >> debian/source/local-options
        auto-commit
        single-debian-patch

        cat <<EOF >> debian/.gitignore
        patches/

    * dpkg-source packt alle Änderungen zum Upsteam-Tarball in
      ``debian/patches/debian-changes``

* Alternative Tools: git-dpm, TopGit, TNT

---

# Bestehende Historie importieren

    gbp import-dscs --debsnap python-libvirt
    gbp import-dscs path/to/*.dsc

---

# Debugging

* alle Log-Meldungen von gbp beginnen mit 'gbp:'
* --[git]-verbose
* gbp config im Repository ausführen
* gbp <command> --help

---

# Weitere Tools

* gitpkg
* git-dpm
* dgit

![Popcon VC build tools](popcon-vc-build-tools.png)

---

# Fragen? Kommentare?


* Website: [https://honk.sigxcpu.org/piki/projects/git-buildpackage/]()
* Manual: [http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html]()
* Mailing Liste: [http://lists.sigxcpu.org/mailman/listinfo/git-buildpackage]()
* [https://wiki.debian.org/GitPackagingWorkflow]()
* [https://wiki.debian.org/GitPackaging]()
* [https://wiki.debian.org/git-pbuilder]()