Accepting request 843807 from home:lee_duncan:branches:devel:languages:python

- 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.

OBS-URL: https://build.opensuse.org/request/show/843807
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rtslib-fb?expand=0&rev=57
This commit is contained in:
Lee Duncan 2020-10-24 18:14:03 +00:00 committed by Git OBS Bridge
parent 5293d48576
commit 2ba1fb7494
2 changed files with 35 additions and 5 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
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

@ -34,6 +34,7 @@ BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: %{name}-common
Requires: python-pyudev
Requires(post): update-alternatives
Requires(postun): update-alternatives
@ -52,6 +53,15 @@ 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 %{name}-common
Summary: Common python-rtslib-fb subpackage for Python 2 or 3
Group: Development/Languages/Python
Provides: %{python_module python-rtslib-fb-common}
%description -n %{name}-common
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}
%if 0%{?sle_version} >= 150000
@ -70,10 +80,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 +91,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 +105,31 @@ ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctarget
%{stop_on_removal target}
%{service_del_preun target.service}
%post -n %{name}-common
%{service_add_post target.service}
%postun -n %{name}-common
%{service_del_postun target.service}
%pre -n %{name}-common
%{service_add_pre target.service}
%preun -n %{name}-common
%{service_del_preun target.service}
%files %{python_files}
%python_alternative %{_bindir}/targetctl
%{python_sitelib}/*
%files -n %{name}-common
%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