Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 207831 - "rpmbuild -ta example.tar.bz2" sometimes files to extract specfile
Summary: "rpmbuild -ta example.tar.bz2" sometimes files to extract specfile
Status: CLOSED DUPLICATE of bug 206841
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 5
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2006-09-24 07:32 UTC by Mark Doliner
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-09-25 07:35:33 UTC

Attachments (Terms of Use)
Possible fix for this bug (deleted)
2006-09-24 07:32 UTC, Mark Doliner
no flags Details | Diff

Description Mark Doliner 2006-09-24 07:32:52 UTC
Description of problem:
In certain cases "rpmbuild -ta example.tar.bz2" will fail to extract the
specfile from within the archive, which results in failure to build the RPM and
a poor error message.

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

How reproducible:
100% of the time, assuming the following conditions

Steps to Reproduce:
1. Using GNU tar 1.15.92 or more recent
2. Using a tar.bz2 (I did not test whether this bug affects tar.gz)
3. The specfile within the tar is named "something.spec" and not "Specfile"
4. Run "rpmbuild -ta example.tar.bz2"
Actual results:
rpmbuild exits after printing the following error messages are printed:
error: Name field must be present in package: (main package)
error: Version field must be present in package: (main package)
error: Release field must be present in package: (main package)
error: Summary field must be present in package: (main package)
error: Group field must be present in package: (main package)
error: License field must be present in package: (main package)

These messages are printed because the specfile was not extracted from the
tarball.  Instead, the SPECS directory will contain a 0 byte file with the name
"tar: Pattern matching characters used in file names. Please,"  Additionally,
nothing will be placed in the SOURCES or BUILD directories.

Expected results:
The spec file will be written to the SPECS directory, the tarball will be copied
to the SOURCES directory, and the build will continue in the BUILD directory.

Additional info:
This is caused by a change in GNU tar 1.15.92.  As of this version, the
"–wildcards" option must be passed to tar when using wildcard matching, and
rpmbuild uses a wildcard when trying to extract the specfile from bz2balls.  See for details on the
change to tar.

The attached patch is a hint for someone who wishes to fix this.  I did not test
the patch.  I do not know if passing the "--wildcards" option to tar will work
with versions of tar pre 1.15.92, but I have a hunch that it'll be fine (I get
the feeling that this option has been around for quite some time).

Comment 1 Mark Doliner 2006-09-24 07:32:52 UTC
Created attachment 137010 [details]
Possible fix for this bug

Comment 2 Mark Doliner 2006-09-24 07:34:23 UTC
To RPM builders, a possible workaround is to rename the specfile from
"whatever.spec" to "Specfile"

Comment 3 Mark Doliner 2006-09-24 09:02:52 UTC
Looking at the workaround I mentioned in comment #2... I guess it's pretty
unlikely that will work.  I thought it would because rpmbuild first tries to
extract "Specfile" and then tries to extract "*.spec"  However the call that
tries to extract "Specfile" doesn't seem very useful to me--I think it only
works when Specfile is at the first root of the tarball (not in a directory). 
In Gaim tarballs (and other projects I've seen), the specfile will actually be
located under the "gaim-2.0.0-beta3/" directory for example.

Comment 4 Paul Nasrat 2006-09-25 07:35:33 UTC

*** This bug has been marked as a duplicate of 206841 ***

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