How to undefine macro on rpmbuild command line?

Miroslav Suchý msuchy at redhat.com
Fri Apr 12 15:06:02 UTC 2013


Hi,
I'm building packages for software collection (SC). And I'm trying set 
up our environment, that we are able to build SC and regular package 
from one spec.

I have 4 options how I can build package:

1) When I do not have meta-package installed (just for record meta 
package only includes one file /etc/rpm/macros.ruby193-config, which 
only contains this definition:
%scl ruby193
) So when I do not have this package installed and want to build regular 
package I will run:
   rpmbuild -ba foo.spec
And this will probuce foo.rpm.

2) When I do not have meta package installed and I run:
   rpmbuild -ba --define 'scl ruby193' foo.spec
it will produce ruby193-foo.rpm

3) When I have meta package installed and I run:
   rpmbuild -ba foo.spec
it will produce ruby193-foo.rpm

4) And now I have meta package and despite it I want to produce regular 
package (i.e foo.rpm). How can I achieve it?
I tried to experiment with something like:
   rpmbuild -ba --define '%undefine scl' foo.spec
but neither this nor everything else I tried work.

So my question is: How can I undefine macro on rpmbuild command line?
-- 
Miroslav Suchy
Red Hat Systems Management Engineering


More information about the Rpm-list mailing list