2016-07-25 10:34:41 +02:00
|
|
|
#
|
|
|
|
# spec file for package mt-st
|
|
|
|
#
|
2017-03-16 12:41:03 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-07-25 10:34:41 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: mt-st
|
|
|
|
Version: 1.3
|
|
|
|
Release: 0
|
|
|
|
Summary: Utility for Controlling Magnetic Tape Drives
|
|
|
|
License: GPL-2.0+
|
|
|
|
Group: Productivity/Archiving/Backup
|
|
|
|
Url: https://github.com/iustin/%{name}
|
|
|
|
Source0: https://github.com/iustin/mt-st/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
|
|
|
|
Source1: https://github.com/iustin/mt-st/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz.asc
|
|
|
|
Source2: stinit.def
|
|
|
|
Source3: 61-storage-tape-init.rules
|
|
|
|
Source4: %{name}.keyring
|
2017-03-16 12:41:03 +01:00
|
|
|
BuildRequires: pkgconfig
|
2016-07-25 10:34:41 +02:00
|
|
|
BuildRequires: pkgconfig(udev)
|
2017-03-30 10:26:04 +02:00
|
|
|
Provides: mt
|
2016-07-25 10:34:41 +02:00
|
|
|
Requires: udev
|
2017-03-30 10:26:04 +02:00
|
|
|
Requires(post): update-alternatives
|
2017-03-16 12:41:03 +01:00
|
|
|
Requires(post): udev
|
2017-03-30 10:26:04 +02:00
|
|
|
Requires(postun): update-alternatives
|
2017-03-16 12:41:03 +01:00
|
|
|
Requires(postun): udev
|
2016-08-08 12:24:50 +02:00
|
|
|
Provides: mt_st = %{version}-%{release}
|
|
|
|
Obsoletes: mt_st < %{version}-%{release}
|
2016-07-25 10:34:41 +02:00
|
|
|
|
|
|
|
%description
|
2017-03-30 10:26:04 +02:00
|
|
|
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.
|
2016-07-25 10:34:41 +02:00
|
|
|
|
|
|
|
%prep
|
2017-03-16 12:41:03 +01:00
|
|
|
%setup -q
|
2016-07-25 10:34:41 +02:00
|
|
|
|
|
|
|
%build
|
2017-03-16 12:41:03 +01:00
|
|
|
make %{?_smp_mflags} CFLAGS="%{optflags} -pipe" DEFTAPE=/dev/nst0
|
2016-07-25 10:34:41 +02:00
|
|
|
|
|
|
|
%install
|
2017-03-16 12:41:03 +01:00
|
|
|
%make_install EXEC_PREFIX=%{_prefix}
|
|
|
|
install -D -p -m 0644 %{SOURCE2} \
|
|
|
|
%{buildroot}%{_sysconfdir}/stinit.def
|
|
|
|
install -D -p -m 0644 %{SOURCE3} \
|
|
|
|
%{buildroot}%{_udevrulesdir}/61-storage-tape-init.rules
|
2017-03-30 10:26:04 +02:00
|
|
|
#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}
|
2017-03-16 12:41:03 +01:00
|
|
|
|
|
|
|
%post
|
2017-03-30 10:26:04 +02:00
|
|
|
%{_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}
|
2017-03-16 12:41:03 +01:00
|
|
|
%udev_rules_update
|
|
|
|
|
|
|
|
%postun
|
2017-03-30 10:26:04 +02:00
|
|
|
if [ "$1" = 0 ] ; then
|
|
|
|
"%{_sbindir}/update-alternatives" --remove mt %{_bindir}/mtst
|
|
|
|
fi
|
2017-03-16 12:41:03 +01:00
|
|
|
%udev_rules_update
|
2016-07-25 10:34:41 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc README.md CHANGELOG.md COPYING stinit.def.examples
|
2017-03-30 10:26:04 +02:00
|
|
|
%ghost %{_bindir}/mt
|
|
|
|
%{_bindir}/mtst
|
2016-07-25 10:34:41 +02:00
|
|
|
%{_sbindir}/stinit
|
2017-03-30 10:26:04 +02:00
|
|
|
%ghost %{_mandir}/man1/mt.1%{ext_man}
|
|
|
|
%{_mandir}/man1/mtst.1%{ext_man}
|
2016-07-25 10:34:41 +02:00
|
|
|
%{_mandir}/man8/stinit.8%{ext_man}
|
2017-03-16 12:41:03 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/stinit.def
|
2016-07-25 10:34:41 +02:00
|
|
|
%{_udevrulesdir}/61-storage-tape-init.rules
|
2017-03-30 10:26:04 +02:00
|
|
|
%ghost %{_sysconfdir}/alternatives/mt
|
|
|
|
%ghost %{_sysconfdir}/alternatives/mt.1%{ext_man}
|
2016-07-25 10:34:41 +02:00
|
|
|
|
|
|
|
%changelog
|