Issuing a 'build all' command [ > rpm -ba ........ ] on a .spec file that utilizes the BuildRoot tag and contains a command to create a symbolic link [ > ln -s ...... ....... ] results in an error. I have read about this problem before, but have not found a good solution to it yet. Am I forgetting something, or is there a way around this??
Here are the commands that I issue related to this error (these commands are located in the %install portion of the .spec file):
> rm -rf $RPM_BUILD_ROOT/usr/local/bin/foo.sh
> ln -sf $RPM_BUILD_ROOT/usr/local/TestDir/foo.sh $RPM_BUILD_ROOT/usr/local/bin/foo.sh
-note that I have the BuildRoot: tag set to the following directory in my home directory: home/fry/RPMHome/
I also have the following files in the %files section of the .spec file:
It has been my understanding that I do not include the $RPM_BUILD_ROOT variable in the files section, and that it will be automatically prepended.
-note also that under the home/fry/RPMHome directory, I have the necessary directory structure set up [ usr/local/bin ]
This is the error that I receive:
> error: Symlink points to BuildRoot: /usr/local/bin/foo.sh -> /home/fry/RPMHome/usr/local/TestDir/foo.sh
note that the BuildRoot [ home/fry/RPMHome/ ] is not included in the above error description (the link portion). After receiving this error, an ls -l command in the /home/fry/RPMHome/usr/local/bin/ directory reveals that in fact the link was created and that it points to the correct file (under the BuildRoot), but it is highlighted in red indicating that something is wrong with it.
I also have the .rpmmacros file and the necessary rpm file directorty structure set up in my home directory such that I can create the RPM has a non-superuser. I am running RPM verion 4.0.2. When I comment out the ln command, the RPM will be built successfully.