[Rpm-maint] [rpm-software-management/rpm] Use full build template (#480)

Jeff Johnson notifications at github.com
Fri Jul 27 16:31:10 UTC 2018


One last comment based on my guess that your goal is debbuild development.

The rpmbuild spec file parser was never designed, only organically grown, and is full of weird corner cases in grammar and syntax.

The entire rpm spec file parser is structurally flawed: good parsers usually read an entire file, checking syntax, creating an internal structure that is more convenient to execute. Instead, bits of parsing are intermingled with execution throughout rpmbuild.

You can certainly duplicate that dynamic behavior in a perl script like debbuild. In fact RPMv1 was written in perl, and rpmbuild is likely to have been created by a perl programmer in 1996.

But you might find that debbuild would benefit from a pre-parser (like cpp wrto cc) that regularized the more exotic rpm spec file constructs away.

Once all the dynamic goop of macros, and BuildArch:, and ExcludeArch: and %ifarch, etc is stripped away, spec file become essentially Key: Value constructs that can be easily represented/implemented (modulo quoting/escaping/line breaks) in whatever markup or interpreter you wish.

One approach to simplifying all the build goop in spec files being pursued at RPM5 (and an RFE here) is to use the existing rpmbuild spec file parser -- in all its flaming glory -- to create tags in a SRPM header that are rather easily retrieved and executed by alternative builders

-- 
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/480#issuecomment-408471314
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180727/66d5a7b5/attachment-0001.html>


More information about the Rpm-maint mailing list