Hello All!
One of my packages defines an essential information regarding the API (API version string) during the %build stage. It's possible to extract this information by invoking a binary from the %{buildroot} with certain parameters. I'd love to add this information to the spec-file during to Provides. Something like
Provides: %{name}_api_ver = %(%{buildroot}/bin/app --some params)
Unfortunately it seems that rpmbuild tries to expand all macros at the very initial stage when this binary isn't available yet (not built yet). I've tied playing with %{eval: ...} but without any luck.
Could anyone tell me if it's possible at all? And if possible how could this be achieved?
Also I wonder why even rpmbuild -bs performs macro expansion? I thought it should just pack spec-file and sources/patches together.
On 02/11/14 19:33, Peter Lemenkov wrote:
Also I wonder why even rpmbuild -bs performs macro expansion? I thought it should just pack spec-file and sources/patches together.
Well the source file names often include macros like %version so it will have to expand macros in order to find out what source files to include in the archive.
Tom
On Sun, Nov 02, 2014 at 11:33:00PM +0400, Peter Lemenkov wrote:
One of my packages defines an essential information regarding the API (API version string) during the %build stage. It's possible to extract this information by invoking a binary from the %{buildroot} with certain parameters. I'd love to add this information to the spec-file during to Provides. Something like Provides: %{name}_api_ver = %(%{buildroot}/bin/app --some params)
I think you could do this with a dependency genrator -- see http://rpm.org/wiki/PackagerDocs/DependencyGenerator. However, this may be a little bit abusive as the intention is to have generalized per-language generators....
packaging@lists.fedoraproject.org