Debian Codegraph @

upstream/debian-trixie/man8/makepkg.8

raw
1 '\" t
2 .\" Title: makepkg
3 .\" Author: [see the "Authors" section]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\" Date: 2025-01-20
6 .\" Manual: Pacman Manual
7 .\" Source: Pacman 7.0.0
8 .\" Language: English
9 .\"
10 .TH "MAKEPKG" "8" "2025\-01\-20" "Pacman 7\&.0\&.0" "Pacman Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 makepkg \- package build utility
32 .SH "SYNOPSIS"
33 .sp
34 \fImakepkg\fR [options] [ENVVAR=value] [ENVVAR+=value] \&...
35 .SH "DESCRIPTION"
36 .sp
37 \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\&.
38 .sp
39 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\&.
40 .if n \{\
41 .sp
42 .\}
43 .RS 4
44 .it 1 an-trap
45 .nr an-no-space-flag 1
46 .nr an-break-flag 1
47 .br
48 .ps +1
49 \fBNote\fR
50 .ps -1
51 .br
52 .sp
53 \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\&.
54 .sp .5v
55 .RE
56 .SH "OPTIONS"
57 .PP
58 \fB\-A, \-\-ignorearch\fR
59 .RS 4
60 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
61 arch=(\*(Aqyourarch\*(Aq)
62 field\&.
63 .RE
64 .PP
65 \fB\-c, \-\-clean\fR
66 .RS 4
67 Clean up leftover work files and directories after a successful build\&.
68 .RE
69 .PP
70 \fB\-\-config\fR <file>
71 .RS 4
72 Use an alternate configuration file instead of the
73 /etc/makepkg\&.conf
74 default\&.
75 .RE
76 .PP
77 \fB\-d, \-\-nodeps\fR
78 .RS 4
79 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\&.
80 .RE
81 .PP
82 \fB\-e, \-\-noextract\fR
83 .RS 4
84 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\&.
85 .RE
86 .PP
87 \fB\-\-verifysource\fR
88 .RS 4
89 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
90 \-\-syncdeps
91 is used\&. Useful for performing subsequent offline builds\&.
92 .RE
93 .PP
94 \fB\-f, \-\-force\fR
95 .RS 4
96 makepkg will not build a package if a built package already exists in the
97 PKGDEST
98 (set in
99 \fBmakepkg.conf\fR(5)) directory, which may default to the current directory\&. This allows the built package to be overwritten\&.
100 .RE
101 .PP
102 \fB\-g, \-\-geninteg\fR
103 .RS 4
104 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"\&.
105 .RE
106 .PP
107 \fB\-\-skipinteg\fR
108 .RS 4
109 Do not perform any integrity checks (checksum and PGP) on source files\&.
110 .RE
111 .PP
112 \fB\-\-skipchecksums\fR
113 .RS 4
114 Do not verify checksums of source files\&.
115 .RE
116 .PP
117 \fB\-\-skippgpcheck\fR
118 .RS 4
119 Do not verify PGP signatures of source files\&.
120 .RE
121 .PP
122 \fB\-h, \-\-help\fR
123 .RS 4
124 Output syntax and command line options\&.
125 .RE
126 .PP
127 \fB\-\-holdver\fR
128 .RS 4
129 When using VCS sources (\fBPKGBUILD\fR(5)) any currently checked out source will not be updated to the latest revision\&.
130 .RE
131 .PP
132 \fB\-i, \-\-install\fR
133 .RS 4
134 Install or upgrade the package after a successful build using
135 \fBpacman\fR(8)\&.
136 .RE
137 .PP
138 \fB\-L, \-\-log\fR
139 .RS 4
140 Enable logging\&. This will use the
141 \fBtee\fR
142 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
143 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\&.
144 .RE
145 .PP
146 \fB\-m, \-\-nocolor\fR
147 .RS 4
148 Disable color in output messages\&.
149 .RE
150 .PP
151 \fB\-o, \-\-nobuild\fR
152 .RS 4
153 Download and extract files, run the prepare() function, but do not build them\&. Useful with the
154 \fI\-\-noextract\fR
155 option if you wish to tweak the files in $srcdir/ before building\&.
156 .RE
157 .PP
158 \fB\-p\fR <buildscript>
159 .RS 4
160 Read the package script
161 buildscript
162 instead of the
163 PKGBUILD
164 default; see
165 \fBPKGBUILD\fR(5)\&. The
166 buildscript
167 must be located in the directory makepkg is called from\&.
168 .RE
169 .PP
170 \fB\-r, \-\-rmdeps\fR
171 .RS 4
172 Upon successful build, remove any dependencies installed by makepkg during dependency auto\-resolution and installation when using
173 \-s\&.
174 .RE
175 .PP
176 \fB\-R, \-\-repackage\fR
177 .RS 4
178 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\&.
179 .RE
180 .PP
181 \fB\-s, \-\-syncdeps\fR
182 .RS 4
183 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\&.
184 .RE
185 .PP
186 \fB\-S, \-\-source\fR
187 .RS 4
188 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\&.
189 .RE
190 .PP
191 \fB\-V, \-\-version\fR
192 .RS 4
193 Display version information\&.
194 .RE
195 .PP
196 \fB\-C, \-\-cleanbuild\fR
197 .RS 4
198 Clean build artifacts from previous runs of makepkg in the current directory by removing $srcdir before building the package\&.
199 .RE
200 .PP
201 \fB\-D\fR <dir>, \fB\-\-dir\fR <dir>
202 .RS 4
203 Change to directory <dir> before reading the PKGBUILD or doing anything else\&.
204 .RE
205 .PP
206 \fB\-\-allsource\fR
207 .RS 4
208 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\&.
209 .RE
210 .PP
211 \fB\-\-check\fR
212 .RS 4
213 Run the check() function in the PKGBUILD, overriding the setting in
214 \fBmakepkg.conf\fR(5)\&.
215 .RE
216 .PP
217 \fB\-\-noarchive\fR
218 .RS 4
219 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\&.
220 .RE
221 .PP
222 \fB\-\-nocheck\fR
223 .RS 4
224 Do not run the check() function in the PKGBUILD or handle the checkdepends\&.
225 .RE
226 .PP
227 \fB\-\-noprepare\fR
228 .RS 4
229 Do not run the prepare() function in the PKGBUILD\&.
230 .RE
231 .PP
232 \fB\-\-noverify\fR
233 .RS 4
234 Do not run the verify() function in the PKGBUILD\&.
235 .RE
236 .PP
237 \fB\-\-sign\fR
238 .RS 4
239 Sign the resulting package with gpg, overriding the setting in
240 \fBmakepkg.conf\fR(5)\&.
241 .RE
242 .PP
243 \fB\-\-nosign\fR
244 .RS 4
245 Do not create a signature for the built package\&.
246 .RE
247 .PP
248 \fB\-\-key\fR <key>
249 .RS 4
250 Specify a key to use when signing packages, overriding the GPGKEY setting in
251 \fBmakepkg.conf\fR(5)\&. If not specified in either location, the default key from the keyring will be used\&.
252 .RE
253 .PP
254 \fB\-\-noconfirm\fR
255 .RS 4
256 (Passed to pacman) Prevent pacman from waiting for user input before proceeding with operations\&.
257 .RE
258 .PP
259 \fB\-\-needed\fR
260 .RS 4
261 (Passed to pacman) Tell pacman not to reinstall a target if it is already up\-to\-date\&. (used with
262 \fI\-i\fR
263 /
264 \fI\-\-install\fR)\&.
265 .RE
266 .PP
267 \fB\-\-asdeps\fR
268 .RS 4
269 (Passed to pacman) Install packages as non\-explicitly installed (used with
270 \fI\-i\fR
271 /
272 \fI\-\-install\fR)\&.
273 .RE
274 .PP
275 \fB\-\-noprogressbar\fR
276 .RS 4
277 (Passed to pacman) Prevent pacman from displaying a progress bar; useful if you are redirecting makepkg output to file\&.
278 .RE
279 .PP
280 \fB\-\-packagelist\fR
281 .RS 4
282 List the package filenames that would be produced without building\&. Listed package filenames include PKGDEST and PKGEXT\&.
283 .RE
284 .PP
285 \fB\-\-printsrcinfo\fR
286 .RS 4
287 Generate and print the SRCINFO file to stdout\&.
288 .RE
289 .SH "ADDITIONAL FEATURES"
290 .sp
291 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\&.
292 .SH "REPRODUCIBILITY"
293 .sp
294 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\&.
295 .sp
296 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\&.
297 .SH "ENVIRONMENT VARIABLES"
298 .PP
299 \fBMAKEPKG_LIBRARY\fR="/path/to/directory"
300 .RS 4
301 Use an alternative libmakepkg path instead of the /usr/share/makepkg default\&.
302 .RE
303 .PP
304 \fBPACMAN\fR
305 .RS 4
306 The command that will be used to check for missing dependencies and to install and remove packages\&. Pacman\(cqs
307 \fI\-Qq\fR,
308 \fI\-Rns\fR,
309 \fI\-S\fR,
310 \fI\-T\fR, and
311 \fI\-U\fR
312 operations must be supported by this command\&. If the variable is not set or empty, makepkg will fall back to \(oqpacman\(cq\&.
313 .RE
314 .PP
315 \fBMAKEPKG_CONF=\fR"/path/to/file"
316 .RS 4
317 Use an alternate config file instead of the
318 /etc/makepkg\&.conf
319 default\&.
320 .RE
321 .PP
322 \fBPKGDEST=\fR"/path/to/directory"
323 .RS 4
324 Directory where the resulting packages will be stored\&. Overrides the corresponding value defined in
325 \fBmakepkg.conf\fR(5)\&.
326 .RE
327 .PP
328 \fBSRCDEST=\fR"/path/to/directory"
329 .RS 4
330 Directory where the downloaded sources will be stored\&. Overrides the corresponding value defined in
331 \fBmakepkg.conf\fR(5)\&.
332 .RE
333 .PP
334 \fBSRCPKGDEST=\fR"/path/to/directory"
335 .RS 4
336 Directory where source package files will be stored\&. Overrides the corresponding value defined in
337 \fBmakepkg.conf\fR(5)\&.
338 .RE
339 .PP
340 \fBLOGDEST=\fR"/path/to/directory"
341 .RS 4
342 Directory where generated log files will be stored\&. Overrides the corresponding value defined in
343 \fBmakepkg.conf\fR(5)\&.
344 .RE
345 .PP
346 \fBPACKAGER=\fR"John Doe <john@doe\&.com>"
347 .RS 4
348 String to identify the creator of the resulting package\&. Overrides the corresponding value defined in
349 \fBmakepkg.conf\fR(5)\&.
350 .RE
351 .PP
352 \fBBUILDDIR=\fR"/path/to/directory"
353 .RS 4
354 Directory where the package will be built\&. Overrides the corresponding value defined in
355 \fBmakepkg.conf\fR(5)\&.
356 .RE
357 .PP
358 \fBCARCH=\fR"(i686|x86_64)"
359 .RS 4
360 Force build for a specific architecture\&. Useful for cross\-compiling\&. Overrides the corresponding value defined in
361 \fBmakepkg.conf\fR(5)\&.
362 .RE
363 .PP
364 \fBPKGEXT=\fR"\&.pkg\&.tar\&.gz", \fBSRCEXT=\fR"\&.src\&.tar\&.gz"
365 .RS 4
366 Sets the compression used when making compiled or source packages\&. Overrides the corresponding value defined in
367 \fBmakepkg.conf\fR(5)\&.
368 .RE
369 .PP
370 \fBGNUPGHOME=\fR"/path/to/directory"
371 .RS 4
372 Directory where the gpg keyring for signing the built package is stored\&.
373 .RE
374 .PP
375 \fBGPGKEY=\fR"keyid"
376 .RS 4
377 Specify a key to use when signing packages, overriding the GPGKEY setting in
378 \fBmakepkg.conf\fR(5)\&.
379 .RE
380 .PP
381 \fBSOURCE_DATE_EPOCH=\fR"<date>"
382 .RS 4
383 Used for
384 Reproducible Builds\&.
385 .RE
386 .PP
387 \fBBUILDTOOL=\fR"<name>"
388 .RS 4
389 The name of a tool ecosystem used to set up the build environment\&. Used for defining a spec for reproducible builds, e\&.g\&. the
390 \fBmakepkg.conf\fR(5)
391 used\&.
392 .RE
393 .PP
394 \fBBUILDTOOLVER=\fR"<version>"
395 .RS 4
396 The version of the
397 \fI$BUILDTOOL\fR
398 used\&.
399 .RE
400 .sp
401 \fBMAKEPKG_LINT_PKGBUILD=\fR0 Setting to 0 disables PKGBUILD linting within makepkg\&. Useful on systems with slow bash subshell operations, or on PKGBUILDs with extreme amounts of package splitting\&.
402 .SH "CONFIGURATION"
403 .sp
404 See \fBmakepkg.conf\fR(5) for more details on configuring makepkg using the \fImakepkg\&.conf\fR file\&.
405 .SH "ERRORS"
406 .sp
407 On exit, makepkg will return one of the following error codes\&.
408 .PP
409 0
410 .RS 4
411 Normal exit condition\&.
412 .RE
413 .PP
414 1
415 .RS 4
416 Unknown cause of failure\&.
417 .RE
418 .PP
419 2
420 .RS 4
421 Error in configuration file\&.
422 .RE
423 .PP
424 3
425 .RS 4
426 User specified an invalid option\&.
427 .RE
428 .PP
429 4
430 .RS 4
431 Error in user\-supplied function in PKGBUILD\&.
432 .RE
433 .PP
434 5
435 .RS 4
436 Failed to create a viable package\&.
437 .RE
438 .PP
439 6
440 .RS 4
441 A source or auxiliary file specified in the PKGBUILD is missing\&.
442 .RE
443 .PP
444 7
445 .RS 4
446 The PKGDIR is missing\&.
447 .RE
448 .PP
449 8
450 .RS 4
451 Failed to install dependencies\&.
452 .RE
453 .PP
454 9
455 .RS 4
456 Failed to remove dependencies\&.
457 .RE
458 .PP
459 10
460 .RS 4
461 User attempted to run makepkg as root\&.
462 .RE
463 .PP
464 11
465 .RS 4
466 User lacks permissions to build or install to a given location\&.
467 .RE
468 .PP
469 12
470 .RS 4
471 Error parsing PKGBUILD\&.
472 .RE
473 .PP
474 13
475 .RS 4
476 A package has already been built\&.
477 .RE
478 .PP
479 14
480 .RS 4
481 The package failed to install\&.
482 .RE
483 .PP
484 15
485 .RS 4
486 Programs necessary to run makepkg are missing\&.
487 .RE
488 .PP
489 16
490 .RS 4
491 Specified GPG key does not exist or failed to sign package\&.
492 .RE
493 .PP
494 17
495 .RS 4
496 The local repository is not a clone of the source repository specified in PKGBUILD\&.
497 .RE
498 .SH "SEE ALSO"
499 .sp
500 \fBmakepkg.conf\fR(5), \fBPKGBUILD\fR(5), \fBpacman\fR(8)
501 .sp
502 See the pacman website at https://archlinux\&.org/pacman/ for current information on pacman and its related tools\&.
503 .SH "BUGS"
504 .sp
505 Bugs? You must be kidding; there are no bugs in this software\&. But if we happen to be wrong, please report them to the issue tracker at https://gitlab\&.archlinux\&.org/pacman/pacman/\-/issues with specific information such as your command\-line, the nature of the bug, and even the package database if it helps\&.
506 .SH "AUTHORS"
507 .sp
508 Current maintainers:
509 .sp
510 .RS 4
511 .ie n \{\
512 \h'-04'\(bu\h'+03'\c
513 .\}
514 .el \{\
515 .sp -1
516 .IP \(bu 2.3
517 .\}
518 Allan McRae <allan@archlinux\&.org>
519 .RE
520 .sp
521 .RS 4
522 .ie n \{\
523 \h'-04'\(bu\h'+03'\c
524 .\}
525 .el \{\
526 .sp -1
527 .IP \(bu 2.3
528 .\}
529 Andrew Gregory <andrew\&.gregory\&.8@gmail\&.com>
530 .RE
531 .sp
532 .RS 4
533 .ie n \{\
534 \h'-04'\(bu\h'+03'\c
535 .\}
536 .el \{\
537 .sp -1
538 .IP \(bu 2.3
539 .\}
540 Morgan Adamiec <morganamilo@archlinux\&.org>
541 .RE
542 .sp
543 Past major contributors:
544 .sp
545 .RS 4
546 .ie n \{\
547 \h'-04'\(bu\h'+03'\c
548 .\}
549 .el \{\
550 .sp -1
551 .IP \(bu 2.3
552 .\}
553 Judd Vinet <jvinet@zeroflux\&.org>
554 .RE
555 .sp
556 .RS 4
557 .ie n \{\
558 \h'-04'\(bu\h'+03'\c
559 .\}
560 .el \{\
561 .sp -1
562 .IP \(bu 2.3
563 .\}
564 Aurelien Foret <aurelien@archlinux\&.org>
565 .RE
566 .sp
567 .RS 4
568 .ie n \{\
569 \h'-04'\(bu\h'+03'\c
570 .\}
571 .el \{\
572 .sp -1
573 .IP \(bu 2.3
574 .\}
575 Aaron Griffin <aaron@archlinux\&.org>
576 .RE
577 .sp
578 .RS 4
579 .ie n \{\
580 \h'-04'\(bu\h'+03'\c
581 .\}
582 .el \{\
583 .sp -1
584 .IP \(bu 2.3
585 .\}
586 Dan McGee <dan@archlinux\&.org>
587 .RE
588 .sp
589 .RS 4
590 .ie n \{\
591 \h'-04'\(bu\h'+03'\c
592 .\}
593 .el \{\
594 .sp -1
595 .IP \(bu 2.3
596 .\}
597 Xavier Chantry <shiningxc@gmail\&.com>
598 .RE
599 .sp
600 .RS 4
601 .ie n \{\
602 \h'-04'\(bu\h'+03'\c
603 .\}
604 .el \{\
605 .sp -1
606 .IP \(bu 2.3
607 .\}
608 Nagy Gabor <ngaba@bibl\&.u\-szeged\&.hu>
609 .RE
610 .sp
611 .RS 4
612 .ie n \{\
613 \h'-04'\(bu\h'+03'\c
614 .\}
615 .el \{\
616 .sp -1
617 .IP \(bu 2.3
618 .\}
619 Dave Reisner <dreisner@archlinux\&.org>
620 .RE
621 .sp
622 .RS 4
623 .ie n \{\
624 \h'-04'\(bu\h'+03'\c
625 .\}
626 .el \{\
627 .sp -1
628 .IP \(bu 2.3
629 .\}
630 Eli Schwartz <eschwartz@archlinux\&.org>
631 .RE
632 .sp
633 For additional contributors, use git shortlog \-s on the pacman\&.git repository\&.