From 5b4149872bdf74089c63e6e5a49f506f48b5fbe8f47c241c7491b7bf63328af7 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 8 May 2018 15:54:18 +0000 Subject: [PATCH] - Add update-alternatives handling for (s)rmt and (s)mt OBS-URL: https://build.opensuse.org/package/show/utilities/schily?expand=0&rev=12 --- schily.changes | 5 +++++ schily.spec | 54 ++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/schily.changes b/schily.changes index 8fc3dd7..c2e758b 100644 --- a/schily.changes +++ b/schily.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 8 15:53:47 UTC 2018 - jengelh@inai.de + +- Add update-alternatives handling for (s)rmt and (s)mt + ------------------------------------------------------------------- Tue May 8 14:48:48 UTC 2018 - jengelh@inai.de diff --git a/schily.spec b/schily.spec index ef47724..2c7b26d 100644 --- a/schily.spec +++ b/schily.spec @@ -328,28 +328,33 @@ started up with an rexec(3) or rcmd(3) call but it may also be connected via an internal pipe to an ssh(1) session that was set up by the remote user. -%package -n schily-mt +%package mt Summary: Magnetic tape control License: CDDL-1.0 Group: Productivity/Archiving/Backup Conflicts: cpio-mt Conflicts: mt-st -Conflicts: star-rmt +Obsoletes: star-rmt +Provides: star-rmt:/usr/bin/smt +Requires(post): update-alternatives +Requires(postun): update-alternatives -%description -n schily-mt +%description mt The mt/smt program sends commands to a local or a remote magnetic tape drive. -%package -n schily-rmt +%package rmt Summary: Remote magnetic tape protocol server License: CDDL-1.0 Group: Productivity/Archiving/Backup Conflicts: dump-rmt Conflicts: tar-rmt Obsoletes: star-rmt -Provides: star-rmt +Provides: star-rmt:/usr/sbin/srmt +Requires(post): update-alternatives +Requires(postun): update-alternatives -%description -n schily-rmt +%description rmt rmt is a program that can be used by e.g. star and ufsdump for accessing remote magnetic tape drives and files through an interprocess communication connection. @@ -458,6 +463,10 @@ rm -Rfv "$b/%_datadir/lib/siconv" # spax/star ln -sfv spax "$b/%_bindir/pax" rm -fv "$b/%_bindir/tar" "$b/%_bindir/gnutar" +rm -fv "$b/%_bindir/mt" # handled up u-a +mv "$b/%_mandir/man1/mt.1" "$b/%_mandir/man1/smt.1" +mv "$b/%_sbindir/rmt" "$b/%_sbindir/srmt" # make room for u-a +mv "$b/%_mandir/man1/rmt.1" "$b/%_mandir/man1/srmt.1" # deal with this another time rm -Rf "$b/usr/ccs" "$b/usr/xpg4" "$b/%_bindir/sccs" @@ -636,6 +645,26 @@ true %set_permissions %_bindir/readcd true +%post mt +%_sbindir/update-alternatives --force \ + --install %_bindir/mt mt %_bindir/smt 10 \ + --slave %_mandir/man1/mt.1%ext_man mt.1%ext_man %_mandir/man1/smt.1%ext_man + +%postun mt +if test ! -f %_bindir/srmt; then + %_sbindir/update-alternatives --remove mt %_bindir/smt +fi + +%post rmt +%_sbindir/update-alternatives --force \ + --install %_sbindir/rmt rmt %_sbindir/srmt 30 \ + --slave %_mandir/man1/rmt.1%ext_man rmt.1%ext_man %_mandir/man1/srmt.1%ext_man + +%postun rmt +if test ! -f %_sbindir/srmt; then + %_sbindir/update-alternatives --remove rmt %_sbindir/srmt +fi + %post -n libcdrdeflt1_0 -p /sbin/ldconfig %postun -n libcdrdeflt1_0 -p /sbin/ldconfig %post -n libdeflt1_0 -p /sbin/ldconfig @@ -884,17 +913,22 @@ true %_mandir/man1/rscsi.1* %files -n schily-mt -%_bindir/mt +%license CDDL.Schily.txt %_bindir/smt -%_mandir/man1/mt.1* %_mandir/man1/smt.1* +%ghost %_sysconfdir/alternatives/mt +%ghost %_sysconfdir/alternatives/mt.1%ext_man +%ghost %_mandir/man1/mt.1%ext_man %files -n schily-rmt %license CDDL.Schily.txt %config %_sysconfdir/default/rmt %_docdir/rmt/ -%_sbindir/rmt -%_mandir/man1/rmt.1* +%_sbindir/srmt +%_mandir/man1/srmt.1* +%ghost %_sysconfdir/alternatives/rmt +%ghost %_sysconfdir/alternatives/rmt.1%ext_man +%ghost %_mandir/man1/rmt.1%ext_man %files -n spax %license CDDL.Schily.txt