diff --git a/.python-pyghmi.metadata b/.python-pyghmi.metadata index 49b344c..fa4f2e5 100644 --- a/.python-pyghmi.metadata +++ b/.python-pyghmi.metadata @@ -1 +1 @@ -0b3b4b4ebd0adce8cd4a2aac0a1a2c428dd073fc SOURCES/pyghmi-1.5.29.tar.gz +b4c360ad6c5d24417e0e7c0dba7a567b6c2d9325 SOURCES/pyghmi-1.5.69.tar.gz diff --git a/SOURCES/setup.patch b/SOURCES/setup.patch index 317cce0..04a4994 100644 --- a/SOURCES/setup.patch +++ b/SOURCES/setup.patch @@ -2,12 +2,13 @@ diff -up pyghmi-1.5.14/.orig.orig pyghmi-1.5.14/.orig diff -up pyghmi-1.5.14/setup.py.tmpl.orig pyghmi-1.5.14/setup.py.tmpl --- pyghmi-1.5.14/setup.py.tmpl.orig 2021-08-06 11:44:02.618240604 +0200 +++ pyghmi-1.5.14/setup.py.tmpl 2021-08-06 11:44:35.586675599 +0200 -@@ -26,6 +26,15 @@ setuptools.setup( +@@ -26,6 +26,16 @@ setuptools.setup( packages=['pyghmi', 'pyghmi.util', 'pyghmi.ipmi', 'pyghmi.cmd', 'pyghmi.redfish', 'pyghmi.ipmi.private', 'pyghmi.ipmi.oem', 'pyghmi.ipmi.oem.lenovo', 'pyghmi.redfish.oem', -- 'pyghmi.redfish.oem.lenovo'], -+ 'pyghmi.redfish.oem.lenovo', 'pyghmi.tests'], +- 'pyghmi.redfish.oem.dell', 'pyghmi.redfish.oem.lenovo'], ++ 'pyghmi.redfish.oem.dell', 'pyghmi.redfish.oem.lenovo', ++ 'pyghmi.tests'], + entry_points={ + 'console_scripts': [ + 'pyghmicons=pyghmi.cmd.pyghmicons:main', diff --git a/SPECS/python-pyghmi.spec b/SPECS/python-pyghmi.spec index 44d89e2..944dc9a 100644 --- a/SPECS/python-pyghmi.spec +++ b/SPECS/python-pyghmi.spec @@ -1,4 +1,7 @@ -%{?python_enable_dependency_generator} +%bcond docs %{undefined rhel} +%bcond pbr %{undefined rhel} +%bcond tests %{undefined rhel} + %global sname pyghmi %global common_summary Python General Hardware Management Initiative (IPMI and others) @@ -9,76 +12,44 @@ incorporate the pyghmi library into a Python application. %global common_desc_tests Tests for the pyghmi library -# Enable python3 build in fedora and rhel>7 and python2 only for rhel=7 -%if 0%{?fedora} || 0%{?rhel} > 7 -%global with_python3 1 -%global with_python2 0 -%else -%global with_python3 0 -%global with_python2 1 -%endif - -%if %{lua: if (string.find(rpm.expand("%{?dist}"), "ost") == nil) then print(0) else print(1) end} -%bcond_without docs -%else -%bcond_with docs -%endif - Summary: %{common_summary} Name: python-%{sname} -Version: %{?version:%{version}}%{!?version:1.5.29} -Release: 1%{?dist} +Version: %{?version:%{version}}%{!?version:1.5.69} +Release: 6%{?dist} Source0: https://tarballs.opendev.org/x/%{sname}/%{sname}-%{version}.tar.gz -License: ASL 2.0 +License: Apache-2.0 Prefix: %{_prefix} BuildArch: noarch -Url: https://git.openstack.org/cgit/openstack/pyghmi +Url: https://opendev.org/x/pyghmi -Patch0: nopbr.patch -Patch1: setup.patch +## RHEL-specific patches +Patch1000: nopbr.patch +Patch1001: setup.patch %description %{common_desc} -%if 0%{?with_python2} -%package -n python2-%{sname} -Summary: %{common_summary} -%{?python_provide:%python_provide python2-%{sname}} - -BuildRequires: openstack-macros -BuildRequires: python2-devel -#BuildRequires: python2-pbr -BuildRequires: python2-setuptools - -Requires: python2-cryptography >= 2.1 -Requires: python2-six >= 1.10.0 -Requires: python2-dateutil >= 2.6.1 - -%description -n python2-%{sname} -%{common_desc} - -%package -n python2-%{sname}-tests -Summary: %{common_desc_tests} -Requires: python2-%{sname} = %{version}-%{release} - -%description -n python2-%{sname}-tests -%{common_desc_tests} - -%endif # with_python2 - -%if 0%{?with_python3} - %package -n python3-%{sname} Summary: %{common_summary} %{?python_provide:%python_provide python3-%{sname}} BuildRequires: python3-devel -#BuildRequires: python3-pbr +%if %{with pbr} +BuildRequires: python3-pbr +%endif BuildRequires: python3-setuptools +%if %{with tests} +BuildRequires: python3-oslotest +BuildRequires: python3-stestr +%endif + +BuildRequires: python3-cryptography +BuildRequires: python3-six +BuildRequires: python3-dateutil Requires: python3-cryptography >= 2.1 Requires: python3-six >= 1.10.0 -Requires: python3-dateutil >= 2.6.1 +Requires: python3-dateutil >= 2.8.1 %description -n python3-%{sname} %{common_desc} @@ -90,87 +61,50 @@ Requires: python3-%{sname} = %{version}-%{release} %description -n python3-%{sname}-tests %{common_desc_tests} -%endif # with_python3 - %if %{with docs} - %package -n python-%{sname}-doc Summary: The pyghmi library documentation -%if 0%{?with_python2} -BuildRequires: python-sphinx -BuildRequires: python2-openstackdocstheme -%else BuildRequires: python3-sphinx BuildRequires: python3-openstackdocstheme -%endif %description -n python-%{sname}-doc Documentation for the pyghmi library - %endif %prep %setup -qn %{sname}-%{version} -%patch0 -p1 -%patch1 -p1 - -# NOTE(dtantsur): pyghmi is actual fine with older dateutil, 2.8.1 is missing -# from both Fedora and CentOS currently. See -# https://bugzilla.redhat.com/show_bug.cgi?id=1835084 -sed -i 's/python-dateutil.*/python-dateutil>=2.6.1/' requirements.txt - +%if %{without pbr} +%patch -P1000 -p1 +%patch -P1001 -p1 sed -i s/@@REDHATVERSION@@/%{version}/ pyghmi/version.py -# If not PBR, use the setup.py.tmpl sed -e "s/#VERSION#/%{version}/" setup.py.tmpl > setup.py +%endif %build -%if 0%{?with_python3} %py3_build %if %{with docs} -%{__python3} setup.py build_sphinx -b html -%endif -%endif # with_python3 - -%if 0%{?with_python2} -%py2_build -%if %{with docs} -%{__python2} setup.py build_sphinx -b html -%endif -%endif +sphinx-build -b html doc/source doc/build/html # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} +%endif %install -%if 0%{?with_python3} %py3_install -# rename python3 binary -pushd %{buildroot}/%{_bindir} -mv pyghmicons pyghmicons-%{python3_version} -ln -s pyghmicons-%{python3_version} pyghmicons-3 -ln -s pyghmicons-3 pyghmicons -mv pyghmiutil pyghmiutil-%{python3_version} -ln -s pyghmiutil-%{python3_version} pyghmiutil-3 -ln -s pyghmiutil-3 pyghmiutil -mv virshbmc virshbmc-%{python3_version} -ln -s virshbmc-%{python3_version} virshbmc-3 -ln -s virshbmc-3 virshbmc -popd - -%endif # with_python3 - -%if 0%{?with_python2} -%py2_install +%check +%if %{with tests} +stestr run +%else +%py3_check_import %{sname} %{sname}.cmd %{sname}.ipmi %{sname}.ipmi.oem %{sname}.ipmi.oem.lenovo %{sname}.ipmi.private %{sname}.redfish %{sname}.redfish.oem %{sname}.redfish.oem.dell %{sname}.redfish.oem.lenovo %{sname}.util %endif -%if 0%{?with_python3} %files -n python3-%{sname} %license LICENSE -%{_bindir}/pyghmicons* -%{_bindir}/pyghmiutil* -%{_bindir}/virshbmc* +%{_bindir}/pyghmicons +%{_bindir}/pyghmiutil +%{_bindir}/virshbmc %{_bindir}/fakebmc %{python3_sitelib}/%{sname} %{python3_sitelib}/%{sname}-*.egg-info @@ -179,37 +113,70 @@ popd %files -n python3-%{sname}-tests %license LICENSE %{python3_sitelib}/%{sname}/tests -%endif # with_python3 - -%if 0%{?with_python2} -%files -n python2-%{sname} -%license LICENSE -%{_bindir}/pyghmicons -%{_bindir}/pyghmiutil -%{_bindir}/virshbmc -%{_bindir}/fakebmc -%{python2_sitelib}/%{sname} -%{python2_sitelib}/%{sname}-*.egg-info -%exclude %{python2_sitelib}/%{sname}/tests - -%files -n python2-%{sname}-tests -%license LICENSE -%{python2_sitelib}/%{sname}/tests -%endif %if %{with docs} - %files -n python-%{sname}-doc %license LICENSE %doc doc/build/html README.md - -%endif # with docs +%endif %changelog -* Fri Aug 6 2021 Pavel Cahyna - 1.5.29-1 -- Updated to 1.5.29. -- Avoid dependency on python-pbr, conditionalize docs build, to allow building in RHEL. - Inspired by python-sushy. +* Sat Jan 18 2025 Fedora Release Engineering - 1.5.69-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sat Jul 20 2024 Pavel Cahyna - 1.5.69-5 +- migrated to SPDX license + +* Fri Jul 19 2024 Fedora Release Engineering - 1.5.69-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Jun 08 2024 Python Maint - 1.5.69-3 +- Rebuilt for Python 3.13 + +* Thu May 02 2024 Yaakov Selkowitz - 1.5.69-2 +- Limit dependencies in RHEL builds + +* Sun Apr 21 2024 Dmitry Tantsur - 1.5.69-1 +- Update to 1.5.69 + +* Fri Jan 26 2024 Fedora Release Engineering - 1.5.29-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 1.5.29-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 1.5.29-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jul 11 2023 Dmitry Tantsur - 1.5.29-7 +- Avoid setup.py build_sphinx (#2221967) + +* Thu Jun 15 2023 Python Maint - 1.5.29-6 +- Rebuilt for Python 3.12 + +* Fri Jan 20 2023 Fedora Release Engineering - 1.5.29-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 1.5.29-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jun 16 2022 Python Maint - 1.5.29-3 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 1.5.29-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Aug 09 2021 Joel Capitao - 1.5.29-1 +- Update to 1.5.29. + +* Fri Jul 23 2021 Fedora Release Engineering - 1.5.19-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 1.5.19-3 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 1.5.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Fri Nov 06 2020 Joel Capitao - 1.5.19-1 - Updated to 1.5.19.