Bug 18281 - -bp not working with --root
Summary: -bp not working with --root
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm-build   
(Show other bugs)
Version: 6.2
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-10-04 02:04 UTC by Need Real Name
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-10-04 02:04:09 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Need Real Name 2000-10-04 02:04:06 UTC
I am trying to install and build a source RPM in an alternate location by
specifying --root.
(In case it matters, the RPM is mailx -- I'm planning to add some new
To start with, I just want to build it from source, without overlaying the
installed binary.)
This may be related to 11310 and/or 11510, or it may just be a matter of my
not understanding
how it is supposed to work.  If the latter, adding an example to the
manpage would be helpful.

$ rpm --root /var/tmp --initdb
[complained about a missing directory]
$ mkdir -p /var/tmp/var/lib/rpm
$ rpm --root /var/tmp --initdb
[appeared to work OK]
$ rpm --root /var/tmp -i --percent /cdrom/SRPMS/mailx-8.1.1-10.src.rpm
[complained about another missing directory]
$ mkdir -p /var/tmp/usr/src/redhat/SOURCES
$ rpm --root /var/tmp -i --percent /cdrom/SRPMS/mailx-8.1.1-10.src.rpm
[appeared to work OK]
$ cd /var/tmp
$ rpm --root /var/tmp -bp mailx
File is not a regular file: /var/tmp/mailx
$ rpm --root /var/tmp -bp /usr/src/redhat/SPECS/mailx.spec
File is not a regular file: /usr/src/redhat/SPECS/mailx.spec
$ rpm --root /var/tmp -bp /var/tmp/usr/src/redhat/SPECS/mailx.spec
File /usr/src/redhat/SOURCES/mailx-8.1.1.tar.gz: No such file or directory
$ cd /
$ rpm --root /var/tmp -bp /var/tmp/usr/src/redhat/SPECS/mailx.spec
File /usr/src/redhat/SOURCES/mailx-8.1.1.tar.gz: No such file or directory
$ ls -l /usr/src/redhat/SOURCES/mailx-8.1.1.tar.gz
ls: /usr/src/redhat/SOURCES/mailx-8.1.1.tar.gz: No such file or directory
$ ls -l /var/tmp/usr/src/redhat/SOURCES/mailx-8.1.1.tar.gz
-rw-r--r--    1 phutchis phutchis    89546 Mar 21  1999

As expected, specifying --root on the install caused the SRPM to be
installed under /var/tmp, but apparently neither the --root specification
nor the location of the current directory affects where the build will look
for the tarball -- it only looks in /usr/src/redhat/SOURCES.  This seems to
defeat the whole purpose of --root.  Am I doing something wrong?

Comment 1 Jeff Johnson 2000-10-04 14:59:53 UTC
--root  while building does not have the semantics you want to "... build a
source RPM in
an alternate location".

What you want to do is configure rpm to build in an alternate directory. For
	echo "%_topdir /your/directory/here" >> ~/.rpmmacros
will change the default /usr/src/redhat  hierarchy  used to build to

Comment 2 Need Real Name 2000-10-04 22:31:54 UTC
With that change, it now builds and runs successfully although the resulting
executable is about 2KB larger than the original binary.  Maybe there's a
difference in patch level.

$ pwd

$ ls -l usr/src/redhat/BUILD/mailx-8.1.1/mail mailx-root/bin/mail /bin/mail
-rwxr-xr-x    1 root     mail        62640 Aug  7 09:03 /bin/mail
-rwxr-xr-x    1 phutchis phutchis    64828 Oct  4 15:04 mailx-root/bin/mail
-rwxr-xr-x    1 phutchis phutchis    85778 Oct  4 14:58

Might I suggest enhancing the manpage to include this sort of info (or a pointer
to more extensive documentation if any exists -- "info rpm" finds only the

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