Blob Blame History Raw
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global pypi_name os-win
%global pyname os_win

%if 0%{?fedora}
%global with_python3 1
%endif

Name:           python-%{pypi_name}
Version:        2.2.0
Release:        4%{?dist}
Summary:        Windows / Hyper-V library for OpenStack projects

License:        ASL 2.0
URL:            http://www.cloudbase.it/
Source0:        https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

%description
This library contains Windows / Hyper-V code commonly used in the OpenStack
projects: nova, cinder, networking-hyperv. The library can be used in any
other OpenStack projects where it is needed.

%package -n python2-%{pypi_name}
Summary:        Windows / Hyper-V library for OpenStack projects
%{?python_provide:%python_provide python2-%{pypi_name}}
BuildRequires:  python2-devel
BuildRequires:  python2-pbr
BuildRequires:  python2-sphinx
BuildRequires:  python2-oslo-sphinx
# Required for tests
BuildRequires:  python2-ddt
BuildRequires:  python2-eventlet
BuildRequires:  python2-oslo-concurrency
BuildRequires:  python2-oslo-i18n
BuildRequires:  python2-oslo-log
BuildRequires:  python2-oslo-utils
BuildRequires:  python2-oslotest
BuildRequires:  python2-pep8
BuildRequires:  python2-testrepository
BuildRequires:  python2-testscenarios
BuildRequires:  python2-testtools

Requires: python2-pbr >= 2.0.0
Requires: python2-babel >= 2.3.4
Requires: python2-eventlet >= 0.18.2
Requires: python2-oslo-concurrency >= 3.8.0
# FIXME(jpena): do not require a minimum version number, until these are available
#Requires: python2-oslo-config >= 2:4.0.0
#Requires: python2-oslo-log >= 3.22.0
Requires: python2-oslo-config
Requires: python2-oslo-log
Requires: python2-oslo-utils >= 3.20.0
Requires: python2-oslo-i18n >= 2.1.0

%description -n python2-%{pypi_name}
This library contains Windows / Hyper-V code commonly used in the OpenStack
projects: nova, cinder, networking-hyperv. The library can be used in any
other OpenStack projects where it is needed.

%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary:        Windows / Hyper-V library for OpenStack projects
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires:  python3-devel
BuildRequires:  python3-pbr
BuildRequires:  python3-sphinx
BuildRequires:  python3-oslo-sphinx
# Required for tests
BuildRequires:  python3-ddt
BuildRequires:  python3-eventlet
BuildRequires:  python3-oslo-concurrency
BuildRequires:  python3-oslo-i18n
BuildRequires:  python3-oslo-log
BuildRequires:  python3-oslo-utils
BuildRequires:  python3-oslotest
BuildRequires:  python3-pep8
BuildRequires:  python3-testrepository
BuildRequires:  python3-testscenarios
BuildRequires:  python3-testtools

Requires: python3-pbr >= 2.0.0
Requires: python3-babel >= 2.3.4
Requires: python3-eventlet >= 0.18.2
Requires: python3-oslo-concurrency >= 3.8.0
# FIXME(jpena): do not require a minimum version number, until these are available
#Requires: python3-oslo-config >= 2:4.0.0
#Requires: python3-oslo-log >= 3.22.0
Requires: python3-oslo-config
Requires: python3-oslo-log
Requires: python3-oslo-utils >= 3.20.0
Requires: python3-oslo-i18n >= 2.1.0



%description -n python3-%{pypi_name}
This library contains Windows / Hyper-V code commonly used in the OpenStack
projects: nova, cinder, networking-hyperv. The library can be used in any
other OpenStack projects where it is needed.
%endif

%package -n python-%{pypi_name}-doc
Summary:        Windows / Hyper-V library for OpenStack projects - documentation

%description -n python-%{pypi_name}-doc
Documentation for the Windows / Hyper-V library for OpenStack projects

%prep
%setup -q -n %{pypi_name}-%{upstream_version}
# We want to manage requirements ourselves
rm -rf *requirements.txt

%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif

# generate html docs
sphinx-build doc/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}

%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif

%check
%if 0%{?with_python3}
%{__python3} setup.py test
rm -rf .testrepository
%endif
%{__python2} setup.py test


%files -n python2-%{pypi_name}
%doc doc/source/readme.rst README.rst
%license LICENSE
%{python2_sitelib}/%{pyname}*

%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%license LICENSE
%doc doc/source/readme.rst README.rst
%{python3_sitelib}/%{pyname}*
%endif

%files -n python-%{pypi_name}-doc
%doc html
%license LICENSE

%changelog
* Tue Feb 27 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.2.0-4
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Sep 20 2017 Javier Peña <jpena@redhat.com> - 2.2.0-2
- Temporarily remove version requirements for oslo-log and oslo-config

* Tue Sep 12 2017 Javier Peña <jpena@redhat.com> - 2.2.0-1
- Updated to upstream version 2.2.0

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Mar 17 2017 Javier Peña <jpena@redhat.com> - 1.4.1-1
- Initial version, based on the RDO spec