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",
+ sprintf(cmd, "%s < %s | tar --wildcards -xOvf - \\*.spec 2>&1 > %s",
zcmds[res & 0x3], arg, tmpSpecFile);
if (!(fp = popen(cmd, "r"))) {
rpmError(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));