1MAKEPKG(8)                       Pacman Manual                      MAKEPKG(8)
2
3
4

NAME

6       makepkg - package build utility
7

SYNOPSIS

9       makepkg [options] [ENVVAR=value] [ENVVAR+=value] ...
10

DESCRIPTION

12       makepkg is a script to automate the building of packages. The
13       requirements for using the script are a build-capable *nix platform and
14       a custom build script for each package you wish to build (known as a
15       PKGBUILD). See PKGBUILD(5) for details on creating your own build
16       scripts.
17
18       The advantage to a script-based build is that the work is only done
19       once. Once you have the build script for a package, makepkg will do the
20       rest: download and validate source files, check dependencies, configure
21       the build-time settings, build the package, install the package into a
22       temporary root, make customizations, generate meta-info, and package
23       the whole thing up for pacman to use.
24
25           Note
26           makepkg uses your current locale by default and does not unset it
27           when building packages. If you wish to share your build output with
28           others when seeking help or for other purposes, you may wish to run
29           "LC_ALL=C makepkg" so your logs and output are not localized.
30

OPTIONS

32       -A, --ignorearch
33           Ignore a missing or incomplete arch field in the build script. This
34           is for rebuilding packages from source when the PKGBUILD may be
35           slightly outdated and not updated with an arch=('yourarch') field.
36
37       -c, --clean
38           Clean up leftover work files and directories after a successful
39           build.
40
41       --config <file>
42           Use an alternate configuration file instead of the
43           /etc/makepkg.conf default.
44
45       -d, --nodeps
46           Do not perform any dependency checks. This will let you override
47           and ignore any dependencies required. There is a good chance this
48           option will break the build process if all of the dependencies are
49           not installed.
50
51       -e, --noextract
52           Do not extract source files or run the prepare() function (if
53           present); use whatever source already exists in the $srcdir/
54           directory. This is handy if you want to go into $srcdir/ and
55           manually patch or tweak code, then make a package out of the
56           result. Keep in mind that creating a patch may be a better solution
57           to allow others to use your PKGBUILD.
58
59       --verifysource
60           For each source file in the source array of PKGBUILD, download the
61           file if required and perform the integrity checks. No extraction or
62           build is performed. Dependencies specified in the PKGBUILD will not
63           be handled unless --syncdeps is used. Useful for performing
64           subsequent offline builds.
65
66       -f, --force
67           makepkg will not build a package if a built package already exists
68           in the PKGDEST (set in makepkg.conf(5)) directory, which may
69           default to the current directory. This allows the built package to
70           be overwritten.
71
72       -g, --geninteg
73           For each source file in the source array of PKGBUILD, download the
74           file if required and generate integrity checks. The integrity
75           checks generated are determined by the checks present in the
76           PKGBUILD, falling back to the value of the INTEGRITY_CHECK array in
77           makepkg.conf(5) if these are absent This output can be redirected
78           into your PKGBUILD for source validation using "makepkg -g >>
79           PKGBUILD".
80
81       --skipinteg
82           Do not perform any integrity checks (checksum and PGP) on source
83           files.
84
85       --skipchecksums
86           Do not verify checksums of source files.
87
88       --skippgpcheck
89           Do not verify PGP signatures of source files.
90
91       -h, --help
92           Output syntax and command line options.
93
94       --holdver
95           When using VCS sources (PKGBUILD(5)) any currently checked out
96           source will not be updated to the latest revision.
97
98       -i, --install
99           Install or upgrade the package after a successful build using
100           pacman(8).
101
102       -L, --log
103           Enable logging. This will use the tee program to send the output of
104           each of the PKGBUILD functions to both the console and to a text
105           file in the build directory named
106           pkgbase-pkgver-pkgrel-arch-<function>.log. As mentioned above, the
107           logs will be localized so you may want to set your locale
108           accordingly if sharing the log output with others.
109
110       -m, --nocolor
111           Disable color in output messages.
112
113       -o, --nobuild
114           Download and extract files, run the prepare() function, but do not
115           build them. Useful with the --noextract option if you wish to tweak
116           the files in $srcdir/ before building.
117
118       -p <buildscript>
119           Read the package script buildscript instead of the PKGBUILD
120           default; see PKGBUILD(5). The buildscript must be located in the
121           directory makepkg is called from.
122
123       -r, --rmdeps
124           Upon successful build, remove any dependencies installed by makepkg
125           during dependency auto-resolution and installation when using -s.
126
127       -R, --repackage
128           Repackage contents of the package without rebuilding the package.
129           This is useful if you forgot, for example, a dependency or install
130           file in your PKGBUILD and the build itself will not change.
131
132       -s, --syncdeps
133           Install missing dependencies using pacman. When build-time or
134           run-time dependencies are not found, pacman will try to resolve
135           them. If successful, the missing packages will be downloaded and
136           installed.
137
138       -S, --source
139           Do not actually build the package, but build a source-only tarball
140           that does not include sources that can be fetched via a download
141           URL. This is useful for passing a single tarball to another program
142           such as a chroot, remote builder, or a tarball upload. Because
143           integrity checks are verified, all source files of the package need
144           to be present or downloadable.
145
146       -V, --version
147           Display version information.
148
149       -C, --cleanbuild
150           Remove the $srcdir before building the package.
151
152       --allsource
153           Do not actually build the package, but build a source-only tarball
154           that includes all sources, including those that are normally
155           downloaded via makepkg. This is useful for passing a single tarball
156           to another program such as a chroot or remote builder. It will also
157           satisfy requirements of the GPL when distributing binary packages.
158
159       --check
160           Run the check() function in the PKGBUILD, overriding the setting in
161           makepkg.conf(5).
162
163       --noarchive
164           Do not create the archive at the end of the build process. This can
165           be useful to test the package() function or if your target
166           distribution does not use pacman.
167
168       --nocheck
169           Do not run the check() function in the PKGBUILD or handle the
170           checkdepends.
171
172       --noprepare
173           Do not run the prepare() function in the PKGBUILD.
174
175       --sign
176           Sign the resulting package with gpg, overriding the setting in
177           makepkg.conf(5).
178
179       --nosign
180           Do not create a signature for the built package.
181
182       --key <key>
183           Specify a key to use when signing packages, overriding the GPGKEY
184           setting in makepkg.conf(5). If not specified in either location,
185           the default key from the keyring will be used.
186
187       --noconfirm
188           (Passed to pacman) Prevent pacman from waiting for user input
189           before proceeding with operations.
190
191       --needed
192           (Passed to pacman) Tell pacman not to reinstall a target if it is
193           already up-to-date. (used with -i / --install).
194
195       --asdeps
196           (Passed to pacman) Install packages as non-explicitly installed
197           (used with -i / --install).
198
199       --noprogressbar
200           (Passed to pacman) Prevent pacman from displaying a progress bar;
201           useful if you are redirecting makepkg output to file.
202
203       --packagelist
204           List the package filenames that would be produced without building.
205           Listed package filenames include PKGDEST and PKGEXT.
206
207       --printsrcinfo
208           Generate and print the SRCINFO file to stdout.
209

