Debian Codegraph @

upstream/debian-unstable/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: 11-11-1111
6 .\" Manual: Pacman Manual
7 .\" Source: Pacman 7.1.0
8 .\" Language: English
9 .\"
10 .TH "MAKEPKG" "8" "11\-11\-1111" "Pacman 7\&.1\&.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 \fBMAKEPKG_GIT_CONFIG=\fR"/path/to/file"
323 .RS 4
324 Use an alternate config file for Git instead of the
325 /etc/makepkg\&.d/gitconfig
326 default\&. makepkg always prevents Git from loading any other config files\&.
327 .RE
328 .PP
329 \fBPKGDEST=\fR"/path/to/directory"
330 .RS 4
331 Directory where the resulting packages will be stored\&. Overrides the corresponding value defined in
332 \fBmakepkg.conf\fR(5)\&.
333 .RE
334 .PP
335 \fBSRCDEST=\fR"/path/to/directory"
336 .RS 4
337 Directory where the downloaded sources will be stored\&. Overrides the corresponding value defined in
338 \fBmakepkg.conf\fR(5)\&.
339 .RE
340 .PP
341 \fBSRCPKGDEST=\fR"/path/to/directory"
342 .RS 4
343 Directory where source package files will be stored\&. Overrides the corresponding value defined in
344 \fBmakepkg.conf\fR(5)\&.
345 .RE
346 .PP
347 \fBLOGDEST=\fR"/path/to/directory"
348 .RS 4
349 Directory where generated log files will be stored\&. Overrides the corresponding value defined in
350 \fBmakepkg.conf\fR(5)\&.
351 .RE
352 .PP
353 \fBPACKAGER=\fR"John Doe <john@doe\&.com>"
354 .RS 4
355 String to identify the creator of the resulting package\&. Overrides the corresponding value defined in
356 \fBmakepkg.conf\fR(5)\&.
357 .RE
358 .PP
359 \fBBUILDDIR=\fR"/path/to/directory"
360 .RS 4
361 Directory where the package will be built\&. Overrides the corresponding value defined in
362 \fBmakepkg.conf\fR(5)\&.
363 .RE
364 .PP
365 \fBCARCH=\fR"(i686|x86_64)"
366 .RS 4
367 Force build for a specific architecture\&. Useful for cross\-compiling\&. Overrides the corresponding value defined in
368 \fBmakepkg.conf\fR(5)\&.
369 .RE
370 .PP
371 \fBPKGEXT=\fR"\&.pkg\&.tar\&.gz", \fBSRCEXT=\fR"\&.src\&.tar\&.gz"
372 .RS 4
373 Sets the compression used when making compiled or source packages\&. Overrides the corresponding value defined in
374 \fBmakepkg.conf\fR(5)\&.
375 .RE
376 .PP
377 \fBGNUPGHOME=\fR"/path/to/directory"
378 .RS 4
379 Directory where the gpg keyring for signing the built package is stored\&.
380 .RE
381 .PP
382 \fBGPGKEY=\fR"keyid"
383 .RS 4
384 Specify a key to use when signing packages, overriding the GPGKEY setting in
385 \fBmakepkg.conf\fR(5)\&.
386 .RE
387 .PP
388 \fBSOURCE_DATE_EPOCH=\fR"<date>"
389 .RS 4
390 Used for
391 Reproducible Builds\&.
392 .RE
393 .PP
394 \fBBUILDTOOL=\fR"<name>"
395 .RS 4
396 The name of a tool ecosystem used to set up the build environment\&. Used for defining a spec for reproducible builds, e\&.g\&. the
397 \fBmakepkg.conf\fR(5)
398 used\&.
399 .RE
400 .PP
401 \fBBUILDTOOLVER=\fR"<version>"
402 .RS 4
403 The version of the
404 \fI$BUILDTOOL\fR
405 used\&.
406 .RE
407 .PP
408 \fBMAKEPKG_LINT_PKGBUILD=\fR0
409 .RS 4
410 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\&.
411 .RE
412 .SH "CONFIGURATION"
413 .sp
414 See \fBmakepkg.conf\fR(5) for more details on configuring makepkg using the \fImakepkg\&.conf\fR file\&.
415 .SH "ERRORS"
416 .sp
417 On exit, makepkg will return one of the following error codes\&.
418 .PP
419 0
420 .RS 4
421 Normal exit condition\&.
422 .RE
423 .PP
424 1
425 .RS 4
426 Unknown cause of failure\&.
427 .RE
428 .PP
429 2
430 .RS 4
431 Error in configuration file\&.
432 .RE
433 .PP
434 3
435 .RS 4
436 User specified an invalid option\&.
437 .RE
438 .PP
439 4
440 .RS 4
441 Error in user\-supplied function in PKGBUILD\&.
442 .RE
443 .PP
444 5
445 .RS 4
446 Failed to create a viable package\&.
447 .RE
448 .PP
449 6
450 .RS 4
451 A source or auxiliary file specified in the PKGBUILD is missing\&.
452 .RE
453 .PP
454 7
455 .RS 4
456 The PKGDIR is missing\&.
457 .RE
458 .PP
459 8
460 .RS 4
461 Failed to install dependencies\&.
462 .RE
463 .PP
464 9
465 .RS 4
466 Failed to remove dependencies\&.
467 .RE
468 .PP
469 10
470 .RS 4
471 User attempted to run makepkg as root\&.
472 .RE
473 .PP
474 11
475 .RS 4
476 User lacks permissions to build or install to a given location\&.
477 .RE
478 .PP
479 12
480 .RS 4
481 Error parsing PKGBUILD\&.
482 .RE
483 .PP
484 13
485 .RS 4
486 A package has already been built\&.
487 .RE
488 .PP
489 14
490 .RS 4
491 The package failed to install\&.
492 .RE
493 .PP
494 15
495 .RS 4
496 Programs necessary to run makepkg are missing\&.
497 .RE
498 .PP
499 16
500 .RS 4
501 Specified GPG key does not exist or failed to sign package\&.
502 .RE
503 .PP
504 17
505 .RS 4
506 The local repository is not a clone of the source repository specified in PKGBUILD\&.
507 .RE
508 .SH "SEE ALSO"
509 .sp
510 \fBmakepkg.conf\fR(5), \fBPKGBUILD\fR(5), \fBpacman\fR(8)
511 .sp
512 See the pacman website at https://archlinux\&.org/pacman/ for current information on pacman and its related tools\&.
513 .SH "BUGS"
514 .sp
515 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\&.
516 .SH "AUTHORS"
517 .sp
518 Current maintainers:
519 .sp
520 .RS 4
521 .ie n \{\
522 \h'-04'\(bu\h'+03'\c
523 .\}
524 .el \{\
525 .sp -1
526 .IP \(bu 2.3
527 .\}
528 Allan McRae <allan@archlinux\&.org>
529 .RE
530 .sp
531 .RS 4
532 .ie n \{\
533 \h'-04'\(bu\h'+03'\c
534 .\}
535 .el \{\
536 .sp -1
537 .IP \(bu 2.3
538 .\}
539 Andrew Gregory <andrew\&.gregory\&.8@gmail\&.com>
540 .RE
541 .sp
542 .RS 4
543 .ie n \{\
544 \h'-04'\(bu\h'+03'\c
545 .\}
546 .el \{\
547 .sp -1
548 .IP \(bu 2.3
549 .\}
550 Morgan Adamiec <morganamilo@archlinux\&.org>
551 .RE
552 .sp
553 Past major contributors:
554 .sp
555 .RS 4
556 .ie n \{\
557 \h'-04'\(bu\h'+03'\c
558 .\}
559 .el \{\
560 .sp -1
561 .IP \(bu 2.3
562 .\}
563 Judd Vinet <jvinet@zeroflux\&.org>
564 .RE
565 .sp
566 .RS 4
567 .ie n \{\
568 \h'-04'\(bu\h'+03'\c
569 .\}
570 .el \{\
571 .sp -1
572 .IP \(bu 2.3
573 .\}
574 Aurelien Foret <aurelien@archlinux\&.org>
575 .RE
576 .sp
577 .RS 4
578 .ie n \{\
579 \h'-04'\(bu\h'+03'\c
580 .\}
581 .el \{\
582 .sp -1
583 .IP \(bu 2.3
584 .\}
585 Aaron Griffin <aaron@archlinux\&.org>
586 .RE
587 .sp
588 .RS 4
589 .ie n \{\
590 \h'-04'\(bu\h'+03'\c
591 .\}
592 .el \{\
593 .sp -1
594 .IP \(bu 2.3
595 .\}
596 Dan McGee <dan@archlinux\&.org>
597 .RE
598 .sp
599 .RS 4
600 .ie n \{\
601 \h'-04'\(bu\h'+03'\c
602 .\}
603 .el \{\
604 .sp -1
605 .IP \(bu 2.3
606 .\}
607 Xavier Chantry <shiningxc@gmail\&.com>
608 .RE
609 .sp
610 .RS 4
611 .ie n \{\
612 \h'-04'\(bu\h'+03'\c
613 .\}
614 .el \{\
615 .sp -1
616 .IP \(bu 2.3
617 .\}
618 Nagy Gabor <ngaba@bibl\&.u\-szeged\&.hu>
619 .RE
620 .sp
621 .RS 4
622 .ie n \{\
623 \h'-04'\(bu\h'+03'\c
624 .\}
625 .el \{\
626 .sp -1
627 .IP \(bu 2.3
628 .\}
629 Dave Reisner <dreisner@archlinux\&.org>
630 .RE
631 .sp
632 .RS 4
633 .ie n \{\
634 \h'-04'\(bu\h'+03'\c
635 .\}
636 .el \{\
637 .sp -1
638 .IP \(bu 2.3
639 .\}
640 Eli Schwartz <eschwartz@archlinux\&.org>
641 .RE
642 .sp
643 For additional contributors, use git shortlog \-s on the pacman\&.git repository\&.