Sam Varshavchik wrote:
Paul Howarth writes:
Most packages avoid this problem by using relative softlinks instead of
absolute ones, e.g.
ln -s ../../some.dir/some.file $RPM_BUILD_ROOT/other.dir/some.file
instead of
ln -s /some.dir/some.file $RPM_BUILD_ROOT/other.dir/some.file
This then works both inside and outside the buildroot.
And how exactly would you propose to do that if you want to do the right
thing, and use only the autoconf-derived macros, %{_bindir},
%{_datadir}, et al, for your installation paths?
Do you always want to assume that going from %{_bindir} to %{_datadir}
is always "../share"?
# Figure out how deep down bindir is
touch $RPM_BUILD_ROOT/rootfile
root=..
while [ ! -r $RPM_BUILD_ROOT/%{_bindir}/${root}/rootfile ] ; do
root=${root}/..
done
# Install symlink from %{_bindir} to %{_datadir}
%{__ln_s} ${root}/%{_datadir}/some.file $RPM_BUILD_ROOT/%{_bindir}/some.file
# Clean up temporary files in buildroot
%{__rm} -f $RPM_BUILD_ROOT/rootfile
Technique as used in Fedora sendmail package.
Paul.