Hi,
does anybody know a tool/script which pre-processes/parse and dumps a .spec file with preloaded RPM macros?
I'm working on a script which will build a set of source RPMs (or even a whole distribution) on a mock build server. The aim of it is to get well defined source RPMs with exact requirements (BuildReqs and Requres by running installation tests in mock in conjunction with ldd on multilib systems). The goal of this is to get all Packages mock-buildable and "certified".
I will have to shorten the build duration by calculating the package order with correlation algorythms on the package names.
But there are cases where correlation does not work - especially when SRPMs creates packages named different (e.g. mplayer(src) creates mencoder(bin)) and when scanning for "%files" or "%files -n" in the .spec returns unresolved macros. (Example: %files -n vdr-%{pname}-server)
When my build-from-scratch script is finished I will release it to the CentOS project, because it will be very important for automation and shorten the release time when (re)building the Distro.
Current features: - Building binary packages from SRPMS (in a repository) on a mock server via ssh - Creating root-logs, build-logs and missingdeps-logs - Bypassing bad packages (missdeps, build-failures) on next turns - Semi-"brute-force"-build: re-running as so long as no more packages are built.
Planned features: - Certification tests (post-install tests, respin/updates integration tests) - Handling cross-build issues in RPM - Exact build order and circular dependencies detection.
I think the solution for my problem can be found in the internals of the rpmbuild utility - if someone has a hint or solution of a .spec parser, he/she is welcome (Google did not satisfy me right now).
Thanks in advice
Brian