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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
|
'\" t
.\" Title: makepkg
.\" Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\" Date: 2024-03-09
.\" Manual: Pacman Manual
.\" Source: Pacman 6.1.0
.\" Language: English
.\"
.TH "MAKEPKG" "8" "2024\-03\-09" "Pacman 6\&.1\&.0" "Pacman Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
makepkg \- package build utility
.SH "SYNOPSIS"
.sp
\fImakepkg\fR [options] [ENVVAR=value] [ENVVAR+=value] \&...
.SH "DESCRIPTION"
.sp
\fImakepkg\fR is a script to automate the building of packages\&. The requirements for using the script are a build\-capable *nix platform and a custom build script for each package you wish to build (known as a PKGBUILD)\&. See \fBPKGBUILD\fR(5) for details on creating your own build scripts\&.
.sp
The advantage to a script\-based build is that the work is only done once\&. Once you have the build script for a package, \fImakepkg\fR will do the rest: download and validate source files, check dependencies, configure the build\-time settings, build the package, install the package into a temporary root, make customizations, generate meta\-info, and package the whole thing up for pacman to use\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
\fImakepkg\fR uses your current locale by default and does not unset it when building packages\&. If you wish to share your build output with others when seeking help or for other purposes, you may wish to run "LC_ALL=C makepkg" so your logs and output are not localized\&.
.sp .5v
.RE
.SH "OPTIONS"
.PP
\fB\-A, \-\-ignorearch\fR
.RS 4
Ignore a missing or incomplete arch field in the build script\&. This is for rebuilding packages from source when the PKGBUILD may be slightly outdated and not updated with an
arch=(\*(Aqyourarch\*(Aq)
field\&.
.RE
.PP
\fB\-c, \-\-clean\fR
.RS 4
Clean up leftover work files and directories after a successful build\&.
.RE
.PP
\fB\-\-config\fR <file>
.RS 4
Use an alternate configuration file instead of the
/etc/makepkg\&.conf
default\&.
.RE
.PP
\fB\-d, \-\-nodeps\fR
.RS 4
Do not perform any dependency checks\&. This will let you override and ignore any dependencies required\&. There is a good chance this option will break the build process if all of the dependencies are not installed\&.
.RE
.PP
\fB\-e, \-\-noextract\fR
.RS 4
Do not extract source files or run the prepare() function (if present); use whatever source already exists in the $srcdir/ directory\&. This is handy if you want to go into $srcdir/ and manually patch or tweak code, then make a package out of the result\&. Keep in mind that creating a patch may be a better solution to allow others to use your PKGBUILD\&.
.RE
.PP
\fB\-\-verifysource\fR
.RS 4
For each source file in the source array of PKGBUILD, download the file if required and perform the integrity checks\&. No extraction or build is performed\&. Dependencies specified in the PKGBUILD will not be handled unless
\-\-syncdeps
is used\&. Useful for performing subsequent offline builds\&.
.RE
.PP
\fB\-f, \-\-force\fR
.RS 4
makepkg will not build a package if a built package already exists in the
PKGDEST
(set in
\fBmakepkg.conf\fR(5)) directory, which may default to the current directory\&. This allows the built package to be overwritten\&.
.RE
.PP
\fB\-g, \-\-geninteg\fR
.RS 4
For each source file in the source array of PKGBUILD, download the file if required and generate integrity checks\&. The integrity checks generated are determined by the checks present in the PKGBUILD, falling back to the value of the INTEGRITY_CHECK array in makepkg\&.conf(5) if these are absent\&. This output can be redirected into your PKGBUILD for source validation using "makepkg \-g >> PKGBUILD"\&.
.RE
.PP
\fB\-\-skipinteg\fR
.RS 4
Do not perform any integrity checks (checksum and PGP) on source files\&.
.RE
.PP
\fB\-\-skipchecksums\fR
.RS 4
Do not verify checksums of source files\&.
.RE
.PP
\fB\-\-skippgpcheck\fR
.RS 4
Do not verify PGP signatures of source files\&.
.RE
.PP
\fB\-h, \-\-help\fR
.RS 4
Output syntax and command line options\&.
.RE
.PP
\fB\-\-holdver\fR
.RS 4
When using VCS sources (\fBPKGBUILD\fR(5)) any currently checked out source will not be updated to the latest revision\&.
.RE
.PP
\fB\-i, \-\-install\fR
.RS 4
Install or upgrade the package after a successful build using
\fBpacman\fR(8)\&.
.RE
.PP
\fB\-L, \-\-log\fR
.RS 4
Enable logging\&. This will use the
\fBtee\fR
program to send the output of each of the PKGBUILD functions to both the console and to a text file in the build directory named
pkgbase\-pkgver\-pkgrel\-arch\-<function>\&.log\&. As mentioned above, the logs will be localized so you may want to set your locale accordingly if sharing the log output with others\&.
.RE
.PP
\fB\-m, \-\-nocolor\fR
.RS 4
Disable color in output messages\&.
.RE
.PP
\fB\-o, \-\-nobuild\fR
.RS 4
Download and extract files, run the prepare() function, but do not build them\&. Useful with the
\fI\-\-noextract\fR
option if you wish to tweak the files in $srcdir/ before building\&.
.RE
.PP
\fB\-p\fR <buildscript>
.RS 4
Read the package script
buildscript
instead of the
PKGBUILD
default; see
\fBPKGBUILD\fR(5)\&. The
buildscript
must be located in the directory makepkg is called from\&.
.RE
.PP
\fB\-r, \-\-rmdeps\fR
.RS 4
Upon successful build, remove any dependencies installed by makepkg during dependency auto\-resolution and installation when using
\-s\&.
.RE
.PP
\fB\-R, \-\-repackage\fR
.RS 4
Repackage contents of the package without rebuilding the package\&. This is useful if you forgot, for example, a dependency or install file in your PKGBUILD and the build itself will not change\&.
.RE
.PP
\fB\-s, \-\-syncdeps\fR
.RS 4
Install missing dependencies using pacman\&. When build\-time or run\-time dependencies are not found, pacman will try to resolve them\&. If successful, the missing packages will be downloaded and installed\&.
.RE
.PP
\fB\-S, \-\-source\fR
.RS 4
Do not actually build the package, but build a source\-only tarball that does not include sources that can be fetched via a download URL\&. This is useful for passing a single tarball to another program such as a chroot, remote builder, or a tarball upload\&. Because integrity checks are verified, all source files of the package need to be present or downloadable\&.
.RE
.PP
\fB\-V, \-\-version\fR
.RS 4
Display version information\&.
.RE
.PP
\fB\-C, \-\-cleanbuild\fR
.RS 4
Remove the $srcdir before building the package\&.
.RE
.PP
\fB\-D\fR <dir>, \fB\-\-dir\fR <dir>
.RS 4
Change to directory <dir> before reading the PKGBUILD or doing anything else\&.
.RE
.PP
\fB\-\-allsource\fR
.RS 4
Do not actually build the package, but build a source\-only tarball that includes all sources, including those that are normally downloaded via makepkg\&. This is useful for passing a single tarball to another program such as a chroot or remote builder\&. It will also satisfy requirements of the GPL when distributing binary packages\&.
.RE
.PP
\fB\-\-check\fR
.RS 4
Run the check() function in the PKGBUILD, overriding the setting in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fB\-\-noarchive\fR
.RS 4
Do not create the archive at the end of the build process\&. This can be useful to test the package() function or if your target distribution does not use pacman\&.
.RE
.PP
\fB\-\-nocheck\fR
.RS 4
Do not run the check() function in the PKGBUILD or handle the checkdepends\&.
.RE
.PP
\fB\-\-noprepare\fR
.RS 4
Do not run the prepare() function in the PKGBUILD\&.
.RE
.PP
\fB\-\-noverify\fR
.RS 4
Do not run the verify() function in the PKGBUILD\&.
.RE
.PP
\fB\-\-sign\fR
.RS 4
Sign the resulting package with gpg, overriding the setting in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fB\-\-nosign\fR
.RS 4
Do not create a signature for the built package\&.
.RE
.PP
\fB\-\-key\fR <key>
.RS 4
Specify a key to use when signing packages, overriding the GPGKEY setting in
\fBmakepkg.conf\fR(5)\&. If not specified in either location, the default key from the keyring will be used\&.
.RE
.PP
\fB\-\-noconfirm\fR
.RS 4
(Passed to pacman) Prevent pacman from waiting for user input before proceeding with operations\&.
.RE
.PP
\fB\-\-needed\fR
.RS 4
(Passed to pacman) Tell pacman not to reinstall a target if it is already up\-to\-date\&. (used with
\fI\-i\fR
/
\fI\-\-install\fR)\&.
.RE
.PP
\fB\-\-asdeps\fR
.RS 4
(Passed to pacman) Install packages as non\-explicitly installed (used with
\fI\-i\fR
/
\fI\-\-install\fR)\&.
.RE
.PP
\fB\-\-noprogressbar\fR
.RS 4
(Passed to pacman) Prevent pacman from displaying a progress bar; useful if you are redirecting makepkg output to file\&.
.RE
.PP
\fB\-\-packagelist\fR
.RS 4
List the package filenames that would be produced without building\&. Listed package filenames include PKGDEST and PKGEXT\&.
.RE
.PP
\fB\-\-printsrcinfo\fR
.RS 4
Generate and print the SRCINFO file to stdout\&.
.RE
.SH "ADDITIONAL FEATURES"
.sp
makepkg supports building development versions of packages without having to manually update the pkgver in the PKGBUILD\&. This was formerly done using the separate utility \fIversionpkg\fR\&. See \fBPKGBUILD\fR(5) for details on how to set up a development PKGBUILD\&.
.SH "REPRODUCIBILITY"
.sp
makepkg is designed to be compatible with Reproducible Builds\&. If the \fBSOURCE_DATE_EPOCH\fR environment variable is set, it will be exported to subprocesses, and source and package file modification times and package metadata will be unified based on the timestamp specified\&.
.sp
If the \fBSOURCE_DATE_EPOCH\fR environment variable is not set, makepkg will use its own start date for internal use, but will not unify source file timestamps before building\&.
.SH "ENVIRONMENT VARIABLES"
.PP
\fBMAKEPKG_LIBRARY\fR="/path/to/directory"
.RS 4
Use an alternative libmakepkg path instead of the /usr/share/makepkg default\&.
.RE
.PP
\fBPACMAN\fR
.RS 4
The command that will be used to check for missing dependencies and to install and remove packages\&. Pacman\(cqs
\fI\-Qq\fR,
\fI\-Rns\fR,
\fI\-S\fR,
\fI\-T\fR, and
\fI\-U\fR
operations must be supported by this command\&. If the variable is not set or empty, makepkg will fall back to \(oqpacman\(cq\&.
.RE
.PP
\fBMAKEPKG_CONF=\fR"/path/to/file"
.RS 4
Use an alternate config file instead of the
/etc/makepkg\&.conf
default\&.
.RE
.PP
\fBPKGDEST=\fR"/path/to/directory"
.RS 4
Directory where the resulting packages will be stored\&. Overrides the corresponding value defined in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fBSRCDEST=\fR"/path/to/directory"
.RS 4
Directory where the downloaded sources will be stored\&. Overrides the corresponding value defined in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fBSRCPKGDEST=\fR"/path/to/directory"
.RS 4
Directory where source package files will be stored\&. Overrides the corresponding value defined in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fBLOGDEST=\fR"/path/to/directory"
.RS 4
Directory where generated log files will be stored\&. Overrides the corresponding value defined in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fBPACKAGER=\fR"John Doe <john@doe\&.com>"
.RS 4
String to identify the creator of the resulting package\&. Overrides the corresponding value defined in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fBBUILDDIR=\fR"/path/to/directory"
.RS 4
Directory where the package will be built\&. Overrides the corresponding value defined in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fBCARCH=\fR"(i686|x86_64)"
.RS 4
Force build for a specific architecture\&. Useful for cross\-compiling\&. Overrides the corresponding value defined in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fBPKGEXT=\fR"\&.pkg\&.tar\&.gz", \fBSRCEXT=\fR"\&.src\&.tar\&.gz"
.RS 4
Sets the compression used when making compiled or source packages\&. Overrides the corresponding value defined in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fBGNUPGHOME=\fR"/path/to/directory"
.RS 4
Directory where the gpg keyring for signing the built package is stored\&.
.RE
.PP
\fBGPGKEY=\fR"keyid"
.RS 4
Specify a key to use when signing packages, overriding the GPGKEY setting in
\fBmakepkg.conf\fR(5)\&.
.RE
.PP
\fBSOURCE_DATE_EPOCH=\fR"<date>"
.RS 4
Used for
Reproducible Builds\&.
.RE
.PP
\fBBUILDTOOL=\fR"<name>"
.RS 4
The name of a tool ecosystem used to set up the build environment\&. Used for defining a spec for reproducible builds, e\&.g\&. the
\fBmakepkg.conf\fR(5)
used\&.
.RE
.PP
\fBBUILDTOOLVER=\fR"<version>"
.RS 4
The version of the
\fI$BUILDTOOL\fR
used\&.
.RE
.PP
\fBGITFLAGS\fR
.RS 4
The options to pass when checking out git sources, replacing the default "\-\-mirror"\&.
.RE
.SH "CONFIGURATION"
.sp
See \fBmakepkg.conf\fR(5) for more details on configuring makepkg using the \fImakepkg\&.conf\fR file\&.
.SH "ERRORS"
.sp
On exit, makepkg will return one of the following error codes\&.
.PP
0
.RS 4
Normal exit condition\&.
.RE
.PP
1
.RS 4
Unknown cause of failure\&.
.RE
.PP
2
.RS 4
Error in configuration file\&.
.RE
.PP
3
.RS 4
User specified an invalid option\&.
.RE
.PP
4
.RS 4
Error in user\-supplied function in PKGBUILD\&.
.RE
.PP
5
.RS 4
Failed to create a viable package\&.
.RE
.PP
6
.RS 4
A source or auxiliary file specified in the PKGBUILD is missing\&.
.RE
.PP
7
.RS 4
The PKGDIR is missing\&.
.RE
.PP
8
.RS 4
Failed to install dependencies\&.
.RE
.PP
9
.RS 4
Failed to remove dependencies\&.
.RE
.PP
10
.RS 4
User attempted to run makepkg as root\&.
.RE
.PP
11
.RS 4
User lacks permissions to build or install to a given location\&.
.RE
.PP
12
.RS 4
Error parsing PKGBUILD\&.
.RE
.PP
13
.RS 4
A package has already been built\&.
.RE
.PP
14
.RS 4
The package failed to install\&.
.RE
.PP
15
.RS 4
Programs necessary to run makepkg are missing\&.
.RE
.PP
16
.RS 4
Specified GPG key does not exist or failed to sign package\&.
.RE
.SH "SEE ALSO"
.sp
\fBmakepkg.conf\fR(5), \fBPKGBUILD\fR(5), \fBpacman\fR(8)
.sp
See the pacman website at https://archlinux\&.org/pacman/ for current information on pacman and its related tools\&.
.SH "BUGS"
.sp
Bugs? You must be kidding; there are no bugs in this software\&. But if we happen to be wrong, submit a bug report with as much detail as possible at the Arch Linux Bug Tracker in the Pacman section\&.
.SH "AUTHORS"
.sp
Current maintainers:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Allan McRae <allan@archlinux\&.org>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Andrew Gregory <andrew\&.gregory\&.8@gmail\&.com>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Morgan Adamiec <morganamilo@archlinux\&.org>
.RE
.sp
Past major contributors:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Judd Vinet <jvinet@zeroflux\&.org>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Aurelien Foret <aurelien@archlinux\&.org>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Aaron Griffin <aaron@archlinux\&.org>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Dan McGee <dan@archlinux\&.org>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Xavier Chantry <shiningxc@gmail\&.com>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Nagy Gabor <ngaba@bibl\&.u\-szeged\&.hu>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Dave Reisner <dreisner@archlinux\&.org>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Eli Schwartz <eschwartz@archlinux\&.org>
.RE
.sp
For additional contributors, use git shortlog \-s on the pacman\&.git repository\&.
|