问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/53736277/prefix-and-reloctable-rpm-package-according-to-an-other-rpm-prefix