FC4 spec file problem: %define doesn't work

Paul Howarth paul at city-fan.org
Mon Feb 20 12:53:58 UTC 2006


Robinson Tiemuqinke wrote:
> Hi, 
> 
>  I found a strange problem with "%define" in .spec
> file. my rpm version is 4.4.1-22.
> 
>  The problem is: The defined value with '%define' can
> not be refered -- see the mykver variable defined with
> "%define" which trying to
> represent kernel version like "26" or "24". But it
> failed to be refered later and I had to comment
> '%define' out
> and directly put the expression in the "Release:"
> statement.
>  
>  I've seen a lot of '%define' in use in other .spec
> files before, then what
> is my problem?? Please help.
> 
> ...
> ##
> ## failed to resolve Release with '%define' statement
> ##
> %define mykver %(echo `/bin/uname -r | /bin/cut -c1-3
> | /bin/sed -e 's/\.//g'`)

You need to escape the backslash in the %define:

%define mykver %(/bin/uname -r|/bin/cut -c1-3|%{__sed} -e 's/\\.//g')

Paul.




More information about the users mailing list