Blame SPECS/python-pyghmi.spec

7d013c
%{?python_enable_dependency_generator}
7d013c
%global sname pyghmi
7d013c
%global common_summary Python General Hardware Management Initiative (IPMI and others)
7d013c
7d013c
%global common_desc This is a pure Python implementation of IPMI protocol. \
7d013c
\
7d013c
The included pyghmicons and pyghmiutil scripts demonstrate how one may \
7d013c
incorporate the pyghmi library into a Python application.
7d013c
7d013c
%global common_desc_tests Tests for the pyghmi library
7d013c
7d013c
# Enable python3 build in fedora and rhel>7 and python2 only for rhel=7
7d013c
%if 0%{?fedora} || 0%{?rhel} > 7
7d013c
%global with_python3 1
7d013c
%global with_python2 0
7d013c
%else
7d013c
%global with_python3 0
7d013c
%global with_python2 1
7d013c
%endif
7d013c
7d013c
%if %{lua: if (string.find(rpm.expand("%{?dist}"), "ost") == nil) then print(0) else print(1) end}
7d013c
%bcond_without              docs
7d013c
%else
7d013c
%bcond_with                 docs
7d013c
%endif
7d013c
7d013c
Summary: %{common_summary}
7d013c
Name: python-%{sname}
7d013c
Version: %{?version:%{version}}%{!?version:1.5.29}
7d013c
Release: 1%{?dist}
7d013c
Source0: https://tarballs.opendev.org/x/%{sname}/%{sname}-%{version}.tar.gz
7d013c
License: ASL 2.0
7d013c
Prefix: %{_prefix}
7d013c
BuildArch: noarch
7d013c
Url: https://git.openstack.org/cgit/openstack/pyghmi
7d013c
7d013c
Patch0:  nopbr.patch
7d013c
Patch1:  setup.patch
7d013c
7d013c
%description
7d013c
%{common_desc}
7d013c
7d013c
%if 0%{?with_python2}
7d013c
%package -n python2-%{sname}
7d013c
Summary: %{common_summary}
7d013c
%{?python_provide:%python_provide python2-%{sname}}
7d013c
7d013c
BuildRequires: openstack-macros
7d013c
BuildRequires: python2-devel
7d013c
#BuildRequires: python2-pbr
7d013c
BuildRequires: python2-setuptools
7d013c
7d013c
Requires: python2-cryptography >= 2.1
7d013c
Requires: python2-six >= 1.10.0
7d013c
Requires: python2-dateutil >= 2.6.1
7d013c
7d013c
%description -n python2-%{sname}
7d013c
%{common_desc}
7d013c
7d013c
%package -n python2-%{sname}-tests
7d013c
Summary: %{common_desc_tests}
7d013c
Requires: python2-%{sname} = %{version}-%{release}
7d013c
7d013c
%description -n python2-%{sname}-tests
7d013c
%{common_desc_tests}
7d013c
7d013c
%endif # with_python2
7d013c
7d013c
%if 0%{?with_python3}
7d013c
7d013c
%package -n python3-%{sname}
7d013c
Summary: %{common_summary}
7d013c
%{?python_provide:%python_provide python3-%{sname}}
7d013c
7d013c
BuildRequires: python3-devel
7d013c
#BuildRequires: python3-pbr
7d013c
BuildRequires: python3-setuptools
7d013c
7d013c
Requires: python3-cryptography >= 2.1
7d013c
Requires: python3-six >= 1.10.0
7d013c
Requires: python3-dateutil >= 2.6.1
7d013c
7d013c
%description -n python3-%{sname}
7d013c
%{common_desc}
7d013c
7d013c
%package -n python3-%{sname}-tests
7d013c
Summary: %{common_desc_tests}
7d013c
Requires: python3-%{sname} = %{version}-%{release}
7d013c
7d013c
%description -n python3-%{sname}-tests
7d013c
%{common_desc_tests}
7d013c
7d013c
%endif # with_python3
7d013c
7d013c
%if %{with docs}
7d013c
7d013c
%package -n python-%{sname}-doc
7d013c
Summary: The pyghmi library documentation
7d013c
7d013c
%if 0%{?with_python2}
7d013c
BuildRequires: python-sphinx
7d013c
BuildRequires: python2-openstackdocstheme
7d013c
%else
7d013c
BuildRequires: python3-sphinx
7d013c
BuildRequires: python3-openstackdocstheme
7d013c
%endif
7d013c
7d013c
%description -n python-%{sname}-doc
7d013c
Documentation for the pyghmi library
7d013c
7d013c
%endif
7d013c
7d013c
%prep
7d013c
%setup -qn %{sname}-%{version}
7d013c
%patch0 -p1
7d013c
%patch1 -p1
7d013c
7d013c
# NOTE(dtantsur): pyghmi is actual fine with older dateutil, 2.8.1 is missing
7d013c
# from both Fedora and CentOS currently. See
7d013c
# https://bugzilla.redhat.com/show_bug.cgi?id=1835084
7d013c
sed -i 's/python-dateutil.*/python-dateutil>=2.6.1/' requirements.txt
7d013c
7d013c
sed -i s/@@REDHATVERSION@@/%{version}/ pyghmi/version.py
7d013c
# If not PBR, use the setup.py.tmpl
7d013c
sed -e "s/#VERSION#/%{version}/" setup.py.tmpl > setup.py
7d013c
7d013c
%build
7d013c
%if 0%{?with_python3}
7d013c
%py3_build
7d013c
%if %{with docs}
7d013c
%{__python3} setup.py build_sphinx -b html
7d013c
%endif
7d013c
%endif # with_python3
7d013c
7d013c
%if 0%{?with_python2}
7d013c
%py2_build
7d013c
%if %{with docs}
7d013c
%{__python2} setup.py build_sphinx -b html
7d013c
%endif
7d013c
%endif
7d013c
7d013c
# remove the sphinx-build leftovers
7d013c
rm -rf doc/build/html/.{doctrees,buildinfo}
7d013c
7d013c
%install
7d013c
%if 0%{?with_python3}
7d013c
%py3_install
7d013c
7d013c
# rename python3 binary
7d013c
pushd %{buildroot}/%{_bindir}
7d013c
mv pyghmicons pyghmicons-%{python3_version}
7d013c
ln -s pyghmicons-%{python3_version} pyghmicons-3
7d013c
ln -s pyghmicons-3 pyghmicons
7d013c
mv pyghmiutil pyghmiutil-%{python3_version}
7d013c
ln -s pyghmiutil-%{python3_version} pyghmiutil-3
7d013c
ln -s pyghmiutil-3 pyghmiutil
7d013c
mv virshbmc virshbmc-%{python3_version}
7d013c
ln -s virshbmc-%{python3_version} virshbmc-3
7d013c
ln -s virshbmc-3 virshbmc
7d013c
popd
7d013c
7d013c
%endif # with_python3
7d013c
7d013c
%if 0%{?with_python2}
7d013c
%py2_install
7d013c
%endif
7d013c
7d013c
%if 0%{?with_python3}
7d013c
%files -n python3-%{sname}
7d013c
%license LICENSE
7d013c
%{_bindir}/pyghmicons*
7d013c
%{_bindir}/pyghmiutil*
7d013c
%{_bindir}/virshbmc*
7d013c
%{_bindir}/fakebmc
7d013c
%{python3_sitelib}/%{sname}
7d013c
%{python3_sitelib}/%{sname}-*.egg-info
7d013c
%exclude %{python3_sitelib}/%{sname}/tests
7d013c
7d013c
%files -n python3-%{sname}-tests
7d013c
%license LICENSE
7d013c
%{python3_sitelib}/%{sname}/tests
7d013c
%endif # with_python3
7d013c
7d013c
%if 0%{?with_python2}
7d013c
%files -n python2-%{sname}
7d013c
%license LICENSE
7d013c
%{_bindir}/pyghmicons
7d013c
%{_bindir}/pyghmiutil
7d013c
%{_bindir}/virshbmc
7d013c
%{_bindir}/fakebmc
7d013c
%{python2_sitelib}/%{sname}
7d013c
%{python2_sitelib}/%{sname}-*.egg-info
7d013c
%exclude %{python2_sitelib}/%{sname}/tests
7d013c
7d013c
%files -n python2-%{sname}-tests
7d013c
%license LICENSE
7d013c
%{python2_sitelib}/%{sname}/tests
7d013c
%endif
7d013c
7d013c
%if %{with docs}
7d013c
7d013c
%files -n python-%{sname}-doc
7d013c
%license LICENSE
7d013c
%doc doc/build/html README.md
7d013c
7d013c
%endif # with docs
7d013c
7d013c
%changelog
7d013c
* Fri Aug  6 2021 Pavel Cahyna <pcahyna@redhat.com> - 1.5.29-1
7d013c
- Updated to 1.5.29.
7d013c
- Avoid dependency on python-pbr, conditionalize docs build, to allow building in RHEL.
7d013c
  Inspired by python-sushy.
