Bug 129179 - rpmbuild --macros=filename does not read the specified file
Summary: rpmbuild --macros=filename does not read the specified file
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2004-08-04 19:49 UTC by Bob Langford
Modified: 2012-12-01 00:04 UTC (History)
2 users (show)

Clone Of:
Last Closed: 2004-08-05 13:00:40 UTC

Attachments (Terms of Use)

Description Bob Langford 2004-08-04 19:49:51 UTC
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 13:00:40 UTC
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-12-01 00:04:12 UTC
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.