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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
|
<refentry id="gbp.man.git.buildpackage">
<refentryinfo>
<address>
&dhemail;
</address>
<author>
&dhfirstname;
&dhsurname;
</author>
</refentryinfo>
<refmeta>
<refentrytitle>git-buildpackage</refentrytitle>
&dhsection;
</refmeta>
<refnamediv>
<refname>&git-buildpackage;</refname>
<refpurpose>Build Debian packages from a Git repository</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
&git-buildpackage;
<arg><option>--git-[no-]ignore-new</option></arg>
<arg><option>--git-tag</option></arg>
<arg><option>--git-verbose</option></arg>
<arg><option>--color=</option><replaceable>[auto|on|off]</replaceable></arg>
<arg><option>--notify=</option><replaceable>[auto|on|off]</replaceable></arg>
<arg><option>--git-upstream-branch=</option><replaceable>treeish</replaceable></arg>
<arg><option>--git-debian-branch=</option><replaceable>branch_name</replaceable></arg>
<arg><option>--git-ignore-branch</option></arg>
<arg><option>--git-builder=</option><replaceable>BUILD_CMD</replaceable></arg>
<arg><option>--git-cleaner=</option><replaceable>CLEAN_CMD</replaceable></arg>
<arg><option>--git-[no-]pbuilder</option></arg>
<arg><option>--git-[no-]qemubuilder</option></arg>
<arg><option>--git-dist=</option><replaceable>DIST</replaceable></arg>
<arg><option>--git-arch=</option><replaceable>ARCH</replaceable></arg>
<arg><option>--git-[no-]pbuilder-autoconf</option></arg>
<arg><option>--git-pbuilder-options</option></arg>
<arg><option>--git-[no-]sign-tags</option></arg>
<arg><option>--git-keyid=</option><replaceable>gpg-keyid</replaceable></arg>
<arg><option>--git-posttag=</option><replaceable>command</replaceable></arg>
<arg><option>--git-postbuild=</option><replaceable>command</replaceable></arg>
<arg><option>--git-postexport=</option><replaceable>command</replaceable></arg>
<arg><option>--git-prebuild=</option><replaceable>command</replaceable></arg>
<arg><option>--git-debian-tag=</option><replaceable>tag-format</replaceable></arg>
<arg><option>--git-upstream-tag=</option><replaceable>tag-format</replaceable></arg>
<arg><option>--git-force-create</option></arg>
<arg><option>--git-no-create-orig</option></arg>
<arg><option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|treeish]</replaceable></arg>
<arg><option>--git-tarball-dir=</option><replaceable>directory</replaceable></arg>
<arg><option>--git-compression=</option><replaceable>type</replaceable></arg>
<arg><option>--git-compression-level=</option><replaceable>level</replaceable></arg>
<arg><option>--git-export-dir=</option><replaceable>directory</replaceable></arg>
<arg><option>--git-export=</option><replaceable>treeish</replaceable></arg>
<arg><option>--git-[no-]pristine-tar</option></arg>
<arg><option>--git-dont-purge</option></arg>
<arg><option>--git-tag-only</option></arg>
<arg><option>--git-retag</option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>
&git-buildpackage; is used to build Debian source and .deb packages from a &git; repository.
</para>
<para>
&git-buildpackage; will, in order:
</para>
<itemizedlist>
<listitem><para>Verify that it is being executed from the
proper location.</para>
</listitem>
<listitem><para>Verify that the repository doesn't contain any
uncommitted source changes.</para>
</listitem>
<listitem><para>Verify that it is being executed from the
correct branch.</para>
</listitem>
<listitem><para>
(Optionally) export the source tree to a separate build area
</para></listitem>
<listitem><para>Build an orig tarball if it doesn't exist.</para>
</listitem>
<listitem><para>Call <application>debuild</application>(1)
(or the application specified via <option>--git-builder</option>)
with arguments instructing it to ignore &git; meta-data in
the diff.gz, passing along all arguments given to
&git-buildpackage; that don't start with --git-.
</para>
</listitem>
<listitem><para>
(Optionally) tag the tree after a successful build
</para></listitem>
<listitem><para>
(Optionally) call a post build hook - e.g. to run &lintian;
</para></listitem>
<listitem><para>
(Optionally) call a post tag hook - e.g. to push the results to a remote
repository after creating the tag
</para></listitem>
</itemizedlist>
</refsect1>
<refsect1>
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term><option>--git-[no-]ignore-new</option>
</term>
<listitem>
<para>Don't abort if there are uncommitted changes in the source tree
or the current branch doesn't match the
<replaceable>debian-branch</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-tag</option>
</term>
<listitem>
<para>Add a git tag after a successful build.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-builder=<replaceable>BUILD_CMD</replaceable></option></term>
<listitem>
<para>Use <replaceable>BUILD_CMD</replaceable> instead of <command>debuild -i -I</command></para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-cleaner=<replaceable>CLEAN_CMD</replaceable></option></term>
<listitem>
<para>Use <replaceable>CLEAN_CMD</replaceable> instead of <command>debuild clean</command></para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-pbuilder</option></term>
<listitem>
<para>Build package using <command>git-pbuilder</command>. Note that
this overwrites any <option>--git-builder</option> and
<option>--git-cleaner</option> options.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-qemubuilder</option></term>
<listitem>
<para>Build package using <command>git-pbuilder</command> with
<command>qemubuilder</command>. Note that this overwrites any
<option>--git-builder</option> and <option>--git-cleaner</option>
options.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-dist=<replaceable>DIST</replaceable></option></term>
<listitem>
<para>Build for distribution <replaceable>DIST</replaceable> when
using <command>--git-pbuilder</command>. If unset build for the
unstable distribution.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-arch=<replaceable>ARCH</replaceable></option></term>
<listitem>
<para>Build for architecture <replaceable>ARCH</replaceable> when
using <command>--git-pbuilder</command>. If unset no architecture is
passed to <command>git-pbuilder</command>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-pbuilder-autoconf</option></term>
<listitem>
<para>Whether to try to autoconfigure
<command>git-pbuilder</command> or to rely on the settings in
.pbuilderrc. See the <command>git-pbuilder</command>
manpage for details.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--git-pbuilder-options</option></term>
<listitem>
<para>Options to pass to pbuilder</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-verbose</option>
</term>
<listitem>
<para>verbose execution</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--color=</option><replaceable>[auto|on|off]</replaceable>
</term>
<listitem>
<para>Whether to use colored output.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--notify=</option><replaceable>[auto|on|off]</replaceable>
</term>
<listitem>
<para>Whether to send a desktop notification after the build.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-upstream-branch</option>=<replaceable>branch_name</replaceable>
</term>
<listitem>
<para>Branch to build the orig tarball from if <option>--git-upstream-tree</option>
is set to <replaceable>BRANCH</replaceable>. Default is
<replaceable>upstream</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-debian-branch</option>=<replaceable>branch_name</replaceable>
</term>
<listitem>
<para>If you're not on this branch when invoking &git-buildpackage;
it will fail. Default is <replaceable>master</replaceable>. This is
done to make sure you don't accidentally release from a topic branch.
Not being on this branch will be ignored when using
<option>--git-ignore-new</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-ignore-branch</option>
</term>
<listitem>
<para>Don't check if the current branch matches
<replaceable>debian-branch</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-[no-]sign-tags</option>
</term>
<listitem>
<para>GPG sign all created tags</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-keyid=</option><replaceable>gpg-keyid</replaceable>
</term>
<listitem>
<para>use this keyid for gpg signing tags</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-posttag=</option><replaceable>command</replaceable>
</term>
<listitem>
<para>excecute <replaceable>command</replaceable> after tagging a new
version.</para><para>Exported environment variables are:
<envar>GBP_TAG</envar> (the name of the generated tag),
<envar>GBP_BRANCH</envar> (the branch the package was build from) and
<envar>GBP_SHA1</envar> (the sha1 of the commit the tag was created
at).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-postbuild=</option><replaceable>command</replaceable>
</term>
<listitem>
<para>execute <replaceable>command</replaceable> after successful
build.</para><para> Exported environment variables are:
<envar>GBP_CHANGES_FILE</envar> (the name of the generated changes
file), <envar>GBP_BUILD_DIR</envar> (the build dir).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-postexport=</option><replaceable>command</replaceable>
</term>
<listitem>
<para>execute <replaceable>command</replaceable> after exporting the source
tree - valid only if --git-export-dir has been specified.</para>
<para> Exported environment variables are:
<envar>GBP_GIT_DIR</envar> (the repository the package is being built
from), <envar>GBP_TMP_DIR</envar> (the temporary directory where the
sources have been initially exported).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-prebuild=</option><replaceable>command</replaceable>
</term>
<listitem>
<para>execute <replaceable>command</replaceable> from the build
directory before calling <application>debuild</application>
or the application specified via <option>--git-builder</option>.</para>
<para>Exported environment variables are:
<envar>GBP_GIT_DIR</envar> (the repository the package is being built from),
<envar>GBP_BUILD_DIR</envar> (the build dir).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-debian-tag=</option><replaceable>tag-format</replaceable>
</term>
<listitem>
<para>use this tag format when tagging Debian versions,
default is <replaceable>debian/%(version)s</replaceable></para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-upstream-tag=</option><replaceable>tag-format</replaceable>
</term>
<listitem>
<para>use this tag format when looking for tags of upstream versions,
default is <replaceable>upstream/%(version)s</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-force-create</option>
</term>
<listitem>
<para>Force creation of an orig tarball (overwriting a pre-existing one if present)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-no-create-orig</option>
</term>
<listitem>
<para>Don't try to create any orig tarball</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-overlay</option>
</term>
<listitem>
<para>Extract orig tarball when using export-dir option (analog to mergeWithUpstream in svn-bp)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-export-dir=</option><replaceable>directory</replaceable>
</term>
<listitem>
<para>Export the current branch head (or the treeish object given via
<option>--git-export</option> to <replaceable>directory</replaceable>
before building.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-export=</option><replaceable>treeish</replaceable>
</term>
<listitem>
<para>Instead of exporting the current branch head, export the
treeish object <replaceable>treeish</replaceable>. The special name
<replaceable>INDEX</replaceable> exports the current index whereas
the special name <replaceable>WC</replaceable> exports the current working
copy as is.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-upstream-tree=</option><replaceable>[tag|branch]</replaceable>
</term>
<listitem>
<para>How to find the upstream sources used to generate the tarball.
<replaceable>TAG</replaceable> looks at a tag corresponding to the
version in the changelog. <replaceable>BRANCH</replaceable> looks at
the upstream branch given via the <option>--git-upstream-branch</option>
option. Other values are interpreted as treeishs.
</para><para>
This doesn't have any effect if <option>--git-pristine-tar</option>
is being used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-tarball-dir=</option><replaceable>directory</replaceable>
</term>
<listitem>
<para>Search for original tarballs in <replaceable>directory</replaceable> instead of generating them</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-compression=</option><replaceable>type</replaceable>
</term>
<listitem>
<para>Specifies the upstream tarball compression type. This will be
used to locate and build the upstream tarball if necessary. The
default is <replaceable>auto</replaceable> which derives the
compression type from the pristine-tar branch if available and falls
back to gzip otherwise. Other options are
<replaceable>gzip</replaceable>, <replaceable>bzip2</replaceable>,
<replaceable>lzma</replaceable> and <replaceable>xz</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-compression-level=</option><replaceable>level</replaceable>
</term>
<listitem>
<para>Specifies the upstream tarball compression level if an upstream tarball needs to be built.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-dont-purge</option>
</term>
<listitem>
<para>retain exported build directory after build</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-tag-only</option>
</term>
<listitem>
<para>don't build, only tag and run post-tag hooks</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--git-retag</option>
</term>
<listitem>
<para>don't fail tag operations if a tag with the same version
already exists</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
&man.git.config-files;
<para>All options in the config files are specified without the 'git-' prefix.</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>
<citerefentry>
<refentrytitle>git-import-dsc</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>git-import-dscs</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>git-import-orig</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>git-dch</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>git-pbuilder</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>gbp.conf</refentrytitle>
&dhconfsection;
</citerefentry>
&man.seealso.common;
</para>
</refsect1>
<refsect1>
<title>AUTHOR</title>
<para>&dhusername; &dhemail;</para>
</refsect1>
</refentry>
|