]> www.infradead.org Git - users/dhowells/kafs-client.git/commitdiff
redhat/kafs-client.spec: bump version, add alternatives next
authorDavid Howells <dhowells@redhat.com>
Wed, 20 May 2020 23:14:30 +0000 (00:14 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 20 May 2020 23:14:50 +0000 (00:14 +0100)
* Use the 'alternatives' functionality to create an 'aklog'
  executable.
* Bump version of package to 0.4

redhat/kafs-client.spec

index a6dc4780e9a9aecbeda0bbeacae50bad1f9ae9cb..dcb272c9f2004c6acc5d319fb3a2bd1b2914ea13 100644 (file)
@@ -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 <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].