Difference between revisions of "AUR Metadata"

From ArchWiki
Jump to navigation Jump to search
(→‎How it works: “depends” not yet renamed in live AUR)
m (update redirect)
 
(20 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Package development]]
+
#REDIRECT [[.SRCINFO]]
{{Related articles start}}
 
{{Related|Arch User Repository}}
 
{{Related|PKGBUILD}}
 
{{Related|makepkg}}
 
{{Related|pacman}}
 
{{Related articles end}}
 
In order to display information in the [[AUR]] web interface, the AUR's back-end code attempts to parse [[PKGBUILD]] files and salvage package name, version, and other information from it. {{ic|PKGBUILD}}s are [[Bash]] scripts, and correctly parsing Bash scripts without executing them is a huge challenge, which is why [[makepkg]] is a Bash script itself: it includes the PKGBUILD of the package being built via the {{ic|source}} directive. AUR metadata files were created to get rid of some hacks, used by AUR package maintainers to work around incorrect parsing in the web interface. See also {{Bug|25210}}, {{Bug|15043}}, and {{Bug|16394}}.
 
 
 
== How it works ==
 
By adding a metadata file called ".AURINFO" to source tarballs to overwrite specific PKGBUILD fields. The format of this file is described in the [https://mailman.archlinux.org/pipermail/aur-dev/2013-March/002428.html AUR 2.1.0 release announcement]. {{ic|.AURINFO}} files are parsed line-by-line. The syntax for each line is {{ic|1=key = value}}, where {{ic|key}} is any of the following field names:
 
 
 
* pkgname
 
* pkgver
 
* pkgdesc
 
* url
 
* license
 
* depend (to be renamed ''depends'' in a future AUR release)
 
 
 
Fields with other names are ignored. Multiple {{ic|depend}} lines can be specified to add multiple dependencies. This format closely matches the {{ic|.PKGINFO}} format that is used for binary packages in [[pacman|pacman/libalpm]]. It can be extended by field name prefixes or sections to support split packages later.
 
 
 
== Working with makepkg --source ==
 
Note that {{ic|makepkg --source}} will not automatically include an .AURINFO file that you've created in the src tarball.  You can fix this by adding {{ic|.AURINFO}} to the {{ic|source}} array in your {{ic|PKGBUILD}}.
 
 
 
  source=(.AURINFO ...)
 
  md5sums=(SKIP ...)
 
 
 
== What does not work ==
 
* Split packages
 
* Multiple architectures ({{ic|x86_64}} dependencies tend to be more numerous, so just put them)
 
 
 
== pkgbuild_reflection and mkaurball ==
 
[https://github.com/falconindy/pkgbuild-introspection pkgbuild-introspection] is a set of tools for generating {{ic|.AURINFO}} files. One of the provided tools is {{ic|mkaurball}}, which is a script that runs {{ic|makepkg --source}}, generates an {{ic|.AURINFO}} file, and inserts it into the resulting source package.
 
 
 
{{Tip|{{ic|mkaurball}} is a wrapper for {{ic|makepkg --source}}. When creating source packages for inclusion in the [[AUR]], use {{ic|mkaurball}} instead of running {{ic|makepkg --source}} directly.}}
 
 
 
[[pacman|Install]] the package {{AUR|pkgbuild-introspection-git}} from the Arch User Repository.
 
 
 
== See also ==
 
* https://mailman.archlinux.org/pipermail/aur-general/2014-January/026720.html
 

Latest revision as of 12:19, 22 March 2016

Redirect to: