[Rpm-ecosystem] Trying to understand %buildsubdir and debuginfo generation

Jason L Tibbitts III tibbs at math.uh.edu
Fri Apr 27 00:45:47 UTC 2018


To sort of answer my own question...

It isn't %build that's important.  There simply must be some other
section between %prep and %install.

What I think happens is this:

The parser is running through %prep, doing whatever it does (expanding
macros and building the script that will be executed, I guess).  It sees
%install, which is defined as a macro, so it goes to expand it.  At that
moment, %buildsubdir hasn't actually been defined as a macro because rpm
is still parsing and hasn't executed anything (specifically the magic
%setup macro).  So because %buildsubdir is not defined, %install just
expands to... %install.

An easy way to test this is to just move the %check section up above
%install.   And... it works.  Even just adding an empty %clean section
works fine.

So I guess this is down to two things:
* RPM parsing is deep magic and will hurt your brain.
* Redefining the section "macros" is a recipe for "fun".

I have no idea if this weirdness would be considered a bug.  I'll file a
ticket if someone thinks it's worth it, but outside of R packages, I
would expect there to be relatively few archful packages that would
legitimately not have a %build section.

 - J<


More information about the Rpm-ecosystem mailing list