%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+
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
%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
%{_mandir}/man1/aklog.1*
%changelog
+* Tue Oct 22 2019 Jonathan Billings <jsbillin@umich.edu> 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 <dhowells@redhat.com> 0.3-1
- Address Fedora packaging review comments [RH BZ 1724281].