add %pre static cleanup script too
This commit is contained in:
parent
4d884cc809
commit
53f27c5f17
12
alex.spec
12
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
|
||||
|
|
Loading…
Reference in New Issue