Bug 75550

Summary: --relocate is ignored & RPM_INSTALL_PREFIX isn't defined
Product: [Retired] Red Hat Linux Reporter: Todd Allen <redhatbugzillaold>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 8.0CC: ashishash_gandhi, chris.ricker, chuck, ctalk, dan, jason, jim.fisher, sandor.szabo, techinfo
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-11-16 20:10:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Makefile
none
"it" rpm spec none

Description Todd Allen 2002-10-09 20:44:40 UTC
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.
2. make
3. rpm -ivh --relocate /usr/opt=/elsewhere it-1.0-1.i386.rpm
4. rpm -ql it

Actual Results:

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.

Expected Results:

The "rpm -ivh" command should dump:
   RPM_INSTALL_PREFIX=/elsewhere
   RPM_INSTALL_PREFIX0=/elsewhere
The "rpm -ql" command should report:
   /elsewhere/smurf/it
   /elsewhere/it/it

Additional Information:
	
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.

Comment 1 Todd Allen 2002-10-09 20:46:19 UTC
Created attachment 79705 [details]
Makefile

Comment 2 Todd Allen 2002-10-09 20:46:51 UTC
Created attachment 79706 [details]
"it" rpm spec

Comment 3 Jason Merrill 2002-11-05 05:21:26 UTC
*** Bug 76326 has been marked as a duplicate of this bug. ***

Comment 4 Jeff Johnson 2002-11-16 20:08:23 UTC
*** Bug 77967 has been marked as a duplicate of this bug. ***

Comment 5 Jeff Johnson 2002-11-16 20:10:33 UTC
*** Bug 77433 has been marked as a duplicate of this bug. ***

Comment 6 Jeff Johnson 2002-11-16 20:12:08 UTC

*** This bug has been marked as a duplicate of 75057 ***

Comment 7 SHwareSyst 2003-02-14 18:41:56 UTC
--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

Comment 8 ashish gandhi 2005-10-21 12:31:35 UTC
hi This is my spec file which i used to create rpm----

%define VCS ashish
                                                                               
                                  
                                                                               
                                  
Provides: /%{VCS}
Prefix: /etc%{provides}
                                                                               
                                  
                                                                               
                                  
%files
%{prefix}/conf/sample_WebSphere5/main.cf
%{prefix}/conf/sample_WebSphere5/WebSphere5Types.cf
/opt%{provides}/bin/WebSphere5/monitor
/opt%{provides}/bin/WebSphere5/WebSphere5.pm
/opt%{provides}/bin/WebSphere5/WebSphere5.xml
                                                                               
                                  
-------------------
i had problem for using multiple prefix and in relocations

in my file list i had directory structure such as follows
/etc/ashish/conf/sample_WebSphere5/main.cf
/etc/ashish/conf/sample_WebSphere5/WebSphere5Types.cf
/opt/ashish/bin/WebSphere5/monitor
/opt/ashish/bin/WebSphere5/WebSphere5.pm
/opt/ashish/bin/WebSphere5/WebSphere5.xml

so i had the problem of multiple relocations

i wanted to relocate /etc/ashish/* to /etc/gandhi/* and /opt/ashish/* to
/opt/gandhi/*.

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
<pkgname>.rpm

it worked

as wll as

rpm -i <pkgname>.rpm

worked

thankx

ashish gandhi