commit 4782e2ebe0597d86dbc4cce107e72b0b40f562c0 Author: CentOS Sources Date: Tue May 7 08:33:57 2019 -0400 import python-sushy-1.3.1-3.el8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1a35df7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/sushy-1.3.1.tar.gz diff --git a/.python-sushy.metadata b/.python-sushy.metadata new file mode 100644 index 0000000..99faba0 --- /dev/null +++ b/.python-sushy.metadata @@ -0,0 +1 @@ +109f4312e6df1ed69047ccf76e7f38fe6364d517 SOURCES/sushy-1.3.1.tar.gz diff --git a/SOURCES/nopbr.patch b/SOURCES/nopbr.patch new file mode 100644 index 0000000..e48854d --- /dev/null +++ b/SOURCES/nopbr.patch @@ -0,0 +1,21 @@ +diff -up sushy-1.3.1/sushy/__init__.py.orig sushy-1.3.1/sushy/__init__.py +--- sushy-1.3.1/sushy/__init__.py.orig 2018-02-05 22:36:53.000000000 +0100 ++++ sushy-1.3.1/sushy/__init__.py 2018-06-25 16:32:27.850096625 +0200 +@@ -14,15 +14,14 @@ + + import logging + +-import pbr.version ++#import pbr.version + + from sushy.main import Sushy + from sushy.resources.system.constants import * # noqa + from sushy.resources.manager.constants import * # noqa + + __all__ = ('Sushy',) +-__version__ = pbr.version.VersionInfo( +- 'sushy').version_string() ++__version__ = "@@REDHATVERSION@@" + + # Set the default handler to avoid "No handler found" warnings. See: + # https://docs.python.org/3/howto/logging.html#library-config diff --git a/SOURCES/setup.patch b/SOURCES/setup.patch new file mode 100644 index 0000000..aafe1ec --- /dev/null +++ b/SOURCES/setup.patch @@ -0,0 +1,17 @@ +diff -U3 -r sushy-1.3.1-orig/setup.py sushy-1.3.1/setup.py +--- sushy-1.3.1-orig/setup.py 2018-02-05 22:36:53.000000000 +0100 ++++ sushy-1.3.1/setup.py 2018-06-26 10:30:01.808557697 +0200 +@@ -25,5 +25,11 @@ + pass + + setuptools.setup( +- setup_requires=['pbr>=2.0.0'], +- pbr=True) ++ name='sushy', ++ author='OpenStack', ++ author_email='openstack-dev@lists.openstack.org', ++ url='https://docs.openstack.org/sushy', ++ version='@@REDHATVERSION@@', ++ description='Sushy is a small Python library to communicate with Redfish based systems', ++ packages=setuptools.find_packages(), ++) diff --git a/SPECS/python-sushy.spec b/SPECS/python-sushy.spec new file mode 100644 index 0000000..f7cd54f --- /dev/null +++ b/SPECS/python-sushy.spec @@ -0,0 +1,239 @@ +%{!?upstream_version: %global upstream_version %{version}%{?milestone}} + +%global sname sushy + +# Settings for Fedora > 29 and EL > 7 +%if 0%{?fedora} > 29 || 0%{?rhel} > 7 +%bcond_with python2 +%else +%bcond_without python2 +%endif + +%if 0%{?fedora} || 0%{?rhel} > 7 +%bcond_without python3 +%endif + +%if 0%{?fedora} || 0%{?rhel} > 7 +%bcond_without python3 +%endif + +%if %{lua: if (string.find(rpm.expand("%{?dist}"), "ost") == nil) then print(0) else print(1) end} +%bcond_without docs +%bcond_without tests +%else +%bcond_with docs +%bcond_with tests +%endif + +%global common_desc \ +Sushy is a Python library to communicate with Redfish based systems (http://redfish.dmtf.org) + +%global common_desc_tests Tests for Sushy + +Name: python-%{sname} +Version: 1.3.1 +Release: 3%{?dist} +Summary: Sushy is a Python library to communicate with Redfish based systems +License: ASL 2.0 +URL: http://launchpad.net/%{sname}/ + +Source0: http://tarballs.openstack.org/%{sname}/%{sname}-%{upstream_version}.tar.gz + +Patch0: nopbr.patch +Patch1: setup.patch + +BuildArch: noarch +BuildRequires: git + +%description +%{common_desc} + +%if %{with python2} +%package -n python2-%{sname} +Summary: Sushy is a Python library to communicate with Redfish based systems +%{?python_provide:%python_provide python2-%{sname}} + +BuildRequires: python2-devel +#BuildRequires: python2-pbr +BuildRequires: python2-setuptools +# For running unit tests during check phase +BuildRequires: python2-requests +BuildRequires: python2-six + +#Requires: python2-pbr >= 2.0.0 +Requires: python2-six >= 1.10.0 +Requires: python2-requests >= 2.14.2 + +%description -n python2-%{sname} +%{common_desc} + +%if %{with tests} +%package -n python2-%{sname}-tests +Summary: Sushy tests +Requires: python2-%{sname} = %{version}-%{release} + +BuildRequires: python2-oslotest +BuildRequires: python2-testrepository +BuildRequires: python2-testscenarios +BuildRequires: python2-testtools + +Requires: python2-oslotest +Requires: python2-testrepository +Requires: python2-testscenarios +Requires: python2-testtools + +%description -n python2-%{sname}-tests +%{common_desc_tests} + +%endif + +%endif + +%if %{with python3} + +%package -n python3-%{sname} +Summary: Sushy is a Python library to communicate with Redfish based systems + +%{?python_provide:%python_provide python3-%{sname}} +BuildRequires: python3-devel +#BuildRequires: python3-pbr +BuildRequires: python3-setuptools +# For running unit tests during check phase +BuildRequires: python3-requests +BuildRequires: python3-six + +#Requires: python3-pbr >= 2.0.0 +Requires: python3-six >= 1.10.0 +Requires: python3-requests >= 2.14.2 + +%description -n python3-%{sname} +%{common_desc} + +%if %{with tests} +%package -n python3-%{sname}-tests +Summary: Sushy tests +Requires: python3-%{sname} = %{version}-%{release} + +BuildRequires: python3-oslotest +BuildRequires: python3-testrepository +BuildRequires: python3-testscenarios +BuildRequires: python3-testtools + +Requires: python3-oslotest +Requires: python3-testrepository +Requires: python3-testscenarios +Requires: python3-testtools + +%description -n python3-%{sname}-tests +%{common_desc_tests} + +%endif + +%endif # with_python3 + +%if %{with docs} + +%package -n python-%{sname}-doc +Summary: Sushy documentation + +BuildRequires: python-sphinx +BuildRequires: python-openstackdocstheme + +%description -n python-%{sname}-doc +Documentation for Sushy + +%endif + +%prep +%autosetup -n %{sname}-%{upstream_version} -S git + +# Let's handle version info ourselves +sed -i s/@@REDHATVERSION@@/%{version}/ sushy/__init__.py setup.py + +%build +%if %{with python2} +%py2_build +%endif # with_python2 +%if %{with python3} +%py3_build +%endif # with_python3 + +%if %{with docs} +# generate html docs +%{__python2} setup.py build_sphinx +# remove the sphinx-build leftovers +rm -rf doc/build/html/.{doctrees,buildinfo} +%endif + +%check +%if %{with tests} +%if %{with python2} +%{__python2} setup.py test +%endif # with_python2 +%if %{with python3} +rm -rf .testrepository +%{__python3} setup.py test +%endif # with_python3 +%endif # with tests + +%install +%if %{with python2} +%py2_install +%endif # with_python2 +%if %{with python3} +%py3_install +%endif # with_python3 + +%if %{with python2} + +%files -n python2-%{sname} +%license LICENSE +%{python2_sitelib}/%{sname} +%{python2_sitelib}/%{sname}-*.egg-info +%exclude %{python2_sitelib}/%{sname}/tests + +%if %{with tests} +%files -n python2-%{sname}-tests +%license LICENSE +%{python2_sitelib}/%{sname}/tests + +%endif # with tests + +%endif # with_python2 + +%if %{with python3} + +%files -n python3-%{sname} +%license LICENSE +%{python3_sitelib}/%{sname} +%{python3_sitelib}/%{sname}-*.egg-info +%exclude %{python3_sitelib}/%{sname}/tests + +%if %{with tests} + +%files -n python3-%{sname}-tests +%license LICENSE +%{python3_sitelib}/%{sname}/tests + +%endif # with tests + +%endif # with_python3 + +%if %{with docs} + +%files -n python-%{sname}-doc +%license LICENSE +%doc doc/build/html README.rst + +%endif # with docs + +%changelog +* Mon Jun 25 2018 Petr Viktorin - 1.3.1-3 +- Remove the pbr dependency + +* Mon May 14 2018 Pavel Cahyna - 1.3.1-2 +- Conditionalize python2, tests and docs, update python3 conditional for RHEL > 7 + +* Tue Feb 13 2018 RDO 1.3.1-1 +- Update to 1.3.1 +