Revise PKGBUILD(5)

Resolve several grammatical errors and minor formatting consistency issues
in PKGBUILD(5).

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Jason St. John 2013-05-29 14:26:25 +02:00 committed by Allan McRae
parent 477fd794a0
commit 5df5d2c411
2 changed files with 70 additions and 64 deletions

View file

@ -48,10 +48,12 @@ similar to `$_basekernver`.
The version of the software as released from the author (e.g., '2.7.1'). The version of the software as released from the author (e.g., '2.7.1').
The variable is not allowed to contain colons or hyphens. The variable is not allowed to contain colons or hyphens.
+ +
The `pkgver` variable can be automatically updated by providing a `pkgver()` function The `pkgver` variable can be automatically updated by providing a `pkgver()`
in the PKGBUILD that outputs the new package version. This is run after downloading function in the PKGBUILD that outputs the new package version.
and extracting the sources so can use those files in determining the new `pkgver`. This is run after downloading and extracting the sources so it can use those
This is most useful when used with sources from version control systems (see below). files in determining the new `pkgver`.
This is most useful when used with sources from version control systems (see
below).
*pkgrel*:: *pkgrel*::
This is the release number specific to the Arch Linux release. This This is the release number specific to the Arch Linux release. This
@ -62,7 +64,8 @@ This is most useful when used with sources from version control systems (see bel
*pkgdesc*:: *pkgdesc*::
This should be a brief description of the package and its functionality. This should be a brief description of the package and its functionality.
Try to keep the description to one line of text and not use the package's name. Try to keep the description to one line of text and to not use the package's
name.
*epoch*:: *epoch*::
Used to force the package to be seen as newer than any previous versions Used to force the package to be seen as newer than any previous versions
@ -75,7 +78,7 @@ This is most useful when used with sources from version control systems (see bel
*url*:: *url*::
This field contains a URL that is associated with the software being This field contains a URL that is associated with the software being
packaged. Typically the project's website. packaged. This is typically the project's web site.
*license (array)*:: *license (array)*::
This field specifies the license(s) that apply to the package. This field specifies the license(s) that apply to the package.
@ -91,13 +94,13 @@ This is most useful when used with sources from version control systems (see bel
*install*:: *install*::
Specifies a special install script that is to be included in the package. Specifies a special install script that is to be included in the package.
This file should reside in the same directory as the PKGBUILD, and will This file should reside in the same directory as the PKGBUILD and will
be copied into the package by makepkg. It does not need to be included be copied into the package by makepkg. It does not need to be included
in the source array (e.g., `install=$pkgname.install`). in the source array (e.g., `install=$pkgname.install`).
*changelog*:: *changelog*::
Specifies a changelog file that is to be included in the package. Specifies a changelog file that is to be included in the package.
This file should reside in the same directory as the PKGBUILD, and will This file should reside in the same directory as the PKGBUILD and will
be copied into the package by makepkg. It does not need to be included be copied into the package by makepkg. It does not need to be included
in the source array (e.g., `changelog=$pkgname.changelog`). in the source array (e.g., `changelog=$pkgname.changelog`).
@ -105,10 +108,10 @@ This is most useful when used with sources from version control systems (see bel
An array of source files required to build the package. Source files An array of source files required to build the package. Source files
must either reside in the same directory as the PKGBUILD, or be a must either reside in the same directory as the PKGBUILD, or be a
fully-qualified URL that makepkg can use to download the file. fully-qualified URL that makepkg can use to download the file.
To make the PKGBUILD as useful as possible, use the `$pkgname` and `$pkgver` To simplify the maintenance of PKGBUILDs, use the `$pkgname` and `$pkgver`
variables if possible when specifying the download location. Compressed files variables when specifying the download location, if possible.
will be extracted automatically unless found in Compressed files will be extracted automatically unless found in the
the noextract array described below. noextract array described below.
+ +
It is also possible to change the name of the downloaded file, which is helpful It is also possible to change the name of the downloaded file, which is helpful
with weird URLs and for handling multiple source files with the same with weird URLs and for handling multiple source files with the same
@ -118,12 +121,12 @@ makepkg also supports building developmental versions of packages using sources
downloaded from version control systems (VCS). For more information, see downloaded from version control systems (VCS). For more information, see
<<VCS,Using VCS Sources>> below. <<VCS,Using VCS Sources>> below.
+ +
Files in the source array with extensions `.sig`, `.sign` or `.asc` are recognized by Files in the source array with extensions `.sig`, `.sign` or, `.asc` are
makepkg as PGP signatures and will be automatically used to verify the integrity recognized by makepkg as PGP signatures and will be automatically used to verify
of the corresponding source file. the integrity of the corresponding source file.
*noextract (array)*:: *noextract (array)*::
An array of filenames corresponding to those from the source array. Files An array of file names corresponding to those from the source array. Files
listed here will not be extracted with the rest of the source files. This listed here will not be extracted with the rest of the source files. This
is useful for packages that use compressed data directly. is useful for packages that use compressed data directly.
@ -152,10 +155,10 @@ of the corresponding source file.
files should use `arch=('any')`. files should use `arch=('any')`.
*backup (array)*:: *backup (array)*::
An array of filenames, without preceding slashes, that An array of file names, without preceding slashes, that
should be backed up if the package is removed or upgraded. This is should be backed up if the package is removed or upgraded. This is
commonly used for packages placing configuration files in /etc. See commonly used for packages placing configuration files in '/etc'. See
Handling Config Files in linkman:pacman[8] for more information. `"Handling Config Files"` in linkman:pacman[8] for more information.
*depends (array)*:: *depends (array)*::
An array of packages this package depends on to run. Entries in An array of packages this package depends on to run. Entries in
@ -168,7 +171,7 @@ of the corresponding source file.
If the dependency name appears to be a library (ends with .so), makepkg will If the dependency name appears to be a library (ends with .so), makepkg will
try to find a binary that depends on the library in the built package and try to find a binary that depends on the library in the built package and
append the version needed by the binary. Appending the version yourself append the version needed by the binary. Appending the version yourself
disables auto detection. disables automatic detection.
*makedepends (array)*:: *makedepends (array)*::
An array of packages this package depends on to build but are not An array of packages this package depends on to build but are not
@ -209,7 +212,7 @@ only specific versions of a package may be provided.
+ +
If the provision name appears to be a library (ends with .so), makepkg will If the provision name appears to be a library (ends with .so), makepkg will
try to find the library in the built package and append the correct try to find the library in the built package and append the correct
version. Appending the version yourself disables auto detection. version. Appending the version yourself disables automatic detection.
*replaces (array)*:: *replaces (array)*::
An array of packages this package should replace. This can be used An array of packages this package should replace. This can be used
@ -289,13 +292,13 @@ Packaging Functions
------------------- -------------------
In addition to the above directives, PKGBUILDs require a set of functions that In addition to the above directives, PKGBUILDs require a set of functions that
provide instructions to build and install the package. As a minimum, the PKGBUILD provide instructions to build and install the package. As a minimum, the
must contain a package() function which installs all the package's files into the PKGBUILD must contain a `package()` function which installs all the package's
packaging directory, with optional prepare(), build() and check() being used to files into the packaging directory, with optional `prepare()`, `build()`, and
create those files from source. `check()` functions being used to create those files from source.
*package() Function*:: *package() Function*::
The package() function is used to install files into the directory that The `package()` function is used to install files into the directory that
will become the root directory of the built package and is run after all will become the root directory of the built package and is run after all
the optional functions listed below. When specified in combination with the optional functions listed below. When specified in combination with
the fakeroot BUILDENV option in linkman:makepkg.conf[5], fakeroot usage the fakeroot BUILDENV option in linkman:makepkg.conf[5], fakeroot usage
@ -303,41 +306,41 @@ create those files from source.
be run as the user calling makepkg. be run as the user calling makepkg.
*prepare() Function*:: *prepare() Function*::
An optional prepare() function can be specified in which operations that An optional `prepare()` function can be specified in which operations to
are to be run in order to prepare the sources for building (such as prepare the sources for building, such as patching, are performed. This
patching) are performed. This function is run after the source extraction function is run after the source extraction and before the `build()`
and before the build() function and is skipped when source extraction is function. The `prepare()` function is skipped when source extraction
skipped. is skipped.
*build() Function*:: *build() Function*::
The optional build() function is use to compile and/or adjust the source The optional `build()` function is use to compile and/or adjust the source
files in preparation to be installed by the package() function. This is files in preparation to be installed by the `package()` function. This is
directly sourced and executed by makepkg, so anything that bash or the directly sourced and executed by makepkg, so anything that Bash or the
system has available is available for use here. Be sure any exotic system has available is available for use here. Be sure any exotic
commands used are covered by `makedepends`. commands used are covered by the `makedepends` array.
+ +
If you create any variables of your own in the build function, it is If you create any variables of your own in the `build()` function, it is
recommended to use the bash `local` keyword to scope the variable to inside recommended to use the Bash `local` keyword to scope the variable to inside
the build function. the `build()` function.
*check() Function*:: *check() Function*::
An optional check() function can be specified in which a package's An optional `check()` function can be specified in which a package's
test-suite may be run. This function is run between the build() and test-suite may be run. This function is run between the `build()` and
package() functions. Be sure any exotic commands used are covered by `package()` functions. Be sure any exotic commands used are covered by the
`checkdepends`. `checkdepends` array.
All of the above variables such as `$pkgname` and `$pkgver` are available for use All of the above variables such as `$pkgname` and `$pkgver` are available for
in the build function. In addition, makepkg defines the following variables for use use in the `build()` function. In addition, makepkg defines the following
during the build and install process: variables for use during the build and install process:
*srcdir*:: *srcdir*::
This contains the directory where makepkg extracts, or copies, all source This contains the directory where makepkg extracts, or copies, all source
files. files.
*pkgdir*:: *pkgdir*::
This contains the directory where makepkg bundles the installed package This contains the directory where makepkg bundles the installed package.
(this directory will become the root directory of your built package). This directory will become the root directory of your built package. This
This variable should only be used in the package() function. variable should only be used in the `package()` function.
*startdir*:: *startdir*::
This contains the absolute path to the directory where the PKGBUILD is This contains the absolute path to the directory where the PKGBUILD is
@ -377,7 +380,7 @@ self-explanatory. Note that during an upgrade operation, none of the install
or remove scripts will be called. or remove scripts will be called.
Scripts are passed either one or two ``full version strings'', where a full Scripts are passed either one or two ``full version strings'', where a full
version string is either 'pkgver-pkgrel' or 'epoch:pkgver-pkgrel' if epoch is version string is either 'pkgver-pkgrel' or 'epoch:pkgver-pkgrel', if epoch is
non-zero. non-zero.
*pre_install*:: *pre_install*::
@ -415,10 +418,12 @@ reference with all of the available functions defined.
Using VCS Sources[[VCS]] Using VCS Sources[[VCS]]
------------------------ ------------------------
Building a developmental version of a package using sources from a version control Building a developmental version of a package using sources from a version
system (VCS) is enabled by specifying the source in the form control system (VCS) is enabled by specifying the source in the form
`source=('folder::url#fragment')`. Currently makepkg supports the `bzr`, `git`, `hg` and `source=('folder::url#fragment')`. Currently makepkg supports the Bazaar, Git,
`svn` protocols. Subversion, and Mercurial version control systems. For other version control
systems, manual cloning of upstream repositories must be done in the `prepare()`
function.
The source URL is divided into three components: The source URL is divided into three components:
@ -427,11 +432,12 @@ The source URL is divided into three components:
source into. source into.
*url*:: *url*::
The url to the VCS repo. This must include the the vcs in the URL protocol for The URL to the VCS repository. This must include the VCS in the URL protocol
makepkg to recognize this as a VCS source. If the protocol does not include for makepkg to recognize this as a VCS source. If the protocol does not
the VCS name, it can be added by prefixing the URL with `vcs+`. For example, include the VCS name, it can be added by prefixing the URL with `vcs+`. For
using a git repository over `http` would have a source URL in the form example, using a Git repository over HTTPS would have a source URL in the
`git+http://...`. form:
`git+https://...`.
*fragment*:: *fragment*::
(optional) Allows specifying a revision number or branch for makepkg to checkout (optional) Allows specifying a revision number or branch for makepkg to checkout
@ -455,7 +461,7 @@ Example
------- -------
The following is an example PKGBUILD for the 'patch' package. For more The following is an example PKGBUILD for the 'patch' package. For more
examples, look through the build files of your distribution's packages. For examples, look through the build files of your distribution's packages. For
those using Arch Linux, consult the ABS tree. those using Arch Linux, consult the Arch Build System (ABS) tree.
[source,sh] [source,sh]
------------------------------- -------------------------------

View file

@ -8,7 +8,7 @@ information on pacman and its related tools.
Bugs Bugs
---- ----
Bugs? You must be kidding, there are no bugs in this software. But if we 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 happen to be wrong, send us an email with as much detail as possible to
mailto:pacman-dev@archlinux.org[]. mailto:pacman-dev@archlinux.org[].