2014-01-14 10:00:40 +01:00
|
|
|
#
|
|
|
|
# spec file for package python-rtslib-fb
|
|
|
|
#
|
2023-03-03 14:16:52 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2014-01-14 10:00:40 +01: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-09-17 08:17:54 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-01-14 10:00:40 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2021-10-05 19:59:16 +02:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
|
|
|
|
2017-12-11 23:16:48 +01:00
|
|
|
%define dbdir %{_sysconfdir}/target
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2023-04-21 15:36:49 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2018-04-16 22:19:21 +02:00
|
|
|
Name: python-rtslib-fb
|
2022-05-06 20:04:25 +02:00
|
|
|
Version: 2.1.75
|
2017-04-13 19:32:40 +02:00
|
|
|
Release: 0%{?dist}
|
2014-01-14 10:00:40 +01:00
|
|
|
Summary: API for Linux kernel SCSI target (aka LIO)
|
|
|
|
License: Apache-2.0
|
|
|
|
Group: Development/Languages/Python
|
2020-03-03 18:15:41 +01:00
|
|
|
URL: https://github.com/open-iscsi/rtslib-fb.git
|
2020-11-08 20:08:39 +01:00
|
|
|
Source: python-rtslib-fb-v%{version}.tar.xz
|
2018-04-16 22:19:21 +02:00
|
|
|
Patch1: rbd-support.patch
|
2020-10-19 03:23:19 +02:00
|
|
|
Patch2: rtslib-Fix-handling-of-sysfs-RW-attrs-that-are-actually-RO.patch
|
|
|
|
Patch3: rtslib-target-service-for-suse.patch
|
2022-02-08 11:50:45 +01:00
|
|
|
Patch4: rbd-support-disable_emulate_legacy_capacity.patch
|
2017-12-11 23:16:48 +01:00
|
|
|
BuildRequires: %{python_module pyudev}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: %{python_module six}
|
2016-04-21 12:30:18 +02:00
|
|
|
BuildRequires: fdupes
|
2021-10-05 19:59:16 +02:00
|
|
|
BuildRequires: python-rpm-macros >= 20210929
|
2017-12-11 23:16:48 +01:00
|
|
|
Requires: python-pyudev
|
2020-11-08 20:08:39 +01:00
|
|
|
%define oldpython python
|
|
|
|
%define cpkg %{oldpython}-rtslib-fb-common
|
|
|
|
Requires: %{cpkg}
|
2021-10-05 19:59:16 +02:00
|
|
|
%if %{with libalternatives}
|
|
|
|
Requires: alts
|
|
|
|
BuildRequires: alts
|
|
|
|
%else
|
2017-12-11 23:16:48 +01:00
|
|
|
Requires(post): update-alternatives
|
2022-05-06 20:04:25 +02:00
|
|
|
Requires(postun):update-alternatives
|
2021-10-05 19:59:16 +02:00
|
|
|
%endif
|
2018-02-25 21:09:51 +01:00
|
|
|
Provides: python-rtslib = %{version}-%{release}
|
2019-09-17 08:17:54 +02:00
|
|
|
Obsoletes: python-rtslib < %{version}
|
2018-12-07 14:07:22 +01:00
|
|
|
%if 0%{?sle_version} >= 150000
|
2018-04-16 22:19:21 +02:00
|
|
|
# explicit Provides advertising RBD support
|
|
|
|
Provides: python-rtslib-rbd = %{version}
|
|
|
|
Obsoletes: python-rtslib-rbd < %{version}
|
|
|
|
%endif
|
2017-12-11 23:16:48 +01:00
|
|
|
BuildArch: noarch
|
2020-11-08 20:08:39 +01:00
|
|
|
|
2017-12-11 23:16:48 +01:00
|
|
|
%python_subpackages
|
2014-01-14 10:00:40 +01:00
|
|
|
|
|
|
|
%description
|
2017-11-28 09:56:02 +01:00
|
|
|
rtslib-fb is an object-based Python library for configuring the LIO generic
|
2014-01-14 10:00:40 +01:00
|
|
|
SCSI target, present in 3.x Linux kernel versions. rtslib-fb is licensed under
|
|
|
|
the Apache 2.0 license. Contributions are welcome
|
|
|
|
|
2020-11-08 20:08:39 +01:00
|
|
|
%package -n %{cpkg}
|
2020-10-24 20:14:03 +02:00
|
|
|
Summary: Common python-rtslib-fb subpackage for Python 2 or 3
|
|
|
|
Group: Development/Languages/Python
|
2020-11-08 20:08:39 +01:00
|
|
|
Obsoletes: %{name} < %{version}-%{release}
|
2020-10-24 20:14:03 +02:00
|
|
|
|
2020-11-08 20:08:39 +01:00
|
|
|
%description -n %{cpkg}
|
2020-10-24 20:14:03 +02:00
|
|
|
python-rtslib-fb-common is the invariant base package needed by both
|
|
|
|
python2-rtslib-fb and python3-rtslib-fb.
|
|
|
|
|
2014-01-14 10:00:40 +01:00
|
|
|
%prep
|
2020-11-08 20:08:39 +01:00
|
|
|
%setup -q -n python-rtslib-fb-v%{version}
|
2018-12-07 14:07:22 +01:00
|
|
|
%if 0%{?sle_version} >= 150000
|
2018-04-16 22:19:21 +02:00
|
|
|
# RBD support is dependent on LIO changes present in the SLE/Leap kernel
|
|
|
|
%patch1 -p1
|
2022-02-08 11:50:45 +01:00
|
|
|
%patch4 -p1
|
2018-04-16 22:19:21 +02:00
|
|
|
%endif
|
2020-10-19 03:23:19 +02:00
|
|
|
%patch2 -p1
|
|
|
|
%patch3 -p1
|
2014-01-14 10:00:40 +01:00
|
|
|
|
|
|
|
%build
|
2017-12-11 23:16:48 +01:00
|
|
|
%python_build
|
2014-01-14 10:00:40 +01:00
|
|
|
|
|
|
|
%install
|
2017-12-11 23:16:48 +01:00
|
|
|
%python_install
|
2021-09-19 19:24:03 +02:00
|
|
|
%python_clone -a %{buildroot}/%{_bindir}/targetctl
|
2017-12-11 23:16:48 +01:00
|
|
|
%fdupes %{buildroot}
|
|
|
|
install -d -m755 %{buildroot}%{_mandir}/man5
|
|
|
|
install -m644 doc/saveconfig.json.5 %{buildroot}%{_mandir}/man5
|
|
|
|
install -d -m755 %{buildroot}%{_mandir}/man8
|
|
|
|
install -m644 doc/targetctl.8 %{buildroot}%{_mandir}/man8
|
|
|
|
install -d -m755 %{buildroot}/%{dbdir}
|
|
|
|
install -d -m755 %{buildroot}/%{dbdir}/pr
|
|
|
|
install -d -m755 %{buildroot}/%{dbdir}/alua
|
2020-10-19 03:23:19 +02:00
|
|
|
mkdir -p %{buildroot}/%{_unitdir}/
|
|
|
|
install -m644 systemd/target.service %{buildroot}/%{_unitdir}
|
|
|
|
install -d -m755 %{buildroot}%{_sbindir}
|
|
|
|
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctarget
|
2017-12-11 23:16:48 +01:00
|
|
|
|
|
|
|
%post
|
2020-10-24 20:14:03 +02:00
|
|
|
%python_install_alternative targetctl
|
2020-10-19 03:23:19 +02:00
|
|
|
%{service_add_post target.service}
|
2016-04-21 12:30:18 +02:00
|
|
|
|
2017-12-11 23:16:48 +01:00
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative targetctl
|
2020-10-19 03:23:19 +02:00
|
|
|
%{service_del_postun target.service}
|
|
|
|
|
|
|
|
%pre
|
|
|
|
%{service_add_pre target.service}
|
2021-10-05 19:59:16 +02:00
|
|
|
# If libalternatives is used: Removing old update-alternatives entries.
|
|
|
|
%python_libalternatives_reset_alternative targetctl
|
2020-10-19 03:23:19 +02:00
|
|
|
|
|
|
|
%preun
|
|
|
|
%{stop_on_removal target}
|
|
|
|
%{service_del_preun target.service}
|
2014-01-14 10:00:40 +01:00
|
|
|
|
2020-11-08 20:08:39 +01:00
|
|
|
%post -n %{cpkg}
|
2020-10-24 20:14:03 +02:00
|
|
|
%{service_add_post target.service}
|
|
|
|
|
2020-11-08 20:08:39 +01:00
|
|
|
%postun -n %{cpkg}
|
2020-10-24 20:14:03 +02:00
|
|
|
%{service_del_postun target.service}
|
|
|
|
|
2020-11-08 20:08:39 +01:00
|
|
|
%pre -n %{cpkg}
|
2020-10-24 20:14:03 +02:00
|
|
|
%{service_add_pre target.service}
|
|
|
|
|
2020-11-08 20:08:39 +01:00
|
|
|
%preun -n %{cpkg}
|
2020-10-24 20:14:03 +02:00
|
|
|
%{service_del_preun target.service}
|
|
|
|
|
2017-12-11 23:16:48 +01:00
|
|
|
%files %{python_files}
|
|
|
|
%python_alternative %{_bindir}/targetctl
|
2014-01-14 10:00:40 +01:00
|
|
|
%{python_sitelib}/*
|
2020-10-24 20:14:03 +02:00
|
|
|
|
2020-11-08 20:08:39 +01:00
|
|
|
%files -n %{cpkg}
|
2020-03-03 18:15:41 +01:00
|
|
|
%license COPYING
|
|
|
|
%doc README.md
|
2017-07-04 17:29:24 +02:00
|
|
|
%dir %{dbdir}
|
|
|
|
%dir %{dbdir}/pr
|
|
|
|
%dir %{dbdir}/alua
|
2020-10-19 03:23:19 +02:00
|
|
|
%{_unitdir}/target.service
|
|
|
|
%{_sbindir}/rctarget
|
2020-10-24 20:14:03 +02:00
|
|
|
%doc %{_mandir}/man5/saveconfig.json.5.gz
|
|
|
|
%doc %{_mandir}/man8/targetctl.8.gz
|
2016-04-21 12:30:18 +02:00
|
|
|
|
2014-01-14 10:00:40 +01:00
|
|
|
%changelog
|