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:
%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.
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.
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?
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.