You are not logged in.

#1 2014-04-03 13:30:32

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 188

[SOLVED] .AURINFO and makepkg --source

The documentation suggests that one use

makepkg --source

to build source packages for AUR, but also states that one should include a .AURINFO file.

See Arch User Repository and Arch Packaging Standards

I made a .AURINFO file by hand and placed it in the same directory as PKGBUILD, but the problem is that makepkg --source doesn't pick it up and include it in the src .tgz file.

It doesn't seem like makepkg --source is doing much more than putting PKGBUILD in a compressed tarball.  I can create such a tarball by hand myself, but am wondering if I'm missing something?  In any case, the documentation appears to be inconsistent.

AUR Metadata suggests using mkaurball as a wrapper for makepkg --source.  That seems like overkill for the package I'm trying to put in AUR.  I'd rather keep it simple (in accord with the Arch philosophy) whenever possible.

Last edited by pgoetz (2014-04-03 16:14:06)

Offline

#2 2014-04-03 13:36:15

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,417
Website

Re: [SOLVED] .AURINFO and makepkg --source

The metadata are optional.  Patch /usr/bin/makepkg if you wish with the following which will pick it up.

--- /usr/bin/makepkg	2013-04-04 08:26:50.000000000 -0400
+++ /usr/bin/makepkg	2013-05-04 11:12:21.692179822 -0400
@@ -1978,6 +1978,8 @@
 	local srclinks="$(mktemp -d "$startdir"/srclinks.XXXXXXXXX)"
 	mkdir "${srclinks}"/${pkgbase}
 
+	[[ -f .AURINFO ]] && cp .AURINFO "${srclinks}"/${pkgbase}
+
 	check_license
 
 	msg2 "$(gettext "Adding %s...")" "$BUILDSCRIPT"

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2014-04-03 14:12:05

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 188

Re: [SOLVED] .AURINFO and makepkg --source

Thanks for the quick response.  This seems like an obvious thing to add to the makepkg script; certainly easier than changing the documentation in the Wiki!

In any case, I made this modification, and it worked.  Unfortunately it will be blown away the next time the pacman package is upgraded!

Offline

#4 2014-04-03 14:37:35

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,417
Website

Re: [SOLVED] .AURINFO and makepkg --source

Yes, it will.  I believe this patch will not work with split packages or something that kept it out of pacman's upstream.  I thought I either submitted to the bug system or the ML it and it was rejected.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2014-04-03 14:41:46

progandy
Member
Registered: 2012-05-17
Posts: 2,146

Re: [SOLVED] .AURINFO and makepkg --source

You could add the file in a custom script with something like this:

bsdtar -cf example-1.2.3-1.aur.src.tar.gz example/.AURINFO @example-1.2.3-1.src.tar.gz

Offline

#6 2014-04-03 15:33:13

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 188

Re: [SOLVED] .AURINFO and makepkg --source

progandy wrote:

You could add the file in a custom script with something like this:

bsdtar -cf example-1.2.3-1.aur.src.tar.gz example/.AURINFO @example-1.2.3-1.src.tar.gz

This is probably worth documenting in the AUR and AUR Metadata Wiki pages -- I'll do that now.

EDIT:  So, there are some problems with this approach that were discussed outside the forum.  You can make this work (i.e. using bsdtar to add .AURINFO to the source tarball), but you have to be very careful about the file locations when you're executing something like the command above, else the .AURINFO file won't untar into the same directory as the PKGBUILD file.

See the AUR Metadata Wiki page for details on how get .AURINFO into your source package.

Last edited by pgoetz (2014-04-05 08:43:12)

Offline

#7 2014-04-03 17:24:01

WorMzy
Forum Moderator
From: England
Registered: 2010-06-16
Posts: 5,025

Re: [SOLVED] .AURINFO and makepkg --source

There is also mkaurball, part of pkgbuild-introspection-git in the AUR.  It's more of a future solution though, as it generates .AURINFO files with more values than the AUR currently supports.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#8 2014-04-03 23:24:41

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,361
Website

Re: [SOLVED] .AURINFO and makepkg --source

graysky wrote:

Yes, it will.  I believe this patch will not work with split packages or something that kept it out of pacman's upstream.  I thought I either submitted to the bug system or the ML it and it was rejected.

Nope.  Never saw it on the pacman developmental list and bug tracker.