ADDITIONAL FEATURES

211       makepkg supports building development versions of packages without
212       having to manually update the pkgver in the PKGBUILD. This was formerly
213       done using the separate utility versionpkg. See PKGBUILD(5) for details
214       on how to set up a development PKGBUILD.
215

REPRODUCIBILITY

217       makepkg is designed to be compatible with Reproducible Builds. If the
218       SOURCE_DATE_EPOCH environment variable is set, it will be exported to
219       subprocesses, and source and package file modification times and
220       package metadata will be unified based on the timestamp specified.
221
222       If the SOURCE_DATE_EPOCH environment variable is not set, makepkg will
223       use its own start date for internal use, but will not unify source file
224       timestamps before building.
225

ENVIRONMENT VARIABLES

227       PACMAN
228           The command that will be used to check for missing dependencies and
229           to install and remove packages. Pacman’s -Qq, -Rns, -S, -T, and -U
230           operations must be supported by this command. If the variable is
231           not set or empty, makepkg will fall back to ‘pacman’.
232
233       MAKEPKG_CONF="/path/to/file"
234           Use an alternate config file instead of the /etc/makepkg.conf
235           default.
236
237       PKGDEST="/path/to/directory"
238           Directory where the resulting packages will be stored. Overrides
239           the corresponding value defined in makepkg.conf(5).
240
241       SRCDEST="/path/to/directory"
242           Directory where the downloaded sources will be stored. Overrides
243           the corresponding value defined in makepkg.conf(5).
244
245       SRCPKGDEST="/path/to/directory"
246           Directory where source package files will be stored. Overrides the
247           corresponding value defined in makepkg.conf(5).
248
249       LOGDEST="/path/to/directory"
250           Directory where generated log files will be stored. Overrides the
251           corresponding value defined in makepkg.conf(5).
252
253       PACKAGER="John Doe <john@doe.com>"
254           String to identify the creator of the resulting package. Overrides
255           the corresponding value defined in makepkg.conf(5).
256
257       BUILDDIR="/path/to/directory"
258           Directory where the package will be built. Overrides the
259           corresponding value defined in makepkg.conf(5).
260
261       CARCH="(i686|x86_64)"
262           Force build for a specific architecture. Useful for
263           cross-compiling. Overrides the corresponding value defined in
264           makepkg.conf(5).
265
266       PKGEXT=".pkg.tar.gz", SRCEXT=".src.tar.gz"
267           Sets the compression used when making compiled or source packages.
268           Overrides the corresponding value defined in makepkg.conf(5).
269
270       GNUPGHOME="/path/to/directory"
271           Directory where the gpg keyring for signing the built package is
272           stored.
273
274       GPGKEY="keyid"
275           Specify a key to use when signing packages, overriding the GPGKEY
276           setting in makepkg.conf(5).
277
278       SOURCE_DATE_EPOCH="<date>"
279           Used for Reproducible Builds.
280
281       BUILDTOOL="<name>"
282           The name of a tool ecosystem used to set up the build environment.
283           Used for defining a spec for reproducible builds, e.g. the
284           makepkg.conf(5) used.
285
286       BUILDTOOLVER="<version>"
287           The version of the $BUILDTOOL used.
288

CONFIGURATION

290       See makepkg.conf(5) for more details on configuring makepkg using the
291       makepkg.conf file.
292

ERRORS

294       On exit, makepkg will return one of the following error codes.
295
296       0
297           Normal exit condition.
298
299       1
300           Unknown cause of failure.
301
302       2
303           Error in configuration file.
304
305       3
306           User specified an invalid option.
307
308       4
309           Error in user-supplied function in PKGBUILD.
310
311       5
312           Failed to create a viable package.
313
314       6
315           A source or auxiliary file specified in the PKGBUILD is missing.
316
317       7
318           The PKGDIR is missing.
319
320       8
321           Failed to install dependencies.
322
323       9
324           Failed to remove dependencies.
325
326       10
327           User attempted to run makepkg as root.
328
329       11
330           User lacks permissions to build or install to a given location.
331
332       12
333           Error parsing PKGBUILD.
334
335       13
336           A package has already been built.
337
338       14
339           The package failed to install.
340
341       15
342           Programs necessary to run makepkg are missing.
343
344       16
345           Specified GPG key does not exist or failed to sign package.
346

SEE ALSO

348       makepkg.conf(5), PKGBUILD(5), pacman(8)
349
350       See the pacman website at https://archlinux.org/pacman/ for current
351       information on pacman and its related tools.
352

BUGS

354       Bugs? You must be kidding; there are no bugs in this software. But if
355       we happen to be wrong, submit a bug report with as much detail as
356       possible at the Arch Linux Bug Tracker in the Pacman section.
357

AUTHORS

359       Current maintainers:
360
361       •   Allan McRae <allan@archlinux.org>
362
363       •   Andrew Gregory <andrew.gregory.8@gmail.com>
364
365       •   Eli Schwartz <eschwartz@archlinux.org>
366
367       •   Morgan Adamiec <morganamilo@archlinux.org>
368
369       Past major contributors:
370
371       •   Judd Vinet <jvinet@zeroflux.org>
372
373       •   Aurelien Foret <aurelien@archlinux.org>
374
375       •   Aaron Griffin <aaron@archlinux.org>
376
377       •   Dan McGee <dan@archlinux.org>
378
379       •   Xavier Chantry <shiningxc@gmail.com>
380
381       •   Nagy Gabor <ngaba@bibl.u-szeged.hu>
382
383       •   Dave Reisner <dreisner@archlinux.org>
384
385       For additional contributors, use git shortlog -s on the pacman.git
386       repository.
387
388
389
390Pacman 6.0.1                      2022-01-20                        MAKEPKG(8)
Impressum