Customize RPM behavior by using macros

Customize RPM behavior by overriding RPM macros in configuration files with your custom macros.

About this task

You can override any macros, except the built-in macros, in the ~/.rpmmacros file. Any changes that you make affect every build on every system sharing the same home directory.

Note
To override macros on a per-machine basis, put these macros in a /etc/rpm/macros.* file.
Warning
It is not recommended to use new macros that you defined in the ~/.rpmmacros file in packaging. Such macros would not be present on other machines, where users might want to try to rebuild your package.

Procedure

Customize a macro:
            %_topdir /opt/<directory>/rpmbuild
          

You can create the <directory>, including all subdirectories, by using the rpmdev-setuptree utility.

Note that the value of this macro is by default ~/rpmbuild.