I was able to create a relocatable RPM. But in the %post section I need to do some other things like creating some symbolic links. The issue is that I cannot find in the RPM docs info on the actual install dir macro. E.g., %_prefix is hard-coded to /usr regardless of actual reallocation. How do I get the actual install dir in %post? Thanks for help.
Asked
Active
Viewed 260 times
2
-
1I think the answer is "don't do that". Why are you creating links in `%post` anyway? What are you doing? – Etan Reisner May 21 '15 at 04:09
-
I saw other software doing a ver link and I'd like to do the same. E.g., SW is installed in /opt/company/cool_software-1.0 and another version in /opt/company/cool_software-1.2, so two versions could co-exist, then they create a link: /opt/company/cool_software which points to the lastly installed SW. So the link is used for selecting the "default" version. It works, if I do not specify "Prefix" and all my paths are hard-coded in .spec. With the relocation, I could not find a way in the .spec to know what the actual relocated install path is, co I cannot create the link. – Andy Hoffman May 21 '15 at 15:54
-
1See my answer [here](http://stackoverflow.com/a/28373146/258523) for [this question](http://stackoverflow.com/q/28348561/258523). (I knew this sounded familiar.) I still think this isn't a good idea *except* if the link doesn't already exist. Also relocatable RPMs are generally not very useful to my mind. – Etan Reisner May 21 '15 at 16:23
-
1if you ARE shipping multiple non-conflicting versions of the same app, remember: you're going to have to set %name to be cool_software10 and cool_software12 so they don't conflict on the name and the newer one doesn't update (ie remove) the older. .. but then you have to take into account dependencies, and then add in virtual %provides, and that kind of thing. Really, really, there's very, very little reason why you'd want to do that kind of thing, and the cost should make it seem very unappealing. Even at the OS we had only few reasons (alt-packages) why we'd even want to consider. – user2066657 Aug 24 '17 at 02:29