26

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 
Jeff Schaller
  • 2,352
  • 5
  • 23
  • 38
Amumu
  • 17,924
  • 31
  • 84
  • 131

2 Answers2

31

Use the --eval switch:

$ rpm --eval '%{_rpmdir}'
/usr/src/redhat/RPMS
Corey Henderson
  • 7,239
  • 1
  • 39
  • 43
16

The --showrc option...

rpm --showrc

...will dump the complete rpmrc to stdout. This will expose all sorts of interest definitions from the innards of RPM. But Corey's answer is better for finding the value of a particular symbol.

Codemonk
  • 403
  • 2
  • 5