Description of Problem:
If the --relocate option is specified when installing an rpm, it is ignored.
(Although it does still do syntax checking on it.) The rpm contents end up
being installed in the default place.
Also, the RPM_INSTALL_PREFIX and RPM_INSTALL_PREFIXn environment variables are
left undefined, regardless of whether or not --relocate was specified. This
actually is worse for those of us rpm writers packagers who use that variable in
the target of a symlink. The symlink ends up pointing into the weeds.
Version-Release number of selected component (if applicable): 4.1-1.06
How Reproducible: every time
Steps to Reproduce:
1. Get the Makefile and it.spec that I'll put in attachments.
3. rpm -ivh --relocate /usr/opt=/elsewhere it-1.0-1.i386.rpm
4. rpm -ql it
The "rpm -ivh" command will dump any RPM-related environment variables. There
will be none. The "rpm -ql" command will show that the files are installed in
/usr/opt and not /elsewhere.
The "rpm -ivh" command should dump:
The "rpm -ql" command should report:
This works with 4.0.4 (from 7.3) and 4.1-0.81 (from 7.3.94/null).
Furthermore, an rpm built with 4.1-1.06 can be installed properly on a system
with 4.1-0.81. So, it appears to be a bug in the rpm command doing the
installation, as opposed to the rpmbuild building it.
Created attachment 79705 [details]
Created attachment 79706 [details]
"it" rpm spec
*** Bug 76326 has been marked as a duplicate of this bug. ***
*** Bug 77967 has been marked as a duplicate of this bug. ***
*** Bug 77433 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of 75057 ***
--relocate is/was broken in rpm-4.1. This is now fixed in rpm-4.2
Added for folks linking here from ActiveState download pages
hi This is my spec file which i used to create rpm----
%define VCS ashish
i had problem for using multiple prefix and in relocations
in my file list i had directory structure such as follows
so i had the problem of multiple relocations
i wanted to relocate /etc/ashish/* to /etc/gandhi/* and /opt/ashish/* to
with the rpm -install time i had problem in using multiple prefixes
so with above solution it worked well
i typed the commands as
rpm -i --relocate /opt/ashish=/opt/gandhi --relocate /etc/ashish=/etc/gandhi
as wll as
rpm -i <pkgname>.rpm