From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 Description of problem: The --macros=file1:file2:...:fileN option on the rpmbuild command does not work. 'rpmbuild --help' provides the following description: --macros=<FILE:...> read <FILE:...> instead of default file(s) 'rpmbuild --usage' lists an option with that syntax as well. 'man rpmbuild' does not list that as an option. Given the difference, I don't know if the man page is correct, or the program. Version-Release number of selected component (if applicable): RPM 4.3.1 How reproducible: Always Steps to Reproduce: 1. Create a file with a macro def in it. Call it foo 2. Do rpmbuild --macros=foo --showrc > logfile.with 3. Do rpmbuild --showrc > logfile.without Both log files will be identical Actual Results: The --macros=foo option had no effect. Expected Results: The macro defined in the file should be listed in the output. Additional info: It's considered bad practice to build RPMs as root. This feature of rpmbuild would go a long way toward making it easier to build RPMs as a regular user.
Create an 2 line rpmrc file: include: /usr/lib/rpm/rpmrc macrofiles: /usr/lib/rpm/macros:...:/path/to/your/macros changing "..." and "/path/to/your" as appropriate. Invoke rpm using --rcfile /path/to/yout/rpmrc.
This doesn't work now (rpm-build-4.8.0-27.el6.x86_64). The 'macrofiles:' line in the rpmrc file is being ignored. The '--macros=foo' command line option works, but replaces the predefined macro list. The '--showrc' command line option doesn't show macros even though they're working. I don't see any way to find the predefined macro list, so I used strace and cobbled together some files and glob patterns in order to generate a reasonable --macros=... command line parameter that lets me add my macro file to the end of the normal list of macro files. Thanks