[Rpm-maint] [rpm-software-management/rpm] Add %postbuild section / Allow dynamic sub packages (#1239)

Florian Festi notifications at github.com
Tue May 26 08:03:01 UTC 2020


> I'd rather see this pushed to an external file entirely. That would
> 
>     * drive the intended usage home with a sledgehammer
> 
>     * make it easier to generate spec fragments from %build
> 
>     * simplify the parsing as you don't need to try not to parse a thing when you're parsing that thing
> 
>     * be just as easy for complicated macro ecosystems
> 
> 
> External files could maybe presented as spec tags (instead of sections) resembling SOURCE, and thus allowing multiple files. Come to think of it, you'd actually want to ship the generated spec fragments in an src.rpm for reproducability / inspectability (this part will require some serious thinking regardless of syntax details). So how about something like
> 
> ```
> SpecN: <file>
> ```
> 
> ...where N > 0 because the spec itself is always 0. And these are then parsed after the build phase, post %install more like it. The tag name should probably indicate this somehow, but no ideas for that atm.

I am not 100% sure why this rubs me the wrong way. It just doesn't feel right. A few thoughts and  observations:

It is hard to generate spec file fragments from within the spec. Just doing `echo > file <<EOF` doesn't really work as the parser will pick up every line with a `%` and starts the new section right there - no matter wether you thing you are still in `build` or not. Sure this can be worked around but it's really inconvenient.

I'd guess that there are use cases where the sub package declarations are not entirely automatically created but they contain hand crafted pieces. I really dislike this idea of these pieces moving to some files that are added as Sources. All hand written spec syntax should be in the spec file itself IMHO.

Then there is the question of saving the generated content. This is a tricky one. I see that having this later one to understand how the package came to be might be very useful. Otoh there is something very wrong there. First what if the spec fragments are still "dynamic" in the sense that they do calculation and includes on parsing. If they are not only generated from the content of the build directory but actually use the build directory this will not work. The next question is where would they actually live. If they are created in the build dir they cannot be unpacked on SRPM installation. We'd need a new subdir for them. Or have them generated in the SPEC dir - which seem very wrong. Especially given that multiple package can step on each others toes there.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1239#issuecomment-633873283
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200526/e52ba561/attachment.html>


More information about the Rpm-maint mailing list