From 4dd343b21ae5c6d5581d3057586750fc6a942c0f Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Feb 07 2011 09:23:01 +0000 Subject: Replace identical executables with symlinks There are a number of identical binaries installed to all of /usr/lib/erlang/erts-*/bin/* /usr/lib/erlang/bin/* /usr/bin/* Symlinking makes sense here if only to make it obvious that it is the very same executable. --- diff --git a/erlang.spec b/erlang.spec index 9ff3226..40e863a 100644 --- a/erlang.spec +++ b/erlang.spec @@ -1134,6 +1134,27 @@ rm -r $RPM_BUILD_ROOT%{_libdir}/erlang/erts-*/man # remove outdated script rm -f $RPM_BUILD_ROOT%{_libdir}/erlang/Install +# Replace identical executables with symlinks +for exe in $RPM_BUILD_ROOT%{_libdir}/erlang/erts-*/bin/* +do + base="$(basename "$exe")" + next="$RPM_BUILD_ROOT%{_libdir}/erlang/bin/${base}" + rel="$(echo "$exe" | sed "s,^$RPM_BUILD_ROOT%{_libdir}/erlang/,../,")" + if cmp "$exe" "$next"; then + ln -sf "$rel" "$next" + fi +done +for exe in $RPM_BUILD_ROOT%{_libdir}/erlang/bin/* +do + base="$(basename "$exe")" + next="$RPM_BUILD_ROOT%{_bindir}/${base}" + rel="$(echo "$exe" | sed "s,^$RPM_BUILD_ROOT,,")" + if cmp "$exe" "$next"; then + ln -sf "$rel" "$next" + fi +done + + %clean rm -rf $RPM_BUILD_ROOT