diff --git a/mt-st.changes b/mt-st.changes index 163d5ed..84e944c 100644 --- a/mt-st.changes +++ b/mt-st.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 17 11:19:21 UTC 2017 - svalx@svalx.net + +- Switch binaries to alternatives system +- Change package description + ------------------------------------------------------------------- Thu Mar 16 11:29:23 UTC 2017 - mpluskal@suse.com diff --git a/mt-st.spec b/mt-st.spec index c5758be..26aaf8d 100644 --- a/mt-st.spec +++ b/mt-st.spec @@ -30,18 +30,22 @@ Source3: 61-storage-tape-init.rules Source4: %{name}.keyring BuildRequires: pkgconfig BuildRequires: pkgconfig(udev) +Provides: mt Requires: udev +Requires(post): update-alternatives Requires(post): udev +Requires(postun): update-alternatives Requires(postun): udev Provides: mt_st = %{version}-%{release} Obsoletes: mt_st < %{version}-%{release} %description -Although this mt program (called mtst) is tailored for SCSI tape -drives, it can also be used with the QIC-02 driver and hopefully with -other Linux tape drivers that use the same ioctls (some of the commands -may not work with all drivers). The stinit program allows the setting -of some SCSI tape parameters. +mt-st tools contains two programs: mt and stinit, used for dealing +with Linux-specific tape-drive handling. mt program is tailored for +SCSI tape drives, but it can also be used with other Linux tape +drivers that use the same ioctls. The program stinit is meant for +initializing of SCSI tape drive modes at system startup, or when +new tape drivers are added. %prep %setup -q @@ -55,21 +59,37 @@ install -D -p -m 0644 %{SOURCE2} \ %{buildroot}%{_sysconfdir}/stinit.def install -D -p -m 0644 %{SOURCE3} \ %{buildroot}%{_udevrulesdir}/61-storage-tape-init.rules +#For alternatives +mv %{buildroot}%{_bindir}/mt %{buildroot}%{_bindir}/mtst +mv %{buildroot}%{_mandir}/man1/mt.1 %{buildroot}%{_mandir}/man1/mtst.1 +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +ln -s -f %{_sysconfdir}/alternatives/mt %{buildroot}%{_bindir}/mt +ln -s -f %{_sysconfdir}/alternatives/mt.1%{ext_man} %{buildroot}%{_mandir}/man1/mt.1%{ext_man} %post +%{_sbindir}/update-alternatives --force \ + --install %{_bindir}/mt mt %{_bindir}/mtst 30 \ + --slave %{_mandir}/man1/mt.1%{ext_man} mt.1%{ext_man} %{_mandir}/man1/mtst.1%{ext_man} %udev_rules_update %postun +if [ "$1" = 0 ] ; then + "%{_sbindir}/update-alternatives" --remove mt %{_bindir}/mtst +fi %udev_rules_update %files %defattr(-,root,root) %doc README.md CHANGELOG.md COPYING stinit.def.examples -%{_bindir}/mt +%ghost %{_bindir}/mt +%{_bindir}/mtst %{_sbindir}/stinit -%{_mandir}/man1/mt.1%{ext_man} +%ghost %{_mandir}/man1/mt.1%{ext_man} +%{_mandir}/man1/mtst.1%{ext_man} %{_mandir}/man8/stinit.8%{ext_man} %config(noreplace) %{_sysconfdir}/stinit.def %{_udevrulesdir}/61-storage-tape-init.rules +%ghost %{_sysconfdir}/alternatives/mt +%ghost %{_sysconfdir}/alternatives/mt.1%{ext_man} %changelog diff --git a/stinit.def b/stinit.def index 67857ed..adaa080 100644 --- a/stinit.def +++ b/stinit.def @@ -1,7 +1,7 @@ # This file contains example definitions for different kinds of tape # devices. # -# You can find some examples in /usr/share/doc/packages/mt_st/stinit.def.examples. +# You can find some examples in /usr/share/doc/packages/mt-st/stinit.def.examples. # # Common definitions to be applied to all tape devices # (This is the driver's default)