From 5cd9300ca5cc656755cc7d600a320e5deaf0043e Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 14 May 2025 16:07:04 +0000 Subject: [PATCH] import UBI python-rtslib-2.1.76-12.el10 --- .gitignore | 2 +- .python-rtslib.metadata | 1 - ...=> 0001-Turn-off-unsupported-fabrics.patch | 0 ...tely-import-kmod.error-and-kmod.Kmod.patch | 35 +++ ..._dbroot.patch => 0003-default_dbroot.patch | 0 SOURCES/target.service | 15 - .../python-rtslib.spec => python-rtslib.spec | 273 +++++++++--------- sources | 1 + 8 files changed, 175 insertions(+), 152 deletions(-) delete mode 100644 .python-rtslib.metadata rename SOURCES/0001-Turn-off-unsupported-fabrics.patch => 0001-Turn-off-unsupported-fabrics.patch (100%) create mode 100644 0002-rtslib-explicitely-import-kmod.error-and-kmod.Kmod.patch rename SOURCES/0002-default_dbroot.patch => 0003-default_dbroot.patch (100%) delete mode 100644 SOURCES/target.service rename SPECS/python-rtslib.spec => python-rtslib.spec (68%) create mode 100644 sources diff --git a/.gitignore b/.gitignore index 8f103b5..5369f9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rtslib-fb-2.1.75.tar.gz +rtslib-fb-2.1.76.tar.gz diff --git a/.python-rtslib.metadata b/.python-rtslib.metadata deleted file mode 100644 index 4e54677..0000000 --- a/.python-rtslib.metadata +++ /dev/null @@ -1 +0,0 @@ -358077a7fef2e71230a1b5c87b1765c9292f17f6 SOURCES/rtslib-fb-2.1.75.tar.gz diff --git a/SOURCES/0001-Turn-off-unsupported-fabrics.patch b/0001-Turn-off-unsupported-fabrics.patch similarity index 100% rename from SOURCES/0001-Turn-off-unsupported-fabrics.patch rename to 0001-Turn-off-unsupported-fabrics.patch diff --git a/0002-rtslib-explicitely-import-kmod.error-and-kmod.Kmod.patch b/0002-rtslib-explicitely-import-kmod.error-and-kmod.Kmod.patch new file mode 100644 index 0000000..012d2ad --- /dev/null +++ b/0002-rtslib-explicitely-import-kmod.error-and-kmod.Kmod.patch @@ -0,0 +1,35 @@ +From c1378f28f7abce6f8993a43c34d5e287b092bb1e Mon Sep 17 00:00:00 2001 +From: Maurizio Lombardi +Date: Wed, 2 Aug 2023 12:00:41 +0200 +Subject: [PATCH] rtslib: explicitely import "kmod.error" and "kmod.Kmod" + +While updating python-kmod to be able to be compiled with Cython 3.0, +I encountered a failure due to rtslib not finding the "error" and "Kmod" +modules. + +$ targetcli +module 'kmod' has no attribute 'error' + +If I explicitely import those two modules the failure goes away. + +Signed-off-by: Maurizio Lombardi +--- + rtslib/utils.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/rtslib/utils.py b/rtslib/utils.py +index 61e486a80836..630ebb721465 100644 +--- a/rtslib/utils.py ++++ b/rtslib/utils.py +@@ -423,6 +423,8 @@ def modprobe(module): + + try: + import kmod ++ import kmod.error ++ import kmod.Kmod + except ImportError: + process = subprocess.Popen(("modprobe", module), + stdout=subprocess.PIPE, +-- +2.39.3 + diff --git a/SOURCES/0002-default_dbroot.patch b/0003-default_dbroot.patch similarity index 100% rename from SOURCES/0002-default_dbroot.patch rename to 0003-default_dbroot.patch diff --git a/SOURCES/target.service b/SOURCES/target.service deleted file mode 100644 index aa0a51b..0000000 --- a/SOURCES/target.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Restore LIO kernel target configuration -Requires=sys-kernel-config.mount -After=sys-kernel-config.mount network.target local-fs.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/targetctl restore -ExecStop=/usr/bin/targetctl clear -SyslogIdentifier=target - -[Install] -WantedBy=multi-user.target - diff --git a/SPECS/python-rtslib.spec b/python-rtslib.spec similarity index 68% rename from SPECS/python-rtslib.spec rename to python-rtslib.spec index 7d8858a..54fac54 100644 --- a/SPECS/python-rtslib.spec +++ b/python-rtslib.spec @@ -1,97 +1,68 @@ -%if 0%{?fedora} || 0%{?rhel} > 7 -# Enable python3 build by default -%bcond_without python3 -%else -%bcond_with python3 -%endif - -%if 0%{?rhel} > 7 -# Disable python2 build by default -# disable also docs build as they require python2 -%bcond_with python2 -%bcond_with docs -%else -%bcond_without python2 -%bcond_without docs -%endif - %global oname rtslib-fb +# epydoc is gone, so disable for now +%bcond_with apidocs + Name: python-rtslib -License: ASL 2.0 -Group: System Environment/Libraries +License: Apache-2.0 Summary: API for Linux kernel LIO SCSI target -Version: 2.1.75 -Release: 4%{?dist} +Version: 2.1.76 +Release: 12%{?dist} URL: https://github.com/open-iscsi/%{oname} Source: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz -Source1: target.service Patch0: 0001-Turn-off-unsupported-fabrics.patch -Patch1: 0002-default_dbroot.patch +Patch1: 0002-rtslib-explicitely-import-kmod.error-and-kmod.Kmod.patch +Patch2: 0003-default_dbroot.patch BuildArch: noarch -BuildRequires: systemd-units -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd +%if %{with apidocs} +BuildRequires: epydoc +%endif +BuildRequires: systemd %global _description\ API for generic Linux SCSI kernel target. Includes the 'target'\ -service and targetctl tool for restoring configuration.\ - +service and targetctl tool for restoring configuration. %description %_description -%if %{with python2} -%package -n python2-rtslib -Summary: %summary -BuildRequires: python2-devel -BuildRequires: python2-setuptools -BuildRequires: epydoc - -Requires: python2-kmod -Requires: python2-six -Requires: python2-pyudev -%{?python_provide:%python_provide python2-rtslib} - -%description -n python2-rtslib %_description -%endif # with python2 - -%if %{with docs} +%if %{with apidocs} %package doc Summary: Documentation for python-rtslib -Requires: python2-rtslib = %{version}-%{release} +Requires: python3-rtslib = %{version}-%{release} %description doc API documentation for rtslib, to configure the generic Linux SCSI multiprotocol kernel target. -%endif # with docs +%endif - -%if %{with python3} %package -n python3-rtslib Summary: API for Linux kernel LIO SCSI target BuildRequires: python3-devel BuildRequires: python3-setuptools +BuildRequires: python3-kmod +BuildRequires: python3-six +BuildRequires: python3-pyudev Requires: python3-kmod Requires: python3-six Requires: python3-pyudev +%if ! %{with apidocs} +Obsoletes: %{name}-doc < %{version}-%{release} +%endif %description -n python3-rtslib API for generic Linux SCSI kernel target. -%endif # with python3 %package -n target-restore -Summary: Systemd service for targetcli/rtslib -%if %{with python3} -Requires: python3-rtslib = %{version}-%{release} -%else -Requires: python2-rtslib = %{version}-%{release} -%endif # with python3 +Summary: Systemd service for targetcli/rtslib +Requires: python3-rtslib = %{version}-%{release} +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd %description -n target-restore Systemd service to restore the LIO kernel target settings @@ -102,44 +73,20 @@ on system restart. %setup -q -n %{oname}-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 -%if %{with python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif # with python3 %build -%if %{with python2} -%py2_build +%py3_build +%if %{with apidocs} mkdir -p doc/html epydoc --no-sourcecode --html -n rtslib -o doc/html rtslib/*.py -%endif # with python2 - -gzip --stdout doc/targetctl.8 > doc/targetctl.8.gz -gzip --stdout doc/saveconfig.json.5 > doc/saveconfig.json.5.gz - -%if 0%{?with_python3} -pushd %{py3dir} -%py3_build -popd -%endif # with python3 +%endif %install # remove py2 scripts if py3 enabled -%if %{with python3} -pushd %{py3dir} %py3_install -popd -%if %{with python2} -%{__python2} setup.py install --skip-build --root %{buildroot} --install-scripts py2scripts -rm -rf %{buildroot}/py2scripts -%endif # with python2 -%else -%if %{with python2} -%py2_install -%endif # with python2 -%endif # with python3 mkdir -p %{buildroot}%{_mandir}/man8/ mkdir -p %{buildroot}%{_mandir}/man5/ @@ -147,9 +94,9 @@ mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_sysconfdir}/target/backup mkdir -p %{buildroot}%{_localstatedir}/target/pr mkdir -p %{buildroot}%{_localstatedir}/target/alua -install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/target.service -install -m 644 doc/targetctl.8.gz %{buildroot}%{_mandir}/man8/ -install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/ +install -m 644 systemd/target.service %{buildroot}%{_unitdir}/target.service +install -m 644 doc/targetctl.8 %{buildroot}%{_mandir}/man8/ +install -m 644 doc/saveconfig.json.5 %{buildroot}%{_mandir}/man5/ %post -n target-restore %systemd_post target.service @@ -160,19 +107,11 @@ install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/ %postun -n target-restore %systemd_postun_with_restart target.service -%if %{with python2} -%files -n python2-rtslib -%license COPYING -%{python2_sitelib}/* -%doc README.md doc/getting_started.md -%endif # with python2 -%if %{with python3} %files -n python3-rtslib %license COPYING -%{python3_sitelib}/* +%{python3_sitelib}/rtslib* %doc README.md doc/getting_started.md -%endif # with python3 %files -n target-restore %{_bindir}/targetctl @@ -182,67 +121,131 @@ install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/ %dir %{_localstatedir}/target %dir %{_localstatedir}/target/pr %dir %{_localstatedir}/target/alua -%{_mandir}/man8/targetctl.8.gz -%{_mandir}/man5/saveconfig.json.5.gz +%{_mandir}/man8/targetctl.8* +%{_mandir}/man5/saveconfig.json.5* -%if %{with python2} +%if %{with apidocs} %files doc %doc doc/html -%endif # with python2 +%endif %changelog +* Tue Nov 05 2024 Maurizio Lombardi - 2.1.76-12 +- Rebuild for gating test changes -* Wed Jun 15 2022 Maurizio Lombardi - 2.1.75-4 -- Updates to the gating tests from mhoyer +* Thu Oct 31 2024 Maurizio Lombardi - 2.1.76-11 +- Add gating.yaml -* Wed Jun 15 2022 Maurizio Lombardi - 2.1.75-3 -- Update the gating tests +* Wed Oct 30 2024 Maurizio Lombardi - 2.1.76-10 +- Fix RHEL-64990 (dbroot fix and disable unsupported fabrics) -* Wed Jun 15 2022 Maurizio Lombardi - 2.1.75-2 -- Fix the gating tests +* Tue Oct 29 2024 Troy Dawson - 2.1.76-9 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 -* Mon Jun 06 2022 Maurizio Lombardi - 2.1.75-1 -- Update to the latest upstream version +* Mon Jun 24 2024 Troy Dawson - 2.1.76-8 +- Bump release for June 2024 mass rebuild -* Mon Oct 26 2020 Maurizio Lombardi - 2.1.74-1 -- Update to the latest upstream version +* Mon Feb 12 2024 Maurizio Lombardi - 2.1.76-7 +- Migrated to SPDX license -* Tue Jul 21 2020 Maurizio Lombardi - 2.1.73-2 -- Merge a fix to prevent a potential data leak when saving the config file +* Fri Jan 26 2024 Fedora Release Engineering - 2.1.76-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Thu Jun 25 2020 Maurizio Lombardi - 2.1.73-1 +* Mon Jan 22 2024 Fedora Release Engineering - 2.1.76-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Aug 02 2023 Maurizio Lombardi - 2.1.76-4 +- Fix kmod import + +* Fri Jul 21 2023 Fedora Release Engineering - 2.1.76-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jul 07 2023 Python Maint - 2.1.76-2 +- Rebuilt for Python 3.12 + + +* Tue Jun 06 2023 Maurizio Lombardi - 2.1.76-1 +- Rebase to version 2.1.76 + +* Fri Jan 20 2023 Fedora Release Engineering - 2.1.75-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 2.1.75-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 2.1.75-2 +- Rebuilt for Python 3.11 + +* Mon May 16 2022 Maurizio Lombardi - 2.1.75-1 - Update to new upstream version -* Mon May 11 2020 Maurizio Lombardi - 2.1.72-1 -- Update to new upstream version +* Wed Mar 30 2022 Maurizio Lombardi - 2.1.74-7 +- Add support for cpus_allowed_list attribute -* Thu Dec 12 2019 Maurizio Lombardi - 2.1.71-4 -- LIO should use /var/target for its runtime files +* Fri Jan 21 2022 Fedora Release Engineering - 2.1.74-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild -* Thu Nov 28 2019 Maurizio Lombardi - 2.1.71-2 -- Remove support to qla2xxx +* Fri Jul 23 2021 Fedora Release Engineering - 2.1.74-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild -* Tue Nov 19 2019 Maurizio Lombardi - 2.1.71-1 -- Update to new upstream version +* Fri Jun 04 2021 Python Maint - 2.1.74-4 +- Rebuilt for Python 3.10 -* Wed May 15 2019 Maurizio Lombardi - 2.1.fb69-4 -- report the correct size for partitions +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 2.1.74-3 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. -* Thu Jan 17 2019 Maurizio Lombardi - 2.1.fb69-3 -- Disable the FCoE fabric module +* Wed Jan 27 2021 Fedora Release Engineering - 2.1.74-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild -* Fri Sep 28 2018 Maurizio Lombardi - 2.1.fb69-2 -- Disable the unsupported fabrics - -* Tue Sep 18 2018 Maurizio Lombardi - 2.1.fb69-1 -- New upstream version that fixes a syntax error problem with python3 - -* Wed Sep 05 2018 Maurizio Lombardi - 2.1.fb68-1 +* Mon Aug 31 2020 Maurizio Lombardi - 2.1.74-1 - New upstream version -* Mon Jun 25 2018 Maurizio Lombardi - 2.1.fb67-4 -- epydoc is used only with python2 but the latter is not supported in RHEL8 - I remove the dependency +* Wed Jul 29 2020 Fedora Release Engineering - 2.1.73-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jun 25 2020 Matt Coleman - 2.1.73-1 +- New upstream version +- Use upstream's systemd service + +* Tue May 26 2020 Miro Hrončok - 2.1.fb69-9 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 2.1.fb69-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Nov 01 2019 Neal Gompa - 2.1.fb69-7 +- Fix file list for python3-rtslib subpackage +- Don't compress manpages in build phase, as rpm auto-compresses manpages +- Move systemd requires to the target-restore subpackage +- Disable building apidocs as epydoc is gone + +* Thu Oct 03 2019 Miro Hrončok - 2.1.fb69-6 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Mon Aug 19 2019 Miro Hrončok - 2.1.fb69-5 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 2.1.fb69-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 2.1.fb69-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Oct 12 2018 Zbigniew Jędrzejewski-Szmek - 2.1.fb69-2 +- Python2 binary package has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Wed Oct 10 2018 Andy Grover - 2.1.fb69-1 +- New upstream version +- Fix URL so spectool -g works + +* Sat Jul 14 2018 Fedora Release Engineering - 2.1.fb67-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 2.1.fb67-4 +- Rebuilt for Python 3.7 * Fri Mar 16 2018 Charalampos Stratakis - 2.1.fb67-3 - Don't build the Python 2 subpackage on EL > 7 diff --git a/sources b/sources new file mode 100644 index 0000000..062bbf2 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (rtslib-fb-2.1.76.tar.gz) = 50bc9f4ebff71cc87fd62036ff9d929fb1e5989be6251b1111904e76a7c026215692dc8930b90552a4ff850c6252338e420fe710993b8c8a0c737b65590a520d