And I have in the last day added a patch locally that adds a .SRCINFO file to source packages which may or may not be entirely incompatible...

Offline

#9 2014-04-04 14:31:09

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 188

Re: [SOLVED] .AURINFO and makepkg --source

Allan wrote:

And I have in the last day added a patch locally that adds a .SRCINFO file to source packages which may or may not be entirely incompatible...

This is the wrong place for this comment, but if .AURINFO and now .SRCINFO files are necessary, then perhaps this means it's time to pull the metadata out of PKGBUILD and always just keep this in a accompanying key-value pairs list.  Consistency beats all.

Offline

#10 2014-04-04 15:03:54

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,092
Website

Re: [SOLVED] .AURINFO and makepkg --source

pgoetz wrote:
Allan wrote:

And I have in the last day added a patch locally that adds a .SRCINFO file to source packages which may or may not be entirely incompatible...

This is the wrong place for this comment, but if .AURINFO and now .SRCINFO files are necessary, then perhaps this means it's time to pull the metadata out of PKGBUILD and always just keep this in a accompanying key-value pairs list.  Consistency beats all.

...which is exactly what the aforementioned pkgbuild-introspection package attempts to do. Good luck with the "consistency" part, though. Parsing PKGBUILDs is an awful business.

Offline

#11 2014-04-04 15:12:56

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 188

Re: [SOLVED] .AURINFO and makepkg --source

falconindy wrote:

...which is exactly what the aforementioned pkgbuild-introspection package attempts to do. Good luck with the "consistency" part, though. Parsing PKGBUILDs is an awful business.

That's exactly what I mean: if parsing PKBUILD files is an awful business, then they shouldn't be parsed for metadata -- ever.  Just put all the metadata in a separate key-value pair or JSON file with stringent syntax requirements.  This is the consistent solution, if somewhat less elegant.

Offline

#12 2014-04-04 17:37:31

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,092
Website

Re: [SOLVED] .AURINFO and makepkg --source

Ah, I misunderstood what you meant by "pull the metadata out of the PKGBUILD". Changing the PKGBUILD format is, IMO, a better and longer term solution, but not something anyone has been willing to cobble together with a migration plan.

Offline

#13 2014-04-04 18:13:06

progandy
Member
Registered: 2012-05-17
Posts: 2,146

Re: [SOLVED] .AURINFO and makepkg --source

falconindy wrote:

Ah, I misunderstood what you meant by "pull the metadata out of the PKGBUILD". Changing the PKGBUILD format is, IMO, a better and longer term solution, but not something anyone has been willing to cobble together with a migration plan.

If we want to keep a single PKGBUID, something like this might work:

pkginfo() {
cat <<'PKGINFO_NOVARS'
[package]
    pkgname=foo
PKGINFO_NOVARS
cat <<PKGINFO_WITHVARS
    pkgver=$version
PKGINFO_WITHVARS
}
$ makepkg --source
    % source PKGBUILD
    % pkginfo >.SRCINFO
    % parse_info ./.SRCINFO
...

Offline

#14 2014-04-04 18:36:09

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,092
Website

Re: [SOLVED] .AURINFO and makepkg --source

No, duplicating the metadata isn't an option when humans are involved and the someone mentions "consistency".

Offline

#15 2014-04-04 19:46:37

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 188

Re: [SOLVED] .AURINFO and makepkg --source

falconindy wrote:

Ah, I misunderstood what you meant by "pull the metadata out of the PKGBUILD". Changing the PKGBUILD format is, IMO, a better and longer term solution, but not something anyone has been willing to cobble together with a migration plan.

By the way, can you share some details about why it's hard to parse the metadata from PKGBUILD files?  It looks to me like it's already in key-value pair format and should be relatively easy to parse (of course perhaps not with bash; I always use Perl for tasks like this).

Offline

#16 2014-04-04 19:59:50

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,092
Website

Re: [SOLVED] .AURINFO and makepkg --source

pgoetz wrote:

By the way, can you share some details about why it's hard to parse the metadata from PKGBUILD files?  It looks to me like it's already in key-value pair format and should be relatively easy to parse (of course perhaps not with bash; I always use Perl for tasks like this).

You can start by looking at the grub and linux PKGBUILDs as well as any haskell PKGBUILD.

Offline

Board footer

Powered by FluxBB