From 2ba1fb74947cacb0f1a44bb2c19cc80d353e2d0c4857576c0f94906f3de688c7 Mon Sep 17 00:00:00 2001 From: Lee Duncan Date: Sat, 24 Oct 2020 18:14:03 +0000 Subject: [PATCH 1/2] 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 From dcfd9cf84b6b09f11142f0e9470239eb0af1106e6a99635f8d57c66e8099943d Mon Sep 17 00:00:00 2001 From: Lee Duncan Date: Sun, 8 Nov 2020 19:08:39 +0000 Subject: [PATCH 2/2] Accepting request 846965 from home:lee_duncan:branches:devel:languages:python - 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. OBS-URL: https://build.opensuse.org/request/show/846965 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rtslib-fb?expand=0&rev=58 --- python-rtslib-fb.changes | 9 +++++++++ python-rtslib-fb.spec | 25 ++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/python-rtslib-fb.changes b/python-rtslib-fb.changes index 9d079e4..99895f0 100644 --- a/python-rtslib-fb.changes +++ b/python-rtslib-fb.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Nov 7 18:05:32 UTC 2020 - Lee Duncan + +- 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 diff --git a/python-rtslib-fb.spec b/python-rtslib-fb.spec index 2530fa6..50ecdce 100644 --- a/python-rtslib-fb.spec +++ b/python-rtslib-fb.spec @@ -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 @@ -34,8 +34,10 @@ BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: %{name}-common 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} @@ -46,6 +48,7 @@ Provides: python-rtslib-rbd = %{version} Obsoletes: python-rtslib-rbd < %{version} %endif BuildArch: noarch + %python_subpackages %description @@ -53,17 +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 %{name}-common +%package -n %{cpkg} Summary: Common python-rtslib-fb subpackage for Python 2 or 3 Group: Development/Languages/Python -Provides: %{python_module python-rtslib-fb-common} +Obsoletes: %{name} < %{version}-%{release} -%description -n %{name}-common +%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 @@ -105,23 +108,23 @@ ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctarget %{stop_on_removal target} %{service_del_preun target.service} -%post -n %{name}-common +%post -n %{cpkg} %{service_add_post target.service} -%postun -n %{name}-common +%postun -n %{cpkg} %{service_del_postun target.service} -%pre -n %{name}-common +%pre -n %{cpkg} %{service_add_pre target.service} -%preun -n %{name}-common +%preun -n %{cpkg} %{service_del_preun target.service} %files %{python_files} %python_alternative %{_bindir}/targetctl %{python_sitelib}/* -%files -n %{name}-common +%files -n %{cpkg} %license COPYING %doc README.md %dir %{dbdir}