From Bugzilla Helper: User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux) Description of problem: I see this problem mentioned with regards to RH8 and rpm < 4.2, but I seem to be seeing the same problem on RH9 with rpm-4.2-0.69. Here is a sample spec file: Summary: Test package Name: test-package Version: 1.0 Release: 1 Group: System Environment/Daemons License: GPL BuildRoot: %{_builddir}/%name-%version BuildArch: noarch Prefix: /usr/local %description This is a test package %pre echo "pre - RPM_INSTALL_PREFIX = \"$RPM_INSTALL_PREFIX\"" %install %post echo "post - RPM_INSTALL_PREFIX = \"$RPM_INSTALL_PREFIX\""; %files %changelog * Thu May 29 2003 Robert Flemming <flemming> - Test package Here are the results when install it on my RH9 system: foo:/tmp# rpm -ivh test-package-1.0-1.noarch.rpm Preparing... ########################################### [100%] pre - RPM_INSTALL_PREFIX = "" 1:test-package ########################################### [100%] post - RPM_INSTALL_PREFIX = "" foo:/tmp# rpm -ivh --prefix=/tmp test-package-1.0-1.noarch.rpm Preparing... ########################################### [100%] pre - RPM_INSTALL_PREFIX = "" 1:test-package ########################################### [100%] post - RPM_INSTALL_PREFIX = "" Now here is the same package being installed on a 7.2 machine with rpm-4.0.3-1.03 installed: [root@bar tmp]# rpm -ivh test-package-1.0-1.noarch.rpm Preparing... ########################################### [100%] pre - RPM_INSTALL_PREFIX = "/usr/local" post - RPM_INSTALL_PREFIX = "/usr/local" [root@bar tmp]# rpm -ivh --prefix=/tmp test-package-1.0-1.noarch.rpm Preparing... ########################################### [100%] pre - RPM_INSTALL_PREFIX = "/tmp" post - RPM_INSTALL_PREFIX = "/tmp" With $RPM_INSTALL_PREFIX returning nothing, all scripts are performing operations on the root file system, which is VERY bad in the context of the package I'm building. I've added a test in the pre section so I don't hose my test machine (again), but this is kind of a important problem. Robert Version-Release number of selected component (if applicable): rpm-4.2-0.69 How reproducible: Always Steps to Reproduce: 1. Use the included test-package spec file 2. 3. Actual Results: See above Expected Results: See what happens on RH 7.2 system as noted above Additional info:
Yup, RPM_INSTALL_PREFIX is not set in rpm-4.2.2 if there are no files in the package. Add files, you will see RPM_INSTALL_PREFIX set (verified with rpm-4.2.2, but I believe true all the way back to rpm-4.2). I do not think that not specifying a scriptlet envvar for a package that has no files that need relocating is a problem worth solving. Reopen this bug if you wish to argue.