makepkg: introduce .SRCINFO files for source packages
Similar to .PKGINFO, .SRCINFO provides structured metadata from the
PKGBUILD to be included with source packages.
The format is structured such that it contains a "pkgbase" and one to
many "pkgname" sections. Each "pkgname" section represents an "output
package", and inherits all of the attributes of the "pkgbase" section,
and then can define their own additive fields.
For example, a simple PKGBUILD:
pkgbase=ponies
pkgname=('applejack' 'pinkiepie')
pkgver=1.2.3
pkgrel=1
arch=('x86_64' 'i686')
depends=('friendship' 'magic')
build() { ...; }
package_applejack() {
provides=('courage')
...;
}
package_pinkiepie() {
provides=('laughter')
...;
}
Would yield the following .SRCINFO file:
pkgbase = ponies
pkgdesc = friendship is magic
pkgver = 1.2.3
pkgrel = 1
arch = x86_64
arch = i686
depends = friendship
depends = magic
pkgname = applejack
provides = courage
pkgname = pinkiepie
provides = laughter
The code to generate this new file is taken a project which I've been
incubating[0] under the guise of 'mkaurball', which creates .AURINFO
files for the AUR. AURINFO is the exactly same file as .SRCINFO, but
named as such to make it clear that this is specific to the AUR.
Because we're parsing shell in the packaging functions rather than
executing it, there *are* some limitations, but these only really crop
up in more "exotic" PKGBUILDs. Smoketesting[1] for accuracy in the Arch
repos yields 100% accuracy for [core] and [extra]. [community] clocks in
at ~98% accuracy (.3% difference per PKGBUILD), largely due to silly
haskell packages calling pacman from inside the PKGBUILD to determine
dependencies. [multilib] currently shows about 92% accuracy -- a
statistic which can be largely improved by utilizing the recently merged
arch-specific attribute work. This is also a smaller repo so the numbers
are somewhat inflated. In reality, this is only a .8% variance per
PKGBUILD.
Together, we can make PKGBUILD better.
[0] https://github.com/falconindy/pkgbuild-introspection
[1] https://github.com/falconindy/pkgbuild-introspection/blob/master/test/smoketest
Signed-off-by: Allan McRae <allan@archlinux.org>
0 files changed, 0 insertions, 0 deletions