Bug 64482

Summary: Subpackage conflicts with define package parameter
Product: [Retired] Red Hat Linux Reporter: Need Real Name <pedrum>
Component: rpm-buildAssignee: Jeff Johnson <jbj>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-05-06 16:49:28 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 Need Real Name 2002-05-06 16:49:24 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc1) Gecko/20020417

Description of problem:
I was trying to create subpackages but I kept on getting "Package does not
exist." I traced this to conflicting namespace with the "package" define. I
suppose "package" is a special global variable that %package uses. However, an
more useful error message would be nice.

See also 62584

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


How reproducible:
Always

Steps to Reproduce:
rpmbuild --define="dpackage daphne" daphne.spec

works, but 

rpmbuild --define="package daphne" daphne.spec

dosen't.

Actual Results:  error: line 17: Package does not exist: %description TEST


Expected Results:  A couple subpackages were supposed to be built.

Additional info:

Comment 1 Jeff Johnson 2002-05-09 14:33:34 UTC
%package is a spec file section marker, not a macro. You may
see what macros are defined at any point in a spec file parse
by putting in a %dump. The construct
	--define 'package daphne'
has no well defined or supported use AFA rpm is
concerned.

I suggest that
	Package does not exist.
is a precise and accurate albeit unhelpful
in your case.

Comment 2 Jeff Johnson 2002-05-09 14:35:00 UTC
Hmmm, well section markers can be overloaded
so
	--define 'package daphne'
actually eliminates the section marker. This
is a feature, not a bug. Apologies for the
confusion.

Comment 3 Need Real Name 2002-05-09 15:08:15 UTC
There are two problems really. 

I am not very familiar with the internals of RPM but the first error message was
complaining about a missing package with respect to a "TEST" sub-package, so I
thought I was doing something wrong with subpackages.

Second, I was using defines to abstract out stuff (package name, version,
release ) etc across multiple packaging scripts and using the --define was very
useful for this. However, can't there be a warning that we're overriding a
special internal token. Can you see a case where overriding a section marker is
actually a good thing?

Comment 4 Jeff Johnson 2002-05-09 15:51:58 UTC
Overriding a section marker with a macro
is quite a good thing. Try putting
into /etc/rpm/macros

	%build() %%build %* \
	exec 2> %{_tmppath}/%{name}.buildlog

Basically it's possible to prepend shell
commands to build scriptlets without editing
spec files by overloading scetions with macros.