Search code examples
rpmspecificationsrpmbuildrpm-spec

prefix and reloctable rpm package according to an other rpm prefix


I have install sample.rpm in /opt. I want samplw2.rpm find the relocation path of sample.rpm ad install itself in same place. is there any command or macro in spec file which check it befor installation or not?


Solution

  • I'm pretty sure this isn't possible; the file locations are fixed. The easiest solution would be to put them in a known location, and then set up a symlink in your %post, e.g. linking /opt/sample2 to /usr/local/sample2 where the latter is where the RPM puts the files.