From 2ba1fb74947cacb0f1a44bb2c19cc80d353e2d0c4857576c0f94906f3de688c7 Mon Sep 17 00:00:00 2001 From: Lee Duncan Date: Sat, 24 Oct 2020 18:14:03 +0000 Subject: [PATCH] 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 --- python-rtslib-fb.changes | 8 ++++++++ python-rtslib-fb.spec | 32 +++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/python-rtslib-fb.changes b/python-rtslib-fb.changes index daa5b54..9d079e4 100644 --- a/python-rtslib-fb.changes +++ b/python-rtslib-fb.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Oct 23 18:20:23 UTC 2020 - Lee Duncan + +- 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 diff --git a/python-rtslib-fb.spec b/python-rtslib-fb.spec index 65dec2b..2530fa6 100644 --- a/python-rtslib-fb.spec +++ b/python-rtslib-fb.spec @@ -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