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 )
245 .BI \-\-buildscript= NAME
246 Read the package script
251 .RB ( makepkg " " \-p )
253 .SS repo\-add options
255 .BR \-v ", " \-\-verify
256 Verify the PGP signature of the database before
258 .RB ( repo\-add " " \-v )
261 .BR \-R ", " \-\-remove
262 Remove old package files from disk when updating their entry in the
264 .RB ( repo\-add " " \-R )
268 Only add packages that are not already in the database.
269 .RB ( repo\-add " " \-n )
272 .BR \-\-prevent\-downgrade
273 Do not add packages to the database if a newer version is already
275 .RB ( repo\-add " " \-p )
280 The repository used for building packages. If unspecified, the name is
286 The root directory of the repository. If unspecified, the path is
292 The extension name of the repository. Defaults to
297 The command used to build packages. Any
301 section) forwarded must be supported by this command, as well as the
307 .B aur\-build \-\-pkgver
311 The command used to check for built packages in the local
312 repository. Defaults to
313 .BR "aur build\-\-pkglist" .
315 .BR "makepkg \-\-packagelist" ,
316 the default command runs faster by not linting the
321 The command used to sign packages. The arguments
323 .BR \-\-detach\-sign ,
326 must be supported by this command.
330 The command used to update the local repository. Any
334 section) forwarded must be supported by this command.
337 A command prefix for running
344 .BR makepkg.conf (5).
348 Directory where the gpg keyring for signing built packages and the
349 database file is stored.
353 The GPG key used for signing packages. This environment variable is
358 When the variable is set in
359 .BR makepkg.conf (5),
360 is it only respected by
365 The directory for temporary files. (This includes intermediary storage
366 of built packages, defaulting to
370 .SS Repository updates
371 When building on the host (outside of a container), installed packages in the
372 local repository are upgraded to the latest available version by running
373 .BI "pacsync " <repository>
375 .BI "pacman \-S \-\-noconfirm " <repository>/<upgrades...> \fR.
376 This is comparable to
378 except that only priorly installed packages are upgraded to a new version.
380 .SS Using a dedicated build user
381 While using a dedicated user for the build process does not increase
382 security (beyond protecting against packaging errors that write to
384 it may be useful when the local repository will be accessible to
385 multiple users, or as a way to avoid password prompts. Note that such
386 a user must be unprivileged; as of pacman 4.2,
388 may not run directly as root.
390 New users may be created with
395 # useradd build \-\-system \-\-home\-dir /var/cache/aurbuild \-\-create\-home
398 Because dependency resolution is not replicated and left to
403 .BR /usr/bin/makepkg )
406 user should be allowed to run
408 with elevated privileges.
410 For example, create the
411 .I /etc/sudoers.d/10_build
412 file with the following contents:
415 aurbuild ALL = (root) NOPASSWD: /usr/bin/pacman, /usr/bin/pacsync
419 and related programs such as
421 can now run as the new
427 # cd /var/cache/aurbuild
428 # sudo \-u aurbuild git clone https://aur.archlinux.org/mypackage.git
430 # sudo \-u aurbuild aur build \-d custom
433 Any created files in the local repository (such as packages,
434 signatures and database files) will be owned by the
439 .B Avoiding password prompts
446 options require root access:
450 Root access are also required for
458 options are specified.
460 .SS PKGBUILD signatures
461 GPG signatures defined in the
463 array may be automatically retrieved by setting the
464 .I auto\-key\-retrieve
467 Note that this option only works with signatures that include an
468 issuer fingerprint. See
469 .B \-\-auto\-key\-retrieve
474 .SS Signing packages unattended
477 will cache passphrases for a duration set by the
479 option. If extending this duration is not desired, the passphrase can be
481 .B gpg\-preset\-passphrase
485 The duration of the cached passphrase is set by the
487 option, which defaults to 2 hours. See
488 .BR gpg\-preset\-passphrase (1)
491 .SS Rebuilding packages against updated dependencies
492 It is sometimes required to rebuild packages when their dependencies
493 are updated, for example in the case of dynamic library linking. To
494 detect which packages require a rebuild, the
495 .UR https://\:github.com/\:maximbaz/\:rebuild-detector
500 To propagate rebuilt packages to clients,
502 should be increased beforehand, e.g. with
505 .SS Installing dependencies with makepkg
508 is specified, package dependencies are installed with
512 .B pacman \-S \-\-asdeps
513 command for this purpose. Other pacman options can be specified with a
514 wrapper script and the
516 environment variable. See
517 .B ENVIRONMENT VARIABLES
524 builds and signs packages inside a private directory located in
526 On success, packages and their signatures are moved with
528 which is atomic if the local repository is on the same file system as
531 may still write to the
533 in a shared directory, for example when a
535 function is available. Because of this, it is advised to split the
538 into independent arguments, or increase the number of jobs with
541 .BR makepkg.conf (5).
544 Databases are built with
546 to avoid libalpm from skipping entries if the locale is not set
549 Packages are signed manually with
550 .B "gpg \-\-batch \-\-detach\-sign \-\-no\-armor"
551 since chroot builds have no access to
553 variables, and to allow signing existing packages without signature.
556 has a size-limit of 25\~MiB for databases. The use of larger databases
558 .B expected download size exceeded
559 error. To avoid this issue, compress the database with
562 .UR https://\:git.archlinux.org/\:pacman.git/\:commit/\:?id=\:6dc71926f9b16ebcf11b924941092d6eab204224
568 options can be passed to
570 .RB ( "aur\-build \-\-syncdeps" )
573 environment variable, the value of
583 .BR makepkg.conf (5),
592 .MT https://github.com/AladW
596 .\" vim: set textwidth=72: