2 vim:set ts=4 sw=4 syntax=asciidoc noet:
9 PKGBUILD - Arch Linux package build description file
19 This manual page is meant to describe general rules about PKGBUILDs. Once a
20 PKGBUILD is written, the actual package is built using makepkg and installed
23 NOTE: If you have a local copy of the Arch Build System (ABS) tree on your
24 computer, you can copy the PKGBUILD.proto file to your new package build
25 directory and edit it from there. To acquire/sync the ABS tree, use the abs
26 script included with pacman.
29 Options and Directives
30 ----------------------
32 The name of the package. This has be a unix-friendly name as it will be
33 used in the package filename.
36 The version of the software as released from the author (e.g. \'2.7.1').
39 This is the release number specific to the Arch Linux release. This
40 allows package maintainers to make updates to the package's configure
41 flags, for example. A pkgrel of 1 is typically used for each upstream
42 software release and is incremented for intermediate PKGBUILD updates.
45 This should be a brief description of the package and its functionality.
46 Try to keep the description to one line of text.
49 This field contains a URL that is associated with the software being
50 packaged. This is typically the project's website.
53 This field specifies the license(s) that apply to the package.
54 Commonly-used licenses are found in '/usr/share/licenses/common'. If you
55 see the package's license there, simply reference it in the license
56 field (e.g. `$$license=('GPL')$$`). If the package provides a license not
57 found in '/usr/share/licenses/common', then you should include the license
58 in the package itself and set `$$license=('custom')$$` or
59 `$$license=('custom:LicenseName')$$`. The license should be placed in
60 '$pkgdir/usr/share/licenses/$pkgname' when building the package. If
61 multiple licenses are applicable for a package, list all of them:
62 `$$license=('GPL' 'FDL')$$`.
65 Specifies a special install script that is to be included in the package.
66 This file should reside in the same directory as the PKGBUILD, and will
67 be copied into the package by makepkg. It does not need to be included
68 in the source array (e.g. `$$install=pkgname.install$$`).
71 An array of source files required to build the package. Source files
72 must either reside in the same directory as the PKGBUILD file, or be a
73 fully-qualified URL that makepkg will use to download the file. In order
74 to make the PKGBUILD as useful as possible, use the $pkgname and $pkgver
75 variables if possible when specifying the download location. Any files
76 that are compressed will automatically be extracted, unless found in
77 the noextract array listed below.
80 An array of filenames corresponding to those from the source array. Files
81 listed here will not be extracted with the rest of the source files. This
82 is useful for packages which use compressed data which is downloaded but
83 not necessary to uncompress.
86 This array contains an MD5 hash for every source file specified in the
87 source array (in the same order). makepkg will use this to verify source
88 file integrity during subsequent builds. To easily generate md5sums, run
89 ``makepkg -g >> PKGBUILD''. If desired, move the md5sums line to an
90 appropriate location. *NOTE:* makepkg supports multiple integrity
91 algorithms and their corresponding arrays (i.e. sha1sums for the SHA1
92 algorithm); however, official packages use only md5sums for the time
96 Alternative integrity checks that makepkg supports, as noted in md5sums
100 An array of symbolic names that represent groups of packages, allowing
101 you to install multiple packages by requesting a single target. For
102 example, one could install all KDE packages by installing the 'kde' group.
105 Defines on which architectures the given package is available (e.g.
106 `$$arch=('i686' 'x86_64')$$`).
109 A space-delimited array of filenames, without preceding slashes, that
110 should be backed up if the package is removed or upgraded. This is
111 commonly used for packages placing configuration files in /etc. See
112 Handling Config Files in manlink:pacman[8] for more information.
115 An array of packages that this package depends on to run. Packages in
116 this list should be surrounded with single quotes and contain at least
117 the package name. Entries can also include a version requirement of the
118 form 'name<>version', where <> is one of three comparisons: >= (greater
119 than or equal to), <= (less than or equal to), or = (equal to).
121 *makedepends (array)*::
122 An array of packages that this package depends on to build, but are not
123 needed at runtime. Packages in this list follow the same format as
126 *conflicts (array)*::
127 An array of packages that will conflict with this package (i.e. they
128 cannot both be installed at the same time). This directive follows the
129 same format as depends. Versioned conflicts are also supported.
132 An array of ``virtual provisions'' that this package provides. This allows
133 a package to provide dependencies other than its own package name. For
134 example, the dcron package can provide 'cron', which allows packages to
135 depend on 'cron' rather than 'dcron OR fcron'.
136 Versioned provisions are also possible. For example, dcron can provide
137 'cron 2.0' to satisfy the 'cron>=2.0' dependency of other packages.
140 An array of packages that this package should replace, and can be used
141 to handle renamed/combined packages. For example, if the 'j2re' package
142 is renamed to 'jre', this directive allows future upgrades to continue
143 as expected even though the package has moved. Sysupgrade is currently
144 the only pacman operation that utilizes this field, a normal sync will
148 This array allows you to override some of makepkg's default behavior
149 when building packages. To set an option, just include the option name
150 in the options array. To reverse the default behavior, place an ``!'' at
151 the front of the option. Only specify the options you specifically want
152 to override, the rest will be taken from manlink:makepkg.conf[5].
153 *NOTE:* 'force' is a special option only used in a manlink:PKGBUILD[5],
154 do not use it unless you know what you are doing.
157 Strip symbols from binaries and libraries. If you frequently
158 use a debugger on programs or libraries, it may be helpful to
162 Save doc and info directories. If you wish to delete doc and
163 info directories, specify `!docs` in the array.
166 Leave libtool (.la) files in packages. Specify `!libtool` to
170 Leave empty directories in packages.
173 Allow the use of ccache during build. More useful in its negative
174 form `!ccache` with select packages that have problems building
178 Allow the use of distcc during build. More useful in its negative
179 form `!distcc` with select packages that have problems building
183 Allow the use of user-specific makeflags during build as specified
184 in manlink:makepkg.conf[5]. More useful in its negative form
185 `!makeflags` with select packages that have problems building with
186 custom makeflags such as `-j2` (or higher).
189 Force the package to be upgraded by a pacman system upgrade
190 operation, even if the version number would normally not trigger
191 such an upgrade. This is useful when the version numbering scheme
192 of a package changes (or is alphanumeric).
195 Install/Upgrade/Remove Scripting
196 --------------------------------
197 Pacman has the ability to store and execute a package-specific script when it
198 installs, removes, or upgrades a package. This allows a package to configure
199 itself after installation and perform an opposite action upon removal.
201 The exact time the script is run varies with each operation:
204 script is run right before files are extracted.
207 script is run right after files are extracted.
210 script is run right before files are extracted.
213 script is run after files are extracted.
216 script is run right before files are removed.
219 script is run right after files are removed.
221 To use this feature, create a file such as 'pkgname.install' and put it in the
222 same directory as the PKGBUILD script. Then use the install directive:
224 install=pkgname.install
226 The install script does not need to be specified in the source array. A
227 template install file is available in the ABS tree (/var/abs/install.proto).
230 Development Directives
231 ----------------------
232 makepkg supports building development versions of packages without having to
233 manually update the pkgver in the PKGBUILD. This was formerly done using the
234 separate utility 'versionpkg'. In order to utilize this functionality, your
235 PKGBUILD must use correct variable names depending on the SCM being fetched
239 The generated pkgver will be the date the package is built.
242 The root of the CVS repository.
245 The CVS module to fetch.
248 The generated pkgver will be the latest SVN revision number.
251 The trunk of the SVN repository.
254 The SVN module to fetch.
257 The generated pkgver will be one formatted by the 'git-describe'
258 command, with '-' characters converted to '_' characters.
261 The URL (all protocols supported) to the GIT repository.
264 GIT tag or branch to use.
267 The generated pkgver will be the hg tip revision number.
270 The URL of the mercurial repository.
273 The repository to follow.
276 The generated pkgver will be the date the package is built.
279 URL to the repository trunk.
285 The generated pkgver will be the latest Bazaar revision number (revno).
288 URL to the bazaar repository.
291 Bazaar module to use.
296 The following is an example PKGBUILD for the 'patch' package. For more
297 examples, look through the ABS tree.
301 include::PKGBUILD-example.txt[]
307 manlink:makepkg[8], manlink:pacman[8], manlink:makepkg.conf[5]
309 include::footer.txt[]