Difference between revisions of "AUR Metadata"

From ArchWiki
Jump to: navigation, search
m (How it works: "depend" was renamed to "depends". refer to: https://mailman.archlinux.org/pipermail/aur-dev/2014-January/002616.html)
m (How it works: update "depend" to "depends" in the second paragraph; improve template usage)
Line 2: Line 2:
  
 
== How it works ==
 
== How it works ==
By adding a metadata file called ".AURINFO" to source tarballs to overwrite specific PKGBUILD fields. {{ic|.AURINFO}} files are parsed line by line. The syntax for each line is {{ic|<nowiki>key = value</nowiki>}}, where key is any of the following field names:
+
By adding a metadata file called ".AURINFO" to source tarballs to overwrite specific PKGBUILD fields. {{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
 
* pkgname
 
* pkgver
 
* pkgver
Line 10: Line 10:
 
* depends
 
* depends
  
Multiple "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.
+
Multiple {{ic|depends}} 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.
  
 
== What does not work ==
 
== What does not work ==

Revision as of 22:54, 17 January 2014

In order to display information in web interface AUR attempts to parse PKGBUILD and salvage package name, version and other information from it. PKGBUILDs are Bash scripts, and correctly parsing Bash scripts is a huge challenge (which is why makepkg is a Bash script itself: it includes PKGBUILD of package being built via source directive). AUR metadata files were created to get rid of some hacks, used by AUR package maintainers to work around incorrect parsing. See also FS#25210, FS#15043 and FS#16394.

How it works

By adding a metadata file called ".AURINFO" to source tarballs to overwrite specific PKGBUILD fields. .AURINFO files are parsed line-by-line. The syntax for each line is key = value, where key is any of the following field names:

  • pkgname
  • pkgver
  • pkgdesc
  • url
  • license
  • depends

Multiple depends lines can be specified to add multiple dependencies. This format closely matches the .PKGINFO format that is used for binary packages in pacman/libalpm. It can be extended by field name prefixes or sections to support split packages later.

What does not work

  • Split packages
  • Multiple architectures (x86_64 dependencies tend to be more numerous, so just put them)

pkgbuild_reflection and mkaurball

pkgbuild_reflection is a set of tools for generating .AURINFO files. One of the provided tools is mkaurball, which is a script that runs makepkg --source, generates an .AURINFO file, and inserts it into the resulting source package.

Tip: mkaurball is a wrapper for makepkg --source. When creating source packages for inclusion in the AUR, use mkaurball instead of running makepkg --source directly.

Install the package pkgbuild-reflection-gitAUR from the Arch User Repository.