Bug 62584 - %define in spec-file overrides define given on command-line
Summary: %define in spec-file overrides define given on command-line
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 7.2
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Keywords: FutureFeature
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-04-02 20:14 UTC by David Juran
Modified: 2008-05-01 15:38 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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.


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