1 .TH AUR\-BUILD 1 2022-07-12 AURUTILS
3 aur\-build \- build packages to a local repository
12 .OP \-\-root DIRECTORY
14 .RI [ makepkg_args... ]
18 Build packages adding the results to a local repository.
20 A local repository is a
22 repository configured with a
29 .BI \-a " FILE" "\fR,\fP \-\-arg\-file=" FILE
30 A text file describing directories containing a PKGBUILD relative to
31 the current directory. If unspecified, the current directory is
35 .BR \-c ", " \-\-chroot
36 Build packages inside a
37 .BR systemd\-nspawn (1)
46 will append these options to
50 .BI \-d " NAME" "\fR,\fP \-\-database=" NAME
57 The root directory for the repository. The
59 is the location for the pacman database
61 built packages, and secondary files such as the files database
63 This defaults to the value of the
65 directive for the configured repository.
70 directive configured in
74 sync operations regardless of this setting. See also
78 .BR \-f ", " \-\-force
79 Continue the build process if a package with the same name is
80 found. Without this option,
82 will add existing packages to the local repository and (if
89 Packages are checked for existence
96 .BR "makepkg \-\-packagelist" .
97 If a package script has a
99 function, package names may be outdated. The check can then be bypassed
104 function run priorly with
108 .BR \-S ", " \-\-sign ", " \-\-gpg\-sign
109 Sign built packages and the database
110 .RB ( "repo\-add \-s" )
113 To use another key than the default, the
115 environment variable can be set to the appropriate key identifier.
117 Should the signing process fail for any reason, corresponding packages are
119 moved to the local repository.
121 will instead exit with a diagnostic containing the package paths.
127 before checking existing packages, effectively running the
129 function if present. The
131 option is added to the default
140 options are forwarded to the above command. Other
145 .BI \-\-makepkg\-conf= FILE
150 operations. For chroot builds, the file is also used inside the container.
151 .RB ( makepkg " " \-\-config ", " aur\-chroot " " \-\-makepkg\-conf ).
154 .BI \-\-pacman\-conf= FILE
155 The file used for retrieving local repositories
156 .RB ( aur\-repo " " \-\-config ).
157 For chroot builds, the file is also used for
159 operations inside the container
160 .RB ( aur\-chroot " " \-\-pacman\-conf ).
165 and local repository upgrades (see the
166 .B Repository updates
168 are unaffected by this option.
172 Do not sync the local repository after building.
175 .BI \-\-results= FILE
176 Write colon-delimited output in the following form to
179 .I <action>:file://<path>
187 for built packages and packages already available in the local
188 repository, respectively.
191 Additional options may be passed to
193 by placing them after
208 Do not run the check() function in the PKGBUILD.
209 .RB ( makepkg " " \-\-nocheck )
212 .BR \-n ", " \-\-noconfirm ", " \-\-no\-confirm
213 Do not wait for user input.
214 .RB ( makepkg " " \-\-noconfirm )
217 .BR \-r ", " \-\-rmdeps
218 Remove dependencies installed by makepkg.
219 .RB ( makepkg " " \-\-rmdeps )
222 .BR \-s ", " \-\-syncdeps
223 Install missing dependencies using
225 .RB ( makepkg " " \-\-syncdeps )
228 .BR \-A ", " \-\-ignorearch
229 Ignore a missing or incomplete
231 field in the build script.
232 .RB ( makepkg " " \-\-ignorearch )
236 Enable logging to a text file in the build directory.
237 .RB ( makepkg " " \-\-log )
240 .BR -C ", " \-\-clean
241 Clean up leftover work files and directories after a successful build.
242 .RB ( makepkg " " \-\-clean )
246 Remove the source directory before building the package.
247 .RB ( "makepkg \-\-cleanbuild" )
250 .BI \-\-buildscript= NAME
251 Read the package script
256 .RB ( makepkg " " \-p )
258 .SS repo\-add options
260 .BR \-v ", " \-\-verify
261 Verify the PGP signature of the database before
263 .RB ( repo\-add " " \-v )
266 .BR \-R ", " \-\-remove
267 Remove old package files from disk when updating their entry in the
269 .RB ( repo\-add " " \-R )
273 Only add packages that are not already in the database.
274 .RB ( repo\-add " " \-n )
277 .BR \-\-prevent\-downgrade
278 Do not add packages to the database if a newer version is already
280 .RB ( repo\-add " " \-p )
285 The repository used for building packages. If unspecified, the name is
291 The root directory of the repository. If unspecified, the path is
297 The extension name of the repository. Defaults to
302 The command used to build packages. Any
306 section) forwarded must be supported by this command, as well as the
312 .B aur\-build \-\-pkgver
316 The command used to check for built packages in the local
317 repository. Defaults to
318 .BR "aur build\-\-pkglist" .
320 .BR "makepkg \-\-packagelist" ,
321 the default command runs faster by not linting the
326 The command used to sign packages. The arguments
328 .BR \-\-detach\-sign ,
331 must be supported by this command.
335 The command used to update the local repository. Any
339 section) forwarded must be supported by this command.
342 A command prefix for running
349 .BR makepkg.conf (5).
353 Directory where the gpg keyring for signing built packages and the
354 database file is stored.
358 The GPG key used for signing packages. This environment variable is
363 When the variable is set in
364 .BR makepkg.conf (5),
365 is it only respected by
370 The directory for temporary files. (This includes intermediary storage
371 of built packages, defaulting to
375 .SS Repository updates
376 When building on the host (outside of a container), installed packages in the
377 local repository are upgraded to the latest available version by running
378 .BI "pacsync " <repository>
380 .BI "pacman \-S \-\-noconfirm " <repository>/<upgrades...> \fR.
381 This is comparable to
383 except that only priorly installed packages are upgraded to a new version.
385 .SS Using a dedicated build user
386 While using a dedicated user for the build process does not increase
387 security (beyond protecting against packaging errors that write to
389 it may be useful when the local repository will be accessible to
390 multiple users, or as a way to avoid password prompts. Note that such
391 a user must be unprivileged; as of pacman 4.2,
393 may not run directly as root.
395 New users may be created with
400 # useradd build \-\-system \-\-home\-dir /var/cache/aurbuild \-\-create\-home
403 Because dependency resolution is not replicated and left to
408 .BR /usr/bin/makepkg )
411 user should be allowed to run
413 with elevated privileges.
415 For example, create the
416 .I /etc/sudoers.d/10_build
417 file with the following contents:
420 aurbuild ALL = (root) NOPASSWD: /usr/bin/pacman, /usr/bin/pacsync
424 and related programs such as
426 can now run as the new
432 # cd /var/cache/aurbuild
433 # sudo \-u aurbuild git clone https://aur.archlinux.org/mypackage.git
435 # sudo \-u aurbuild aur build \-d custom
438 Any created files in the local repository (such as packages,
439 signatures and database files) will be owned by the
444 .B Avoiding password prompts
451 options require root access:
455 Root access are also required for
463 options are specified.
465 .SS PKGBUILD signatures
466 GPG signatures defined in the
468 array may be automatically retrieved by setting the
469 .I auto\-key\-retrieve
472 Note that this option only works with signatures that include an
473 issuer fingerprint. See
474 .B \-\-auto\-key\-retrieve
479 .SS Signing packages unattended
482 will cache passphrases for a duration set by the
484 option. If extending this duration is not desired, the passphrase can be
486 .B gpg\-preset\-passphrase
490 The duration of the cached passphrase is set by the
492 option, which defaults to 2 hours. See
493 .BR gpg\-preset\-passphrase (1)
496 .SS Rebuilding packages against updated dependencies
497 It is sometimes required to rebuild packages when their dependencies
498 are updated, for example in the case of dynamic library linking. To
499 detect which packages require a rebuild, the
500 .UR https://\:github.com/\:maximbaz/\:rebuild-detector
505 To propagate rebuilt packages to clients,
507 should be increased beforehand, e.g. with
510 .SS Installing dependencies with makepkg
513 is specified, package dependencies are installed with
517 .B pacman \-S \-\-asdeps
518 command for this purpose. Other pacman options can be specified with a
519 wrapper script and the
521 environment variable. See
522 .B ENVIRONMENT VARIABLES
529 builds and signs packages inside a private directory located in
531 On success, packages and their signatures are moved with
533 which is atomic if the local repository is on the same file system as
536 may still write to the
538 in a shared directory, for example when a
540 function is available. Because of this, it is advised to split the
543 into independent arguments, or increase the number of jobs with
546 .BR makepkg.conf (5).
549 Databases are built with
551 to avoid libalpm from skipping entries if the locale is not set
554 Packages are signed manually with
555 .B "gpg \-\-batch \-\-detach\-sign \-\-no\-armor"
556 since chroot builds have no access to
558 variables, and to allow signing existing packages without signature.
561 has a size-limit of 25\~MiB for databases. The use of larger databases
563 .B expected download size exceeded
564 error. To avoid this issue, compress the database with
567 .UR https://\:git.archlinux.org/\:pacman.git/\:commit/\:?id=\:6dc71926f9b16ebcf11b924941092d6eab204224
573 options can be passed to
575 .RB ( "aur\-build \-\-syncdeps" )
578 environment variable, the value of
588 .BR makepkg.conf (5),
597 .MT https://github.com/AladW
601 .\" vim: set textwidth=72: