arch-wiki-md-repo
Version:
All arch-wiki articles in markdown format, updated every two days.
92 lines (61 loc) • 3.77 kB
Markdown
Related articles
* [Arch packaging standards](/index.php/Arch_packaging_standards "Arch packaging standards")
* [Arch Build System](/index.php/Arch_Build_System "Arch Build System")
* [Creating packages](/index.php/Creating_packages "Creating packages")
* [PKGBUILD](/index.php/PKGBUILD "PKGBUILD")
* [Category:Package development](/index.php/Category:Package_development "Category:Package development")
* [Arch User Repository](/index.php/Arch_User_Repository "Arch User Repository")
* [makepkg](/index.php/Makepkg "Makepkg")
* [pacman](/index.php/Pacman "Pacman")
* [pacman/Tips and tricks](/index.php/Pacman/Tips_and_tricks "Pacman/Tips and tricks")
`.SRCINFO` files contain package metadata in a simple, unambiguous format, so that tools such as the [AUR](/index.php/AUR "AUR")'s Web back-end or [AUR helpers](/index.php/AUR_helpers "AUR helpers") may retrieve a package's metadata without parsing the [PKGBUILD](/index.php/PKGBUILD "PKGBUILD") directly. See [FS#25210](https://bugs.archlinux.org/task/25210), [FS#15043](https://bugs.archlinux.org/task/15043), and [FS#16394](https://bugs.archlinux.org/task/16394) for examples of the sorts of issues that may arise from attempting to parse shell scripts.
**Warning:** Changes to `PKGBUILD` metadata, such as [pkgver()](/index.php/PKGBUILD#pkgver "PKGBUILD") updates, do not automatically propagate to `.SRCINFO`. Pushing an edited `PKGBUILD` to the AUR without also updating its `.SRCINFO` will cause the AUR to serve stale metadata.
## Generation
`.SRCINFO` files may be generated using makepkg.
```
$ makepkg --printsrcinfo > .SRCINFO
```
## Syntax
`.SRCINFO` files are lists of `key = value` pairs, separated into sections.
Keys take their names and meanings from [PKGBUILD variables](https://www.archlinux.org/pacman/PKGBUILD.5.html#_options_and_directives). Neither keys nor values are quoted. Data that, in a `PKGBUILD`, would be represented by an array is instead specified multiple times. For instance, the following are equivalent.
```
# PKGBUILD
arch=(i686 x86_64)
```
```
# .SRCINFO
arch = i686
arch = x86_64
```
The main section of the file is headed by a [pkgbase](/index.php/PKGBUILD#pkgbase "PKGBUILD") declaration, and contains data applicable to the package as a whole. In a standard `PKGBUILD` describing a single package, this will be the only section, followed by a [pkgname](/index.php/PKGBUILD#pkgname "PKGBUILD") declaration containing the same value as the preceding pkgbase.
```
pkgbase = foo
pkgdesc = An example package.
...
md5sums = SKIP
pkgname = foo
```
In a split `PKGBUILD`, each section is headed by a `pkgname`, followed by any data specific to that package.
## Specification
The following fields may appear only once in each `.SRCINFO` file, in the `pkgbase` section:
* `pkgver`, `pkgrel`, `epoch`
The following fields may appear up to once in any section.
* `pkgdesc`, `url`, `install`, `changelog`
The following fields may be repeated within a section to specify multiple values:
* `arch`
* `groups`
* `license`
* `noextract`
* `options`
* `backup`
* `validpgpkeys`
The following fields may, additionally, specify multiple [architectures](/index.php/PKGBUILD#arch "PKGBUILD") as shown below:
```
source*_x86_64* = [https://foo.bar/file.tar.gz](https://foo.bar/file.tar.gz)
source*_i686* = [https://foo.bar/file_i686_patch.tar.gz](https://foo.bar/file_i686_patch.tar.gz)
```
* `source`
* `depends`, `checkdepends`, `makedepends`, `optdepends`
* `provides`, `conflicts`, `replaces`
* `md5sums`, `sha1sums`, `sha224sums`, `sha256sums`, `sha384sums`, `sha512sums`
Fields with other names are ignored. Blank lines and comment lines beginning with a hash sign (`#`) are also ignored. Lines may be indented.