[rpm] Correct way of writing spec file when packaging symlinks

Domen Vrankar domen.vrankar at gmail.com
Sun Oct 19 08:29:24 UTC 2014


> For re-locateable the symlink must be relative, it can not be absolute.
>
> ln -sf ../../foo %{buildroot}%{_datadir}/bar
>

Thanks this works for the basic case.
However relative symlinks would work in cases when only symlink location
can be changed but since rpm supports --relocate flag it can happen that
also source file/directory can be relocated and then the relative path no
longer helps.
Is there a non workaround solution for this or is this simply not supported
by rpm out of the box?

For a workaround solution I guess that overriding existing symlink in %post
section would work:
rm ${RPM_INSTALL_PREFIX1}/bar
ln -sf ${RPM_INSTALL_PREFIX0}/foo ${RPM_INSTALL_PREFIX1}/bar
This way rpm would keep track of symlink file and symlink would point to
the right location.
Is there a better workaround solution - something that would hide the fact
that the file was changed when querying rpm package for changes with -V?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20141019/dd1879f0/attachment.html>


More information about the Rpm-list mailing list