Bug 18281 - -bp not working with --root
-bp not working with --root
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: rpm-build (Show other bugs)
6.2
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-03 22:04 EDT by Need Real Name
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-03 22:04:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2000-10-03 22:04:06 EDT
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
functionality.
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
/var/tmp/usr/src/redhat/SOURCES/mailx-8.1.1.tar.gz

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 10:59:53 EDT
--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
example,
doing
	echo "%_topdir /your/directory/here" >> ~/.rpmmacros
will change the default /usr/src/redhat  hierarchy  used to build to
/your/directory/here.
Comment 2 Need Real Name 2000-10-04 18:31:54 EDT
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
/var/tmp

$ 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
usr/src/redhat/BUILD/mailx-8.1.1/mail

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
manpage)?

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