Bug 64482 - Subpackage conflicts with define package parameter
Subpackage conflicts with define package parameter
Product: Red Hat Linux
Classification: Retired
Component: rpm-build (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2002-05-06 12:49 EDT by Need Real Name
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-05-06 12:49:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-05-06 12:49:24 EDT
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:

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

works, but 

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


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 10:33:34 EDT
%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

I suggest that
	Package does not exist.
is a precise and accurate albeit unhelpful
in your case.
Comment 2 Jeff Johnson 2002-05-09 10:35:00 EDT
Hmmm, well section markers can be overloaded
	--define 'package daphne'
actually eliminates the section marker. This
is a feature, not a bug. Apologies for the
Comment 3 Need Real Name 2002-05-09 11:08:15 EDT
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 11:51:58 EDT
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.

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