When we define variables using the
%define tag in a spec file to build an RPM using the rpmbuild command … is it possible to update its value on %pre and use it later on ?
When we define variables using the %define tag in a spec file to build
Share
No.
%definemacros are always re-evaluated, top to bottom in the spec file, so you cannot have loops.%globalmacros are one-time.Example, from another question concerning ‘requires’ processing:
If I had used
%defineto declare__find_requires_orig, it would error out with a macro loop.If this doesn’t answer your question, please elaborate what information you are looking for, or your end goal.
ETA:
The
%preand%postsections will already have the macros hard-coded from when the RPM is built. If you need additional run-time decisions to be made, they will need to be done in those shell scripts.