A simple example in a shell script would be to evaluate %{_sourcedir}
$ rpm --eval '%{_sourcedir}'
This is fine and works as expected when %{_sourcedir} itself contains no macro names.
However in my ~/.rpmmacros I have %_sourcedir defined as follows:
%_sourcedir %{_topdir}/SRC/%{name}
Again this works correctly when building the rpm, but I need the correct value of %{_sourcedir} as defined in the spec file I am using, but I need to evaluate it from a shell script.
There is an rpm option --specfile XXXX but neither of the following works:
$ rpm --eval '%{_sourcedir}' --specfile /path/to/specfile.spec $ rpm --specfile /path/to/specfile.spec --eval '%{_sourcedir}'
Is there any way to extract the correct value of %_sourcedir (or any other macro defined this way)?
Thanks for any pointers,
Regards,
Simon
_______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list