Bug 129179 - rpmbuild --macros=filename does not read the specified file
rpmbuild --macros=filename does not read the specified file
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2004-08-04 15:49 EDT by Bob Langford
Modified: 2012-11-30 19:04 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-05 09:00:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Bob Langford 2004-08-04 15:49:51 EDT
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

Version-Release number of selected component (if applicable):
RPM 4.3.1

How reproducible:

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.
Comment 1 Jeff Johnson 2004-08-05 09:00:40 EDT
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.
Comment 2 Penelope Fudd 2012-11-30 19:04:12 EST
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.


Note You need to log in before you can comment on or make changes to this bug.