2016-04-26 16:17:33 +02:00
|
|
|
#
|
|
|
|
# spec file for package targetcli-fb
|
|
|
|
#
|
2021-01-24 23:53:13 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2016-04-26 16:17:33 +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.
|
|
|
|
|
2019-05-21 12:08:17 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-04-26 16:17:33 +02:00
|
|
|
#
|
|
|
|
|
2016-07-27 22:47:33 +02:00
|
|
|
|
2018-01-09 23:18:46 +01:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2018-04-16 22:19:01 +02:00
|
|
|
Name: targetcli-fb
|
2020-06-30 23:06:27 +02:00
|
|
|
Version: 2.1.53
|
2016-11-02 00:17:15 +01:00
|
|
|
Release: 0
|
2016-07-27 22:47:33 +02:00
|
|
|
Summary: A command shell for managing the Linux LIO kernel target
|
|
|
|
License: Apache-2.0
|
|
|
|
Group: System/Management
|
2020-02-04 18:55:34 +01:00
|
|
|
URL: https://github.com/open-iscsi/%{name}
|
2018-04-16 22:19:01 +02:00
|
|
|
Source: %{name}-%{version}.tar.xz
|
|
|
|
Source1: %{name}.service
|
2018-01-09 23:18:46 +01:00
|
|
|
BuildRequires: %{python_module configshell-fb}
|
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
BuildRequires: %{python_module pyparsing}
|
|
|
|
BuildRequires: %{python_module rtslib-fb}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2021-01-24 23:53:13 +01:00
|
|
|
BuildRequires: %{pythons}
|
2018-01-09 23:18:46 +01:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2020-02-04 18:55:34 +01:00
|
|
|
BuildRequires: pkgconfig(systemd)
|
2016-07-27 22:47:33 +02:00
|
|
|
Requires: python-configshell-fb
|
2018-01-09 23:18:46 +01:00
|
|
|
Requires: python-dbus-python
|
2016-07-27 22:47:33 +02:00
|
|
|
Requires: python-rtslib-fb
|
|
|
|
Requires: python-six
|
2018-01-09 23:18:46 +01:00
|
|
|
Requires: targetcli-fb-common
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2021-01-24 23:53:13 +01:00
|
|
|
%if "%{python_flavor}" == "python3" || "%{?python_provides}" == "python3"
|
2018-02-25 21:08:25 +01:00
|
|
|
Provides: targetcli = %{version}-%{release}
|
2018-04-16 22:19:01 +02:00
|
|
|
Provides: targetcli-fb = %{version}-%{release}
|
2018-01-09 23:18:46 +01:00
|
|
|
%endif
|
2020-02-18 19:51:35 +01:00
|
|
|
Obsoletes: targetcli < %{version}-%{release}
|
|
|
|
Obsoletes: targetcli-fb < %{version}-%{release}
|
2016-07-27 22:47:33 +02:00
|
|
|
BuildArch: noarch
|
2018-12-07 15:59:19 +01:00
|
|
|
%if 0%{?sle_version} >= 150000
|
2018-04-16 22:19:01 +02:00
|
|
|
# explicit Provides advertising RBD support
|
|
|
|
Provides: targetcli-rbd = %{version}
|
|
|
|
Obsoletes: targetcli-rbd < %{version}
|
|
|
|
%endif
|
2020-02-04 18:55:34 +01:00
|
|
|
%{?systemd_ordering}
|
2020-06-10 16:50:07 +02:00
|
|
|
|
|
|
|
# SUSE-specific patches
|
2018-10-19 02:45:23 +02:00
|
|
|
Patch1: Split-out-blockdev-readonly-state-detection-helper.patch
|
|
|
|
Patch2: rbd-support.patch
|
2020-05-21 20:50:43 +02:00
|
|
|
Patch3: fix-setup-install.patch
|
2018-01-09 23:18:46 +01:00
|
|
|
|
|
|
|
%python_subpackages
|
2016-04-26 16:17:33 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
targetcli-fb is a command-line interface for configuring the LIO generic
|
|
|
|
SCSI target, present in 3.x Linux kernel versions.
|
|
|
|
|
|
|
|
targetcli-fb is a fork of the "targetcli" code written by RisingTide Systems.
|
|
|
|
The "-fb" differentiates between the original and this version. Please ensure
|
|
|
|
to use either all "fb" versions of the targetcli components -- targetcli,
|
|
|
|
rtslib, and configshell, or stick with all non-fb versions, since they are
|
|
|
|
no longer strictly compatible.
|
|
|
|
|
2018-01-09 23:18:46 +01:00
|
|
|
%package -n %{name}-common
|
|
|
|
Summary: Common targetcli-fb subpackage for either flavor of Python
|
|
|
|
Group: System/Management
|
|
|
|
Provides: %{python_module targetcli-fb-common}
|
|
|
|
|
|
|
|
%description -n %{name}-common
|
2021-01-24 23:53:13 +01:00
|
|
|
targetcli-fb-common is the invariant base package needed by
|
|
|
|
all python-version-dependant packages, such as python3-*-targetcli-fb.
|
2018-01-09 23:18:46 +01:00
|
|
|
|
2016-04-26 16:17:33 +02:00
|
|
|
%prep
|
2018-04-16 22:19:01 +02:00
|
|
|
%setup -q
|
|
|
|
%patch1 -p1
|
2018-12-07 15:59:19 +01:00
|
|
|
%if 0%{?sle_version} >= 150000
|
2018-04-16 22:19:01 +02:00
|
|
|
# RBD support is dependent on LIO changes present in the SLE/Leap kernel
|
2018-10-19 02:45:23 +02:00
|
|
|
%patch2 -p1
|
2018-04-16 22:19:01 +02:00
|
|
|
%endif
|
2020-05-21 20:50:43 +02:00
|
|
|
%patch3 -p1
|
2016-04-26 16:17:33 +02:00
|
|
|
|
|
|
|
%build
|
2018-01-09 23:18:46 +01:00
|
|
|
%python_build
|
2016-04-26 16:17:33 +02:00
|
|
|
|
|
|
|
%install
|
2018-01-09 23:18:46 +01:00
|
|
|
%python_install
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/targetcli
|
2020-02-18 19:51:35 +01:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/targetclid
|
2016-11-02 00:17:15 +01:00
|
|
|
install -d -m755 %{buildroot}%{_sysconfdir}/target
|
|
|
|
install -d -m755 %{buildroot}%{_sysconfdir}/target/backup
|
|
|
|
install -d -m755 %{buildroot}%{_sbindir}
|
|
|
|
install -D -m644 targetcli.8 %{buildroot}%{_mandir}/man8/targetcli.8
|
2020-02-18 19:51:35 +01:00
|
|
|
install -D -m644 targetclid.8 %{buildroot}%{_mandir}/man8/targetclid.8
|
|
|
|
install -D -m644 %{S:1} %{buildroot}%{_unitdir}/targetcli.service
|
2018-01-09 23:18:46 +01:00
|
|
|
%fdupes %{buildroot}
|
2016-11-02 00:17:15 +01:00
|
|
|
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctargetcli
|
2020-02-18 19:51:35 +01:00
|
|
|
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctargetclid
|
2016-04-26 16:17:33 +02:00
|
|
|
|
|
|
|
%post
|
2018-01-09 23:18:46 +01:00
|
|
|
%python_install_alternative targetcli
|
2020-02-18 19:51:35 +01:00
|
|
|
%python_install_alternative targetclid
|
2016-04-26 16:17:33 +02:00
|
|
|
|
|
|
|
%postun
|
2018-01-09 23:18:46 +01:00
|
|
|
%python_uninstall_alternative targetcli
|
2020-02-18 19:51:35 +01:00
|
|
|
%python_uninstall_alternative targetclid
|
2016-04-26 16:17:33 +02:00
|
|
|
|
|
|
|
%pre
|
2020-02-18 19:51:35 +01:00
|
|
|
%{service_add_pre targetcli.service targetclid.socket targetclid.service}
|
2016-04-26 16:17:33 +02:00
|
|
|
|
|
|
|
%preun
|
2020-02-18 19:51:35 +01:00
|
|
|
%{stop_on_removal targetcld targetcli}
|
|
|
|
%{service_del_preun targetcli.service targetclid.socket targetclid.service}
|
2018-01-09 23:18:46 +01:00
|
|
|
|
|
|
|
%post -n %{name}-common
|
2020-02-18 19:51:35 +01:00
|
|
|
%{service_add_post targetcli.service targetclid.socket targetclid.service}
|
2018-01-09 23:18:46 +01:00
|
|
|
|
|
|
|
%postun -n %{name}-common
|
2020-02-18 19:51:35 +01:00
|
|
|
%{service_del_postun targetcli.service targetclid.socket targetclid.service}
|
2018-01-09 23:18:46 +01:00
|
|
|
|
|
|
|
%pre -n %{name}-common
|
2020-02-18 19:51:35 +01:00
|
|
|
%{service_add_pre targetcli.service targetclid.socket targetclid.service}
|
2018-01-09 23:18:46 +01:00
|
|
|
|
|
|
|
%preun -n %{name}-common
|
2020-02-18 19:51:35 +01:00
|
|
|
%{service_del_preun targetcli.service targetclid.socket targetclid.service}
|
2016-04-26 16:17:33 +02:00
|
|
|
|
2018-01-09 23:18:46 +01:00
|
|
|
%files %{python_files}
|
|
|
|
%python_alternative %{_bindir}/targetcli
|
2020-02-18 19:51:35 +01:00
|
|
|
%python_alternative %{_bindir}/targetclid
|
2018-01-09 23:18:46 +01:00
|
|
|
%{python_sitelib}/*
|
|
|
|
|
|
|
|
%files -n %{name}-common
|
2020-02-18 19:51:35 +01:00
|
|
|
%license COPYING
|
|
|
|
%doc README.md THANKS
|
2016-04-26 16:17:33 +02:00
|
|
|
%dir %{_sysconfdir}/target
|
|
|
|
%dir %{_sysconfdir}/target/backup
|
2018-01-09 23:18:46 +01:00
|
|
|
%doc %{_mandir}/man8/targetcli.8%{ext_man}
|
2020-02-18 19:51:35 +01:00
|
|
|
%doc %{_mandir}/man8/targetclid.8%{ext_man}
|
2016-04-26 16:17:33 +02:00
|
|
|
%{_unitdir}/targetcli.service
|
2020-02-18 19:51:35 +01:00
|
|
|
%{_unitdir}/targetclid.service
|
|
|
|
%{_unitdir}/targetclid.socket
|
2016-04-26 16:17:33 +02:00
|
|
|
%{_sbindir}/rctargetcli
|
2020-02-18 19:51:35 +01:00
|
|
|
%{_sbindir}/rctargetclid
|
2016-04-26 16:17:33 +02:00
|
|
|
|
|
|
|
%changelog
|