Difference between revisions of ".SRCINFO"

From ArchWiki
Jump to navigation Jump to search
m (Syntax: ellipsing is only ... Help:Style#Code_formatting)
(a)
(Tag: Blanking)
Line 1: Line 1:
[[Category:Package development]]
 
[[ja:.SRCINFO]]
 
[[pt:.SRCINFO]]
 
[[zh-hans:.SRCINFO]]
 
{{Related articles start}}
 
{{Related|Arch packaging standards}}
 
{{Related|Arch Build System}}
 
{{Related|Creating packages}}
 
{{Related|PKGBUILD}}
 
{{Related|:Category:Package development}}
 
{{Related|Arch User Repository}}
 
{{Related|makepkg}}
 
{{Related|pacman}}
 
{{Related|pacman/Tips and tricks}}
 
{{Related articles end}}
 
  
{{ic|.SRCINFO}} files contain package metadata in a simple, unambiguous format, so that tools such as the [[AUR]]'s Web back-end or [[AUR helpers]] may retrieve a package's metadata without parsing the [[PKGBUILD]] directly. See {{Bug|25210}}, {{Bug|15043}}, and {{Bug|16394}} for examples of the sorts of issues that may arise from attempting to parse shell scripts.
 
 
{{Warning|Changes to {{ic|PKGBUILD}} metadata, such as [[PKGBUILD#pkgver|pkgver()]] updates, do not automatically propagate to {{ic|.SRCINFO}}. Pushing an edited {{ic|PKGBUILD}} to the AUR without also updating its {{ic|.SRCINFO}} will cause the AUR to serve stale metadata.}}
 
 
== Generation ==
 
 
{{ic|.SRCINFO}} files may be generated using makepkg.
 
 
$ makepkg --printsrcinfo > .SRCINFO
 
 
== Syntax ==
 
 
{{ic|.SRCINFO}} files are lists of {{ic|key = value}} pairs, separated into sections.
 
 
Keys take their names and meanings from [https://www.archlinux.org/pacman/PKGBUILD.5.html#_options_and_directives PKGBUILD variables]. Neither keys nor values are quoted. Data that, in a {{ic|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 [[PKGBUILD#pkgbase|pkgbase]] declaration, and contains data applicable to the package as a whole. In a standard {{ic|PKGBUILD}} describing a single package, this will be the only section, followed by a [[PKGBUILD#pkgname|pkgname]] declaration containing the same value as the preceding pkgbase.
 
 
pkgbase = foo
 
pkgdesc = An example package.
 
...
 
md5sums = SKIP
 
 
pkgname = foo
 
 
In a split {{ic|PKGBUILD}}, each section is headed by a {{ic|pkgname}}, followed by any data specific to that package.
 
 
{{Expansion|The above will suffice for some, below is a verbose list of parameters; split these up to improve readability. Also, find ways to reduce redundancy between this and [[PKGBUILD]].}}
 
 
== Specification ==
 
 
The following fields may appear only once in each {{ic|.SRCINFO}} file, in the {{ic|pkgbase}} section:
 
 
* {{ic|pkgver}}, {{ic|pkgrel}}, {{ic|epoch}}
 
 
The following fields may appear up to once in any section.
 
 
* {{ic|pkgdesc}}, {{ic|url}}, {{ic|install}}, {{ic|changelog}}
 
 
The following fields may be repeated  within a section to specify multiple values:
 
 
* {{ic|arch}}
 
* {{ic|groups}}
 
* {{ic|license}}
 
* {{ic|noextract}}
 
* {{ic|options}}
 
* {{ic|backup}}
 
* {{ic|validpgpkeys}}
 
 
The following fields may, additionally, specify multiple [[PKGBUILD#arch|architectures]] as shown below:
 
 
source''_x86_64'' = https://foo.bar/file.tar.gz
 
source''_i686'' = https://foo.bar/file_i686_patch.tar.gz
 
 
* {{ic|source}}
 
* {{ic|depends}}, {{ic|checkdepends}}, {{ic|makedepends}}, {{ic|optdepends}}
 
* {{ic|provides}}, {{ic|conflicts}}, {{ic|replaces}}
 
* {{ic|md5sums}}, {{ic|sha1sums}}, {{ic|sha224sums}}, {{ic|sha256sums}}, {{ic|sha384sums}}, {{ic|sha512sums}}
 
 
Fields with other names are ignored. Blank lines and comment lines beginning with a hash sign ({{ic|#}}) are also ignored. Lines may be indented.
 

Revision as of 13:01, 11 August 2019