macro expansion problems

Adrian Reber adrian at lisas.de
Mon Jul 9 09:42:12 UTC 2018


I am trying to define a macro and it seems I do not understand the macro
expansion correctly.

The macro I want to use, uses a variable which is defined later and I
cannot get it right. The following is a short example of what I would
like to do:

%global debug_package %{nil}
%global newname %(eval echo %{extname} | tr [a-z] [A-Z])
%global extname lower
Name: %{extname}
Version: 1
Release: 1
Summary: Summary
License: yes
%description
%{newname}

# rpmspec -q test.spec --parse 
Name: lower
Version: 1
Release: 1
Summary: Summary
License: yes
%description
%{EXTNAME}


I understand the result but I tried many variants with expand to get it
working, but I failed. This is on CentOS 7.

Is it possible to change the value of a variable in a macro with a
variable which is defined later?

		Adrian


More information about the Rpm-list mailing list