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
Macros may also be automatically included from /usr/lib/rpm/macros. In addition, rpm itself defines numerous macros. To display the current set, add "%dump" to the beginning of any spec file, process with rpm, and examine the output from stderr.
In most Unix shells, ~ is an abbreviation for "your home directory". So ~/. rpmmacros is the file . rpmmacros in your home directory.
rpmbuild is used to build both binary and source software packages. A package consists of an archive of files and meta- data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package.
Use the --eval
switch:
$ rpm --eval '%{_rpmdir}'
/usr/src/redhat/RPMS
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With