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): rpm-4.4.2-15.2 rpm-build-4.4.2-15.2 rpm-libs-4.4.2-15.2 rpm-python-4.4.2-15.2 tar-1.15.91-1 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 http://www.gnu.org/software/tar/manual/html_node/Changes.html 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).
Created attachment 137010 [details] Possible fix for this bug
To RPM builders, a possible workaround is to rename the specfile from "whatever.spec" to "Specfile"
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.
*** This bug has been marked as a duplicate of 206841 ***