add %pre static cleanup script too

This commit is contained in:
Jens Petersen 2014-12-12 13:10:51 +09:00
parent 4d884cc809
commit 53f27c5f17
1 changed files with 11 additions and 1 deletions

View File

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