15
0

Accepting request 846968 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/846968
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-rtslib-fb?expand=0&rev=27
This commit is contained in:
2020-11-12 21:36:54 +00:00
committed by Git OBS Bridge
2 changed files with 49 additions and 7 deletions

View File

@@ -1,3 +1,20 @@
-------------------------------------------------------------------
Sat Nov 7 18:05:32 UTC 2020 - Lee Duncan <lduncan@suse.com>
- Fixed issue in SPEC file w/r/t package split with common.
Now, packages python3-rtslib-fb and python-rtslib-fb-common
are built, and the former depends on the latter. The common
package has the non-python parts (documentation, etc),
and the python3-* part the python parts.
-------------------------------------------------------------------
Fri Oct 23 18:20:23 UTC 2020 - Lee Duncan <lduncan@suse.com>
- Split package into "common" part, python-rtslib-fb-common, which
is python-verserion-agnostic, and either python2-rtslib-comon-fb
or python3-rtslib-fb. This maens common files, like man pages,
don't have to be duplicated.
-------------------------------------------------------------------
Fri Oct 16 18:47:04 UTC 2020 - lduncan@suse.com

View File

@@ -25,7 +25,7 @@ Summary: API for Linux kernel SCSI target (aka LIO)
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/open-iscsi/rtslib-fb.git
Source: %{name}-v%{version}.tar.xz
Source: python-rtslib-fb-v%{version}.tar.xz
Patch1: rbd-support.patch
Patch2: rtslib-Fix-handling-of-sysfs-RW-attrs-that-are-actually-RO.patch
Patch3: rtslib-target-service-for-suse.patch
@@ -35,6 +35,9 @@ BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pyudev
%define oldpython python
%define cpkg %{oldpython}-rtslib-fb-common
Requires: %{cpkg}
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides: python-rtslib = %{version}-%{release}
@@ -45,6 +48,7 @@ Provides: python-rtslib-rbd = %{version}
Obsoletes: python-rtslib-rbd < %{version}
%endif
BuildArch: noarch
%python_subpackages
%description
@@ -52,8 +56,17 @@ rtslib-fb is an object-based Python library for configuring the LIO generic
SCSI target, present in 3.x Linux kernel versions. rtslib-fb is licensed under
the Apache 2.0 license. Contributions are welcome
%package -n %{cpkg}
Summary: Common python-rtslib-fb subpackage for Python 2 or 3
Group: Development/Languages/Python
Obsoletes: %{name} < %{version}-%{release}
%description -n %{cpkg}
python-rtslib-fb-common is the invariant base package needed by both
python2-rtslib-fb and python3-rtslib-fb.
%prep
%setup -q -n %{name}-v%{version}
%setup -q -n python-rtslib-fb-v%{version}
%if 0%{?sle_version} >= 150000
# RBD support is dependent on LIO changes present in the SLE/Leap kernel
%patch1 -p1
@@ -70,10 +83,8 @@ the Apache 2.0 license. Contributions are welcome
%fdupes %{buildroot}
install -d -m755 %{buildroot}%{_mandir}/man5
install -m644 doc/saveconfig.json.5 %{buildroot}%{_mandir}/man5
%python_clone -a %{buildroot}%{_mandir}/man5/saveconfig.json.5
install -d -m755 %{buildroot}%{_mandir}/man8
install -m644 doc/targetctl.8 %{buildroot}%{_mandir}/man8
%python_clone -a %{buildroot}%{_mandir}/man8/targetctl.8
install -d -m755 %{buildroot}/%{dbdir}
install -d -m755 %{buildroot}/%{dbdir}/pr
install -d -m755 %{buildroot}/%{dbdir}/alua
@@ -83,7 +94,7 @@ install -d -m755 %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctarget
%post
%python_install_alternative targetctl targetctl.8 saveconfig.json.5
%python_install_alternative targetctl
%{service_add_post target.service}
%postun
@@ -97,17 +108,31 @@ ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctarget
%{stop_on_removal target}
%{service_del_preun target.service}
%post -n %{cpkg}
%{service_add_post target.service}
%postun -n %{cpkg}
%{service_del_postun target.service}
%pre -n %{cpkg}
%{service_add_pre target.service}
%preun -n %{cpkg}
%{service_del_preun target.service}
%files %{python_files}
%python_alternative %{_bindir}/targetctl
%{python_sitelib}/*
%files -n %{cpkg}
%license COPYING
%doc README.md
%doc %python_alternative %{_mandir}/man5/saveconfig.json.5.gz
%doc %python_alternative %{_mandir}/man8/targetctl.8.gz
%dir %{dbdir}
%dir %{dbdir}/pr
%dir %{dbdir}/alua
%{_unitdir}/target.service
%{_sbindir}/rctarget
%doc %{_mandir}/man5/saveconfig.json.5.gz
%doc %{_mandir}/man8/targetctl.8.gz
%changelog