add %pre static cleanup script too

epel9
Jens Petersen 10 years ago
parent 4d884cc809
commit 53f27c5f17

@ -99,8 +99,9 @@ rm %{buildroot}%{_pkgdocdir}/LICENSE
%if %{with static} %if %{with static}
# avoid rpm ghost keeping pre-alternatives binary around
%pre %pre
if [ $1 -eq 2 ] ; then if [ $1 -gt 1 ] ; then
if [ -f %{_bindir}/%{name} -a ! -L %{_bindir}/%{name} ]; then if [ -f %{_bindir}/%{name} -a ! -L %{_bindir}/%{name} ]; then
rm %{_bindir}/%{name} rm %{_bindir}/%{name}
fi fi
@ -118,6 +119,15 @@ if [ $1 -eq 0 ] ; then
fi fi
# avoid rpm ghost keeping pre-alternatives binary around
%pre static
if [ $1 -gt 1 ] ; then
if [ -f %{_bindir}/%{name} -a ! -L %{_bindir}/%{name} ]; then
rm %{_bindir}/%{name}
fi
fi
%post static %post static
%{_sbindir}/update-alternatives --install %{_bindir}/%{name} \ %{_sbindir}/update-alternatives --install %{_bindir}/%{name} \
%{name} %{_bindir}/%{name}.static 30 %{name} %{_bindir}/%{name}.static 30

Loading…
Cancel
Save