Bug 62584

Summary: %define in spec-file overrides define given on command-line
Product: [Retired] Red Hat Linux Reporter: David Juran <djuran>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2Keywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-04-02 20:15:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Juran 2002-04-02 20:14:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020313

Description of problem:
%define statements given in the spec-file overrides --define given on the
command line

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


How reproducible:
Always

Steps to Reproduce:
While building a package from it's src rpm e.g. rpm itself, there is a define in
the spec-file
%define
with_python_subpackage
1%{nil}
Now I would like to be able to use the command 
rpm --rebuild --define='with_python_subpackage	0'
to build a package without python. But I can't because the define in the
spec-file overrides me command line option. I think it would be better if it
were the other way around, i.e. anything given on the commandline would override
statements in the spec-file

1.
2.
3.
	

Actual Results:  %{with_python_subpackage} evalutes to 1 no matter what I write
on the command line

Expected Results:  %{with_python_subpackage} evalutes to whatever I write on the
command-line

Additional info:

Comment 1 Jeff Johnson 2002-04-03 22:09:14 UTC
Yes spec file defines take precedence.

You can change this behavior by testing
whether a given macro is already defined.

%{!?with_python_subpackage:%define with_python_subpackage whatever}

Simply editing the rpm spec file works as well.