3.3. Customizing RPM behavior by using macros
You can customize RPM behavior by editing the RPM macros. You can override any macros, except the built-in macros, in the ~/.rpmmacros file with your custom macros. Any changes that you make affect every build on every system sharing the same home directory.
To override macros on a per-machine basis, put these macros in a /etc/rpm/macros.* file.
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>/rpmbuildYou can create the
<directory>, including all subdirectories, by using therpmdev-setuptreeutility.Note that the value of this macro is by default
~/rpmbuild.