1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
|
'\" t
.\" Title: makepkg.conf
.\" Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\" Date: 2024-01-25
.\" Manual: Pacman Manual
.\" Source: Pacman 6.0.2
.\" Language: English
.\"
.TH "MAKEPKG\&.CONF" "5" "2024\-01\-25" "Pacman 6\&.0\&.2" "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.conf \- makepkg configuration file
.SH "SYNOPSIS"
.sp
/etc/makepkg\&.conf, $XDG_CONFIG_HOME/pacman/makepkg\&.conf, ~/\&.makepkg\&.conf
.SH "DESCRIPTION"
.sp
Configuration options for makepkg are stored in makepkg\&.conf\&. This file is sourced so you can include any special compiler flags you wish to use\&. This is helpful when building for different architectures or with different optimizations\&. However, only the variables described below are exported to the build environment\&.
.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
This does not guarantee that all package Makefiles will use your exported variables\&. Some of them are non\-standard\&.
.sp .5v
.RE
.sp
The system\-wide configuration file is found in /etc/makepkg\&.conf\&. Individual options can be overridden (or added to) on a per\-user basis in $XDG_CONFIG_HOME/pacman/makepkg\&.conf or ~/\&.makepkg\&.conf, with the former taking priority\&.
.sp
The default file is fairly well commented, so it may be easiest to simply follow directions given there for customization\&.
.SH "OPTIONS"
.PP
\fBDLAGENTS=(\fR\*(Aqprotocol::/path/to/command [options]\*(Aq \&...\fB)\fR
.RS 4
Sets the download agents used to fetch source files specified with a URL in the
\fBPKGBUILD\fR(5)
file\&. Options can be specified for each command as well, and any protocol can have a download agent\&. Any spaces in option arguments are required to be escaped to avoid being split\&. Several examples are provided in the default makepkg\&.conf\&.
If present,
%u
will be replaced with the download URL\&. Otherwise, the download URL will be placed on the end of the command\&. If present,
%o
will be replaced with the local file name, plus a \(lq\&.part\(rq extension, which allows makepkg to handle resuming file downloads\&.
.RE
.PP
\fBVCSCLIENTS=(\fR\*(Aqprotocol::package\*(Aq \&...\fB)\fR
.RS 4
Sets the packages required to fetch version controlled source files\&. When required, makepkg will check that these packages are installed or are included in the
depends
or
makedepends
arrays in the PKGBUILD\&.
.RE
.PP
\fBCARCH=\fR"carch"
.RS 4
Specifies your computer architecture; possible values include such things as \(lqi686\(rq, \(lqx86_64\(rq, \(lqppc\(rq, etc\&. This should be automatically set on installation\&.
.RE
.PP
\fBCHOST=\fR"chost"
.RS 4
A string such as \(lqi686\-pc\-linux\-gnu\(rq; do not touch this unless you know what you are doing\&. This can be commented out by most users if desired\&.
.RE
.PP
\fBCPPFLAGS=\fR"cppflags"
.RS 4
Flags used for the C preprocessor; see CFLAGS for more information\&.
.RE
.PP
\fBCFLAGS=\fR"cflags"
.RS 4
Flags used for the C compiler\&. This is a key part to the use of makepkg\&. Usually several options are specified, and the most common string resembles something like this: \(lq\-march=i686 \-O2 \-pipe\(rq\&. Another useful option may be
\-mcpu
in place of
\-march\&. Read gcc(1) for more details on the wide variety of compiler flags available\&.
.RE
.PP
\fBCXXFLAGS=\fR"cxxflags"
.RS 4
Flags used for the C++ compiler; see CFLAGS for more info\&.
.RE
.PP
\fBRUSTFLAGS=\fR"rustflags"
.RS 4
Flags used for the Rust compiler, similar in spirit to CFLAGS\&. Read
\fBrustc\fR(1)
for more details on the available flags\&.
.RE
.PP
\fBLDFLAGS=\fR"ldflags"
.RS 4
Flags used for the linker\&. Several options may be specified with common usage resembling \(lq\-Wl,\-\-hash\-style=gnu\(rq\&. Read ld(1) for more details on available linker flags\&.
.RE
.PP
\fBLTOFLAGS=\fR"ltoflags"
.RS 4
Additional compiler and linker flags appended to
CFLAGS,
CXXFLAGS
and
LDFLAGS
when building with link time optimization\&. If empty, \(lq\-flto\(rq is used\&.
.RE
.PP
\fBMAKEFLAGS=\fR"makeflags"
.RS 4
This is often used to set the number of jobs used; for example,
\-j2\&. Other flags that make accepts can also be passed\&.
.RE
.PP
\fBDEBUG_CFLAGS=\fR"debug_cflags"
.RS 4
Additional compiler flags appended to
CFLAGS
for use in debugging\&. Usually this would include: \(lq\-g\(rq\&. Read gcc(1) for more details on the wide variety of compiler flags available\&.
.RE
.PP
\fBDEBUG_CXXFLAGS=\fR"debug_cxxflags"
.RS 4
Debug flags used for the C++ compiler; see DEBUG_CFLAGS for more info\&.
.RE
.PP
\fBDEBUG_RUSTFLAGS=\fR"debug_rustflags"
.RS 4
Additional compiler flags appended to
RUSTFLAGS
for use in debugging\&. Usually this would include: \(lq\-C debuginfo=2\(rq\&. Read
\fBrustc\fR(1)
for more details on the available flags\&.
.RE
.PP
\fBBUILDENV=(\fR!distcc !color !ccache check !sign\fB)\fR
.RS 4
This array contains options that affect the build environment; the defaults are shown here\&. All options should always be left in the array; to enable or disable an option, simply remove or add an \(lq!\(rq at the front of the option\&. If an option is specified multiple times, the final value takes precedence\&. Each option works as follows:
.PP
\fBdistcc\fR
.RS 4
Use the distributed C/C++/ObjC compiler to spread compilation among multiple machines\&. If this is enabled,
DISTCC_HOSTS
must be specified as well\&.
.RE
.PP
\fBcolor\fR
.RS 4
Colorize output messages, making output easier to read\&.
.RE
.PP
\fBccache\fR
.RS 4
Use ccache to cache compilation by default\&. This allows for faster compiles if you are continuously recompiling the same packages\&. It can be disabled for individual packages by placing
!ccache
in the PKGBUILD options array\&.
.RE
.PP
\fBcheck\fR
.RS 4
Run the check() function if present in the PKGBUILD\&. This can be enabled or disabled for individual packages through the use of makepkg\(cqs
\fI\-\-check\fR
and
\fI\-\-nocheck\fR
options, respectively\&.
.RE
.PP
\fBsign\fR
.RS 4
Generate a PGP signature file using GnuPG\&. This will execute
\fIgpg \-\-detach\-sign \-\-use\-agent\fR
on the built package to generate a detached signature file, using the GPG agent, if it is available\&. The signature file will be the entire file name of the package with a \(lq\&.sig\(rq extension\&.
.RE
.RE
.PP
\fBDISTCC_HOSTS=\fR"host1 \&..."
.RS 4
If using DistCC, this is used to specify a space\-delimited list of hosts running in the DistCC cluster\&. In addition, you will want to modify your
MAKEFLAGS\&.
.RE
.PP
\fBBUILDDIR=\fR"/path/to/directory"
.RS 4
If this value is not set, packages will, by default, be built in subdirectories of the directory that makepkg is called from\&. This option allows setting the build location to another directory\&. Incorrect use of
$startdir
in a PKGBUILD may cause building with this option to fail\&.
.RE
.PP
\fBGPGKEY=\fR""
.RS 4
Specify a key to use for GPG signing instead of the default key in the keyring\&. Can be overridden with makepkg\(cqs
\fI\-\-key\fR
option\&.
.RE
.PP
\fBOPTIONS=(\fR!strip docs libtool staticlibs emptydirs !zipman !purge !debug\fB)\fR
.RS 4
This array contains options that affect default packaging\&. They are equivalent to options that can be placed in the PKGBUILD; the defaults are shown here\&. All options should always be left in the array; to enable or disable an option, simply remove or add an \(lq!\(rq at the front of the option\&. If an option is specified multiple times, the final value takes precedence\&. Each option works as follows:
.PP
\fBstrip\fR
.RS 4
Strip symbols from binaries and libraries\&. If you frequently use a debugger on programs or libraries, it may be helpful to disable this option\&.
.RE
.PP
\fBdocs\fR
.RS 4
Save doc directories\&. If you wish to delete doc directories, specify
!docs
in the array\&. The directories affected are specified by the
DOC_DIRS
variable\&.
.RE
.PP
\fBlibtool\fR
.RS 4
Leave libtool (\&.la) files in packages\&. Specify
!libtool
to remove them\&.
.RE
.PP
\fBstaticlibs\fR
.RS 4
Leave static library (\&.a) files in packages\&. Specify
!staticlibs
to remove them, if they have a shared counterpart\&.
.RE
.PP
\fBemptydirs\fR
.RS 4
Leave empty directories in packages\&.
.RE
.PP
\fBzipman\fR
.RS 4
Compress manual (man and info) pages with gzip\&. The directories affected are specified by the
MAN_DIRS
variable\&.
.RE
.PP
\fBpurge\fR
.RS 4
Remove files specified by the
PURGE_TARGETS
variable from the package\&.
.RE
.PP
\fBdebug\fR
.RS 4
Add the user\-specified debug flags as specified in DEBUG_CFLAGS and DEBUG_CXXFLAGS to their counterpart buildflags\&. Creates a separate package containing the debug symbols when used with \(oqstrip\(cq\&.
.RE
.PP
\fBlto\fR
.RS 4
Enable building packages using link time optimization\&. Adds the flags specified in LTOFLAGS to CFLAGS, CXXFLAGS and LDFLAGS (or \(lq\-flto\(rq if LTOFLAGS is empty)\&.
.RE
.RE
.PP
\fBINTEGRITY_CHECK=(\fRcheck1 \&...\fB)\fR
.RS 4
File integrity checks to use\&. Multiple checks may be specified; this affects both generation and checking\&. The current valid options are:
ck,
md5,
sha1,
sha224,
sha256,
sha384,
sha512, and
b2\&.
.RE
.PP
\fBSTRIP_BINARIES=\fR"\-\-strip\-all"
.RS 4
Options to be used when stripping binaries\&. See
\fBstrip\fR(1)
for details\&.
.RE
.PP
\fBSTRIP_SHARED=\fR"\-\-strip\-unneeded"
.RS 4
Options to be used when stripping shared libraries or PIE executables\&. See
\fBstrip\fR(1)
for details\&.
.RE
.PP
\fBSTRIP_STATIC=\fR"\-\-strip\-debug"
.RS 4
Options to be used when stripping static libraries\&. See
\fBstrip\fR(1)
for details\&.
.RE
.PP
\fBMAN_DIRS=(\fR{usr{,/local}{,/share},opt/*}/{man,info} \&...\fB)\fR
.RS 4
If
zipman
is specified in the
OPTIONS
array, this variable will instruct makepkg where to look to compress manual (man and info) pages\&. If you build packages that are located in opt/, you may need to add the directory to this array\&.
\fBNOTE:\fR
Do not add the leading slash to the directory name\&.
.RE
.PP
\fBDOC_DIRS=(\fRusr/{,share/}{doc,gtk\-doc} \&...\fB)\fR
.RS 4
If
!docs
is specified in the
OPTIONS
array, this variable will instruct makepkg where to look to remove docs\&. If you build packages that are located in opt/, you may need to add the directory to this array\&.
\fBNOTE:\fR
Do not add the leading slash to the directory name\&.
.RE
.PP
\fBPURGE_TARGETS=(\fRusr/{,share}/info/dir \&.podlist *\&.pod\&...\fB)\fR
.RS 4
If
purge
is specified in the
OPTIONS
array, this variable will instruct makepkg which files to remove from the package\&. This is useful for index files that are added by multiple packages\&.
.RE
.PP
\fBDBGSRCDIR=\fR"/usr/src/debug"
.RS 4
If
strip
and
debug
are specified in the
OPTIONS
array, this variable will instruct makepkg where to place source files for installed binaries\&. The binaries will be modified to link this directory for the debugger search path\&.
.RE
.PP
\fBPKGDEST=\fR"/path/to/directory"
.RS 4
If this value is not set, packages will, by default, be placed in the current directory (location of the
\fBPKGBUILD\fR(5))\&. Many people like to keep all their packages in one place so this option allows for this behavior\&. A common location is \(lq/home/packages\(rq\&.
.RE
.PP
\fBSRCDEST=\fR"/path/to/directory"
.RS 4
If this value is not set, downloaded source files will only be stored in the current directory\&. Many people like to keep all source files in a central location for easy cleanup, so this path can be set here\&.
.RE
.PP
\fBSRCPKGDEST=\fR"/path/to/directory"
.RS 4
If this value is not set, source package files will be stored in in the current directory\&. Many people like to keep all source package files in a central location for easy cleanup, so this path can be set here\&.
.RE
.PP
\fBLOGDEST=\fR"/path/to/directory"
.RS 4
If this value is not set, log files are written to the current directory\&. This centralizes the log location, facilitating cleanup and compression\&.
.RE
.PP
\fBPACKAGER=\fR"John Doe <john@example\&.com>"
.RS 4
This value is used when querying a package to see who was the builder\&. The given format is required for PGP key lookup through WKD\&. It is recommended to change this to your name and email address\&.
.RE
.PP
\fBCOMPRESSGZ=\fR"(gzip \-c \-f \-n)", \fBCOMPRESSBZ2=\fR"(bzip2 \-c \-f)", \fBCOMPRESSXZ=\fR"(xz \-c \-z \-)", \fBCOMPRESSZST=\fR"(zstd \-c \-z \-)", \fBCOMPRESSLZO\fR"(lzop \-q)", \fBCOMPRESSLRZ=\fR"(lrzip \-q)", \fBCOMPRESSLZ4=\fR"(lz4 \-q)", \fBCOMPRESSZ=\fR"(compress \-c \-f)", \fBCOMPRESSLZ=\fR"(lzip \-c \-f)"
.RS 4
Sets the command and options used when compressing compiled or source packages in the named format\&.
.RE
.PP
\fBPKGEXT=\fR"\&.pkg\&.tar\&.gz", \fBSRCEXT=\fR"\&.src\&.tar\&.gz"
.RS 4
Sets the compression used when making compiled or source packages\&. Valid suffixes are
\&.tar\&.gz,
\&.tar\&.bz2,
\&.tar\&.xz,
\&.tar\&.zst,
\&.tar\&.lzo,
\&.tar\&.lrz,
\&.tar\&.lz4,
\&.tar\&.lz
and
\&.tar\&.Z, or simply
\&.tar
to disable compression entirely\&.
.RE
.PP
\fBPACMAN_AUTH=()\fR
.RS 4
Specify a command prefix for running pacman as root\&. If unset, makepkg will check for the presence of sudo(8) and su(1) in turn, and try the first one it finds\&.
If present,
%c
will be replaced with the shell\-quoted form of the command to run\&. Otherwise, the command to run is appended to the auth command\&.
.RE
.SH "SEE ALSO"
.sp
\fBmakepkg\fR(8), \fBpacman\fR(8), \fBPKGBUILD\fR(5)
.sp
See the pacman website at https://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, submit a bug report with as much detail as possible at the Arch Linux Bug Tracker in the Pacman section\&.
.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
.\}
Eli Schwartz <eschwartz@archlinux\&.org>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Morgan Adamiec <morganamilo@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
.\}
Dan McGee <dan@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
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Dave Reisner <dreisner@archlinux\&.org>
.RE
.sp
For additional contributors, use git shortlog \-s on the pacman\&.git repository\&.
|