'\" t
.\"     Title: makepkg
.\"    Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 2018-07-27
.\"    Manual: Pacman Manual
.\"    Source: Pacman 5.1.1
.\"  Language: English
.\"
.TH "MAKEPKG" "8" "2018\-07\-27" "Pacman 5\&.1\&.1" "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\-\-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\-\-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
\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
.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\&.
.RE
.SH "SEE ALSO"
.sp
\fBmakepkg.conf\fR(5), \fBPKGBUILD\fR(5), \fBpacman\fR(8)
.sp
See the pacman website at https://www\&.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, send us an email with as much detail as possible to pacman\-dev@archlinux\&.org\&.
.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
.\}
Dan McGee <dan@archlinux\&.org>
.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
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
.\}
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
For additional contributors, use git shortlog \-s on the pacman\&.git repository\&.