7d013c
7d013c
* Fri Nov 06 2020 Joel Capitao <jcapitao@redhat.com> - 1.5.19-1
7d013c
- Updated to 1.5.19.
7d013c
7d013c
* Sun Aug 30 2020 Dmitry Tantsur <divius.inside@gmail.com> - 1.5.16-1
7d013c
- Updated to 1.5.16.
7d013c
7d013c
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.14-5
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
7d013c
7d013c
* Tue May 26 2020 Dmitry Tantsur <divius.inside@gmail.com> - 1.5.14-4
7d013c
- Relax dateutil requirement in requirement.txt as well (#1835084)
7d013c
7d013c
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.5.14-3
7d013c
- Rebuilt for Python 3.9
7d013c
7d013c
* Wed May 13 2020 Yatin Karel <ykarel@redhat.com> - 1.5.14-2
7d013c
- Fix typo in requirements
7d013c
7d013c
* Mon May 11 2020 Yatin Karel <ykarel@redhat.com> - 1.5.14-1
7d013c
- Updated to 1.5.14.
7d013c
7d013c
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.2.16-4
7d013c
- Rebuilt for Python 3.8.0rc1 (#1748018)
7d013c
7d013c
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.2.16-3
7d013c
- Rebuilt for Python 3.8
7d013c
7d013c
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.16-2
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
7d013c
7d013c
* Tue Feb 05 2019 Alfredo Moralejo <amoralej@redhat.com> - 1.2.16-1
7d013c
- Updated to 1.2.16.
7d013c
7d013c
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.4-5
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
7d013c
7d013c
* Thu Oct 11 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.4-4
7d013c
- Python2 binary package has been removed
7d013c
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
7d013c
7d013c
* Tue Aug 14 2018 Ilya Etingof <etingof@gmail.com> - 1.2.4-3
7d013c
- Added Python 3 build
7d013c
7d013c
* Mon Aug 13 2018 Ilya Etingof <etingof@gmail.com> - 1.2.4-1
7d013c
- Upstream 1.2.4
7d013c
7d013c
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.22-4
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
7d013c
7d013c
* Fri Feb 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.0.22-3
7d013c
- Update Python 2 dependency declarations to new packaging standards
7d013c
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
7d013c
7d013c
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.22-2
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
7d013c
7d013c
* Thu Oct  5 2017 Haïkel Guémar <hguemar@fedoraproject.org> - 1.0.22-1
7d013c
- Upstream 1.0.22
7d013c
7d013c
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.12-4
7d013c
- Python 2 binary package renamed to python2-pyghmi
7d013c
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
7d013c
7d013c
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.12-3
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
7d013c
7d013c
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.12-2
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
7d013c
7d013c
* Mon Nov 07 2016 Lucas Alvares Gomes <lucasagomes@gmail.com> - 1.0.12-1
7d013c
- Rebased to 1.0.12
7d013c
7d013c
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.0-3
7d013c
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
7d013c
7d013c
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-2
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
7d013c
7d013c
* Fri Sep 25 2015 Lucas Alvares Gomes <lucasagomes@gmail.com> - 0.8.0-1
7d013c
- Rebased to 0.8.0
7d013c
7d013c
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.9-3
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
7d013c
7d013c
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.9-2
7d013c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
7d013c
7d013c
* Thu Feb 20 2014 Lucas Alvares Gomes <lucasagomes@gmail.com> - 0.5.9-1
7d013c
- Initial package.