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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


I also have one further question.

I was reading this stack overflow thread ( and began to wonder if it is better to write spec file this way:
rm -rf %{buildroot}
mkdir %{buildroot}
ln -sf /foo/bin %{buildroot}/bar/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 ln -sf %{foo_prefix}/bin %{bar_prefix}/newbin so %{foo_prefix} and %{bar_prefix} get changed during rpm installation depending on specified prefixes?


2014-10-18 23:34 GMT+02:00 Domen Vrankar <domen.vrankar@xxxxxxxxx>:

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/symlink

and the other was simply


am 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?

Domen Vrankar

Rpm-list mailing list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux