I also have one further question.
I was reading this stack overflow thread (http://stackoverflow.com/questions/7521980/packaging-symlinks-via-rpmbuild) and began to wonder if it is better to write spec file this way:%install
rm -rf %{buildroot}
mkdir %{buildroot}
ln -sf /foo/bin %{buildroot}/bar/newbin
%files
/newbin
Or is it better to put symlink creation in %post section:
ln -sf /foo/bin /bar/newbin
The problem that I'm having is that I can not create a relocatable rpm with either of the above options. If I use --prefix= during installation then the first option points to an invalid location and the second option fails with an error during installation but the rpm still gets installed so both cases fail but make some changes to file system.
Can either of these options be made relocatable?
For e.g. is there a variable that can be used in second case (something like
For e.g. is there a variable that can be used in second case (something like
ln -sf %{foo_prefix}
/bin
%{bar_prefix}
/newbin so %{foo_prefix} and %{bar_prefix} get changed during rpm installation depending on specified prefixes?
Thanks,
Domen
2014-10-18 23:34 GMT+02:00 Domen Vrankar <domen.vrankar@xxxxxxxxx>:
Hi,I was searching the web and couldn't find an answer on how to correctly write a spec file when packaging symlinks.One option that I found was%config /path/symlinkand the other was simply/path/symlinkBased on Documentation http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.htmlam I correct in assuming that the second version (without any % prefix) is the correct format?Is there any difference in prefix if symlink points to directory or file?Thanks,
Domen Vrankar
_______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxxxxx http://lists.rpm.org/mailman/listinfo/rpm-list