Fix upgrades from non-alternativized versions

This commit is contained in:
Nikola Forró 2020-02-28 18:16:40 +01:00
parent 15ab40e41d
commit 9c9fe94dd0

View File

@ -3,7 +3,7 @@
Summary: A document formatting system
Name: groff
Version: 1.22.3
Release: 22%{?dist}
Release: 23%{?dist}
License: GPLv3+ and GFDL and BSD and MIT
URL: http://www.gnu.org/software/groff/
Source: ftp://ftp.gnu.org/gnu/groff/groff-%{version}.tar.gz
@ -156,6 +156,10 @@ popd
# /bin/sed moved to /usr/bin/sed in Fedora
sed --in-place 's|#! /bin/sed -f|#! /usr/bin/sed -f|' %{buildroot}%{_datadir}/groff/%{version}/font/devps/generate/symbol.sed
%pre
# remove alternativized files if they are not symlinks
[ -L %{_mandir}/man7/roff.7.gz ] || rm -f %{_mandir}/man7/roff.7.gz
%post
# set up the alternatives files
%{_sbindir}/update-alternatives --install %{_mandir}/man7/roff.7.gz roff.7.gz %{_mandir}/man7/roff.%{name}.7.gz 300 \
@ -173,6 +177,11 @@ if [ $1 -ge 1 ]; then
fi
fi
%pre base
# remove alternativized files if they are not symlinks
[ -L %{_bindir}/soelim ] || rm -f %{_bindir}/soelim
[ -L %{_mandir}/man1/soelim.1.gz ] || rm -f %{_mandir}/man1/soelim.1.gz
%post base
# set up the alternatives files
%{_sbindir}/update-alternatives --install %{_bindir}/soelim soelim %{_bindir}/soelim.%{name} 300 \
@ -462,6 +471,9 @@ fi
%doc %{_pkgdocdir}/pdf/
%changelog
* Fri Feb 28 2020 Nikola Forró <nforro@redhat.com> - 1.22.3-23
- Fix upgrades from non-alternativized versions
* Wed Feb 26 2020 Nikola Forró <nforro@redhat.com> - 1.22.3-22
- Use alternatives for soelim and roff.7