Hi there,
I got many error messages on FC5 fully updated trying to compile tar packages using "rpmbuild -ta tar_package.tar.gz" command.
I notice that rpmbuild was executing "/bin/tar xOvf - Specfile" and "/bin/tar xOvf - <package_name>.spec" commands to extract .spec files from the tar packages but without success. The rpmbuild command always create "/usr/src/redhat/SPECS/tar:\ Pattern\ matching\ characters\ used\ in\ file\ names.\ Please," and "tar:\ You\ must\ specify\ one\ of\ the\ `-Acdtrux'\ options" files in /usr/src/redhat/SPECS directory.
I solved this problem adding "-" before tar options and "--wildcards" to tar command in build.c file. (see attached patch).
Is this problem a rpmbuild bug? There is a way to fix if without patch / recompile rpm packages?
These are the steps to reproduce this problem:
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.tar.bz2 # tar -xjvf linux-2.6.18.tar.bz2 -C /usr/src # cd /usr/src/linux-2.6.18 # make oldconfig # make rpm make clean set -e; cd ..; ln -sf /usr/src/linux- 2.6.18 kernel-2.6.18 set -e; cd ..; tar -cz --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc --exclude .hg --exclude .git -f kernel-2.6.18.tar.gz kernel-2.6.18/* set -e; cd ..; rm kernel-2.6.18 set -e; \ /bin/sh /usr/src/linux-2.6.18/scripts/mkversion > /usr/src/linux-2.6.18 /.tmp_version set -e; \ mv -f /usr/src/linux-2.6.18/.tmp_version /usr/src/linux-2.6.18/.version rpmbuild --target i686 -ta ../kernel- 2.6.18.tar.gz Building target platforms: i686 Building for target i686 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) make[1]: *** [rpm] Error 1 make: *** [rpm] Error 2
("make rpm" executes "rpmbuild --target i686 -ta ../kernel- 2.6.18.tar.gz")
thanks, Márcio
Marcio Oliveira wrote:
Hi there,
I got many error messages on FC5 fully updated trying to compile tar packages using "rpmbuild -ta tar_package.tar.gz" command.
This is already filed: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=206841
I solved this problem adding "-" before tar options and "--wildcards" to tar command in build.c file. (see attached patch).
--- rpm-4.4.2/build.c.orig 2006-09-29 09:17:25.000000000 -0300 +++ rpm-4.4.2/build.c 2006-09-29 09:18:01.000000000 -0300 @@ -144,7 +144,7 @@ (void) isCompressed(arg, &res);
cmd = alloca(strlen(arg) + 50 + strlen(tmpSpecFile));
- sprintf(cmd, "%s < %s | tar xOvf - Specfile 2>&1 > %s",
- sprintf(cmd, "%s < %s | tar -xOvf - Specfile 2>&1 > %s", zcmds[res & 0x3], arg, tmpSpecFile); if (!(fp = popen(cmd, "r"))) { rpmError(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));
@@ -156,7 +156,7 @@ /* Try again */ (void) pclose(fp);
sprintf(cmd, "%s < %s | tar xOvf - \\*.spec 2>&1 > %s",
rpmError(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));sprintf(cmd, "%s < %s | tar --wildcards -xOvf - \\*.spec 2>&1 > %s", zcmds[res & 0x3], arg, tmpSpecFile); if (!(fp = popen(cmd, "r"))) {
Posting this patch to bugzilla would highly appreciated, I think.
Mamoru Tasaka