>The option --root does not permit "building by non-root", but rather
>ttempts to do a chroot(2) during a build, and concatenates strings
>to build paths to files to create before doing the chroot(2).
But it also does not work what I build RPM as root.
There is a bug with double concatenation of string,
specifically with DOUBLE CONTENCATION to of variable set in --root option
when scanning for the files to be included to RPM.

I dig it more.
This is more information:
When processing rpm in gdb I see
build/file.c: around line 1270
/* XXX spec->buildRootURL == NULL, then xstrdup("") is returned */
fl.buildRootURL = rpmGenPath(spec->rootURL, spec->buildRootURL, NULL);
(gdb) print fl.buildRootURL
$6 = 0x813ae48
"/tmp/y2/tmp/y2/var/tmp/backupconfig.clienthost.clientdomain.com-buildroot"
(gdb) print spec->rootURL
$7 = 0x8138230 "/tmp/y2"
(gdb) print spec->buildRootURL
$8 = 0x8141780
"/tmp/y2/var/tmp/backupconfig.clienthost.clientdomain.com-buildroot"
So the --root /tmp/y2/ variable as prefix was already added to path
when creating spec object
and then, it was added again in build/file.c: around line 1270
So I think one of them is definitiely wrong.
It should be addedd only once.

Note

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