How to know the value of built-in macro in RPM?

Amumu picture Amumu · Nov 10, 2011 · Viewed 9.6k times · Source

How do I view the value of these macros in RPM? I can take a guess that %_bindir is /usr/bin, %_tmppath is /tmp, but: how exactly do I view these values and are their values system-dependent?

%_prefix 
%_exec_prefix 
%_bindir 
%_sbindir 
%_libexecdir 
%_datadir 
%_sysconfdir 
%_sharedstatedir 
%_localstatedir 
%_libdir 
%_includedir 
%_oldincludedir
%_infodir 
%_mandir 
/usr 
%{_prefix) 
%{_exec_prefixl/bin 
%{_exec_prefix}/sbin 
%{_exec_prefix}/libexec 
%{_prefixJ/share 
%{_prefix}/etc 
%{_prefixJ/com 
%{_prefix}/var 
%{_exec_prefix}/lib 
%{_prefix}/include 
/usr/include 
%{_prefix}/info 
%{_prefixl/man 

Answer

Corey Henderson picture Corey Henderson · Nov 24, 2011

Use the --eval switch:

$ rpm --eval '%{_rpmdir}'
/usr/src/redhat/RPMS