From 4d884cc8098fde9c48caee6d41ace8f57b5491fe Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Wed, 10 Dec 2014 17:53:09 +0900 Subject: [PATCH] add a %pre "hack" that removes the existing bindir/alex before %ghost kicks in this prevents the old binary being left as a ghost preventing the alternative symlink from being made when upgrading from the pre-alternatives packaging --- alex.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/alex.spec b/alex.spec index 9d3dadb..b11a677 100644 --- a/alex.spec +++ b/alex.spec @@ -99,6 +99,14 @@ rm %{buildroot}%{_pkgdocdir}/LICENSE %if %{with static} +%pre +if [ $1 -eq 2 ] ; then + if [ -f %{_bindir}/%{name} -a ! -L %{_bindir}/%{name} ]; then + rm %{_bindir}/%{name} + fi +fi + + %post %{_sbindir}/update-alternatives --install %{_bindir}/%{name} \ %{name} %{_bindir}/%{name}.dynamic 70 @@ -149,6 +157,7 @@ fi * Sun Aug 3 2014 Jens Petersen - 3.1.3-1 - update to 3.1.3 - add static and common subpackages +- dynamic and static are handled as alternatives * Tue Jun 10 2014 Jens Petersen - 3.0.5-37 - update to cblrpm-0.8.11