From d10f1ae6a1a19d487f14c64b1c4aca8eb318be5b Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 21 May 2020 00:14:30 +0100 Subject: [PATCH] redhat/kafs-client.spec: bump version, add alternatives * Use the 'alternatives' functionality to create an 'aklog' executable. * Bump version of package to 0.4 --- redhat/kafs-client.spec | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/redhat/kafs-client.spec b/redhat/kafs-client.spec index a6dc478..dcb272c 100644 --- a/redhat/kafs-client.spec +++ b/redhat/kafs-client.spec @@ -3,7 +3,7 @@ %global libapiversion %{libapivermajor}.1 Name: kafs-client -Version: 0.3 +Version: 0.4 Release: 1%{?dist}%{?buildid} Summary: The basic tools for kAFS and mounter for the AFS dynamic root License: GPLv2+ @@ -11,6 +11,8 @@ URL: https://www.infradead.org/~dhowells/kafs/ Source0: https://www.infradead.org/~dhowells/kafs/kafs-client-%{version}.tar.bz2 Requires: filesystem-afs +Requires(post): %{_sbindir}/alternatives +Requires(preun): %{_sbindir}/alternatives BuildRequires: krb5-devel BuildRequires: keyutils-libs-devel BuildRequires: openssl-devel @@ -107,12 +109,25 @@ ln -s aklog-kafs %{buildroot}/%{_bindir}/aklog %post %systemd_post afs.mount +%{_sbindir}/alternatives \ + --install %{_bindir}/aklog aklog %{_bindir}/aklog-kafs 100 + %preun %systemd_preun afs.mount +#only remove in case of erase (but not at upgrade) +if [ $1 -eq 0 ] ; then + %{_sbindir}/alternatives --remove aklog %{_bindir}/aklog-kafs +fi %postun %systemd_postun_with_restart afs.mount +if [ "$1" -ge "1" ]; then + if [ "`readlink %{_sysconfdir}/alternatives/aklog`" == "%{_bindir}/aklog-kafs" ]; then + %{_sbindir}/alternatives --set aklog %{_bindir}/aklog-kafs + fi +fi + %files %doc README @@ -145,6 +160,10 @@ ln -s aklog-kafs %{buildroot}/%{_bindir}/aklog %{_mandir}/man1/aklog.1* %changelog +* Tue Oct 22 2019 Jonathan Billings 0.4-1 +- Update aklog-kafs to handle arguments and support a user keyring +- Use 'alternatives' to install an aklog symlink + * Fri Jul 5 2019 David Howells 0.3-1 - Address Fedora packaging review comments [RH BZ 1724281]. -- 2.50.1