2

I am building an RPM from source tarball, patches, and a .spec file. I am doing so to add my platform-specific patch.

I have read the given .spec file, and got notice that there are lines such as:

%ifarch %{arm}

When I saw similar lines like that, I could sometimes see a definition, for example, as follows:

%global shared 0

Later on, %shared is used as 0. However, I could not find the definition of %arm. I guessed that it might be pre-defined, or defined somewhere else (system-wide?).

What does the %arm variable mean in a .spec file? If it is pre-defined, where is the definition?

2 Answers 2

0

If you look in /usr/lib/rpm/macros, arm is defined as a list of possible ARM architectures. So that macro is saying "if the target architecture matches any of these, do this..."

0

the %{arm} is just a RPM macro, like all the other RPM macros.

It expands out to some sort of actual value, to find that value, run the command

rpm --eval %{arm}

On my system that expands to

armv3l armv4b armv4l armv4tl armv5tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl

Which appears to be all of the supported arm architectures my development environment supports.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.