diff --git a/alex.spec b/alex.spec index b11a677..652b572 100644 --- a/alex.spec +++ b/alex.spec @@ -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