Blame SPECS/python-azure-sdk.spec

4d8cd0
%if 0%{?fedora}
4d8cd0
%global _with_python3 1
4d8cd0
# Documentation generation disabled on EPEL because
4d8cd0
# fontawesome-fonts-web package, required by python-sphinx_rtd_theme,
4d8cd0
# is dead
4d8cd0
%global _with_doc 1
4d8cd0
# Tests disabled:
4d8cd0
# - on EPEL because of missing dependencies
4d8cd0
# - on Fedora < 25 because python-vcrpy >= 1.8.0 is required
4d8cd0
%if 0%{?fedora} >= 25
4d8cd0
%global _with_tests 1
4d8cd0
%endif
4d8cd0
%endif
4d8cd0
4d8cd0
%if 0%{?rhel}
4d8cd0
%global py2_prefix python
4d8cd0
%else
4d8cd0
%global py2_prefix python2
4d8cd0
%endif
4d8cd0
4d8cd0
%global srcname azure-sdk
4d8cd0
# global prerelease rc6
4d8cd0
4d8cd0
%global common_summary Microsoft Azure SDK for Python
4d8cd0
%global common_description This project provides a set of Python packages that make it easy to access the\
4d8cd0
Microsoft Azure components such as ServiceManagement, Storage*, and ServiceBus.
4d8cd0
4d8cd0
Name:           python-%{srcname}
4d8cd0
# Remember to delete examples-directory from Source file for new releases
4d8cd0
# due to possible licensing issues
4d8cd0
Version:        4.0.0
4d8cd0
Release:        %{?prerelease:0.}1%{?prerelease:.%{prerelease}}%{?dist}
4d8cd0
Summary:        %{common_summary}
4d8cd0
4d8cd0
Group:          System Environment/Libraries
4d8cd0
# All packages are licensed under the MIT license, except:
4d8cd0
# - azure-servicebus
4d8cd0
# - azure-servicemanagement-legacy
4d8cd0
License:        MIT and ASL 2.0
4d8cd0
URL:            https://github.com/Azure/azure-sdk-for-python/
4d8cd0
Source0:        %{srcname}-%{version}%{?prerelease}.tar.gz
4d8cd0
# azure-mgmt-compute directory from:
4d8cd0
# https://github.com/Azure/azure-sdk-for-python/releases/tag/azure-mgmt-compute_5.0.0
4d8cd0
Source1:        azure-mgmt-compute-5.0.0.tar.gz
4d8cd0
# Install namespace package modules (disabled by default, may be required by
4d8cd0
# modules depending on Azure SDK for development)
4d8cd0
Patch0:         %{name}-4.0.0-nspkgs.patch
4d8cd0
# Disable tests requiring online access to Azure
4d8cd0
Patch1:         %{name}-4.0.0-tests.patch
4d8cd0
# Fix python 3 setup.py tests
4d8cd0
Patch2:         setup.py-fix.patch
4d8cd0
4d8cd0
BuildRequires:  %{py2_prefix}-setuptools
4d8cd0
BuildRequires:  python2-devel
4d8cd0
4d8cd0
Requires:       pyOpenSSL
4d8cd0
Requires:       %{py2_prefix}-msrest >= 0.5.4
4d8cd0
Requires:       %{py2_prefix}-msrestazure >= 0.5.1
4d8cd0
Requires:       %{py2_prefix}-requests
4d8cd0
4d8cd0
# Needed to build documentation
4d8cd0
%if 0%{?_with_doc}
4d8cd0
BuildRequires:  python-pip
4d8cd0
BuildRequires:  %{py2_prefix}-sphinx
4d8cd0
BuildRequires:  %{py2_prefix}-sphinx_rtd_theme
4d8cd0
%endif
4d8cd0
%if 0%{?_with_python3}
4d8cd0
BuildRequires:  python3-devel
4d8cd0
%endif
4d8cd0
# Needed for tests
4d8cd0
%if 0%{?_with_tests}
4d8cd0
BuildRequires:  %{py2_prefix}-certifi
4d8cd0
BuildRequires:  python-chardet
4d8cd0
BuildRequires:  %{py2_prefix}-coverage
4d8cd0
BuildRequires:  python-enum34
4d8cd0
BuildRequires:  python-isodate
4d8cd0
BuildRequires:  %{py2_prefix}-keyring
4d8cd0
BuildRequires:  %{py2_prefix}-msrest
4d8cd0
BuildRequires:  %{py2_prefix}-msrestazure
4d8cd0
BuildRequires:  %{py2_prefix}-nose
4d8cd0
BuildRequires:  %{py2_prefix}-oauthlib
4d8cd0
BuildRequires:  %{py2_prefix}-requests
4d8cd0
BuildRequires:  %{py2_prefix}-requests-oauthlib
4d8cd0
BuildRequires:  python-vcrpy >= 1.8.0
4d8cd0
%if 0%{?_with_python3}
4d8cd0
BuildRequires:  python3-certifi
4d8cd0
BuildRequires:  python3-chardet
4d8cd0
BuildRequires:  python3-coverage
4d8cd0
BuildRequires:  python3-enum34
4d8cd0
BuildRequires:  python3-isodate
4d8cd0
BuildRequires:  python3-keyring
4d8cd0
BuildRequires:  python3-msrest
4d8cd0
BuildRequires:  python3-msrestazure
4d8cd0
BuildRequires:  python3-nose
4d8cd0
BuildRequires:  python3-oauthlib
4d8cd0
BuildRequires:  python3-requests
4d8cd0
BuildRequires:  python3-requests-oauthlib
4d8cd0
BuildRequires:  python3-vcrpy >= 1.8.0
4d8cd0
%endif
4d8cd0
%endif
4d8cd0
BuildArch:      noarch
4d8cd0
4d8cd0
%description
4d8cd0
%{common_description}
4d8cd0
4d8cd0
4d8cd0
%if 0%{?_with_python3}
4d8cd0
%package -n python3-%{srcname}
4d8cd0
Summary:        %{common_summary}
4d8cd0
Requires:       python3-msrest
4d8cd0
Requires:       python3-msrestazure
4d8cd0
Requires:       python3-pyOpenSSL
4d8cd0
Requires:       python3-requests
4d8cd0
%{?python_provide:%python_provide python3-%{srcname}}
4d8cd0
4d8cd0
%description -n python3-%{srcname}
4d8cd0
%{common_description}
4d8cd0
%endif
4d8cd0
4d8cd0
4d8cd0
%if 0%{?_with_doc}
4d8cd0
%package doc
4d8cd0
Summary:        Documentation for %{name}
4d8cd0
Group:          Documentation
4d8cd0
4d8cd0
%description doc
4d8cd0
%{common_description}
4d8cd0
4d8cd0
This package provides documentation for %{name}.
4d8cd0
%endif
4d8cd0
4d8cd0
4d8cd0
%prep
4d8cd0
%setup -q -n %{srcname}-for-python-azure_%{version}%{?prerelease}
4d8cd0
4d8cd0
rm -rf azure-mgmt-compute
4d8cd0
tar -xzf %SOURCE1
4d8cd0
4d8cd0
%patch0 -p0
4d8cd0
%patch1 -p0
4d8cd0
%patch2 -p1
4d8cd0
4d8cd0
# delete Python 3 specific code that fails in Python 2 in Azure SDK 4.0+
4d8cd0
find -name "*_py3.py" -exec rm -v {} \;
4d8cd0
4d8cd0
# Disable online tests requiring python-azure-storage
4d8cd0
# TODO: once the python-azure-storage package available, re-enable it
4d8cd0
rm azure-servicemanagement-legacy/tests/test_legacy_mgmt_misc.py
4d8cd0
4d8cd0
# append bundled-directory to search path
4d8cd0
sed -i "/^import keyring/iimport sys\nsys.path.insert(0, '%{_libdir}/fence-agents/bundled')" azure-batch/azure/batch/batch_auth.py
4d8cd0
4d8cd0
4d8cd0
%build
4d8cd0
%py2_build
4d8cd0
%{?_with_python3:%py3_build}
4d8cd0
4d8cd0
# Build documentation
4d8cd0
%if 0%{?_with_doc}
4d8cd0
%make_build -C doc/ html
4d8cd0
rm doc/_build/html/.buildinfo
4d8cd0
%endif
4d8cd0
4d8cd0
4d8cd0
%install
4d8cd0
%py2_install
4d8cd0
%if 0%{?_with_python3}
4d8cd0
%py3_install
4d8cd0
%endif
4d8cd0
4d8cd0
4d8cd0
%check
4d8cd0
%if 0%{?_with_tests}
4d8cd0
%{__python2} azure_nosetests.py
4d8cd0
%{?_with_python3:%{__python3} azure_nosetests.py}
4d8cd0
%endif
4d8cd0
4d8cd0
4d8cd0
%files -n python-%{srcname}
4d8cd0
%doc CONTRIBUTING.md README.rst
4d8cd0
%license LICENSE.txt
4d8cd0
%{python2_sitelib}/*
4d8cd0
4d8cd0
4d8cd0
%if 0%{?_with_python3}
4d8cd0
%files -n python3-%{srcname}
4d8cd0
%doc CONTRIBUTING.md README.rst
4d8cd0
%license LICENSE.txt
4d8cd0
%{python3_sitelib}/*
4d8cd0
%endif
4d8cd0
4d8cd0
4d8cd0
%if 0%{?_with_doc}
4d8cd0
%files doc
4d8cd0
%doc doc/_build/html/
4d8cd0
%license LICENSE.txt
4d8cd0
%endif
4d8cd0
4d8cd0
4d8cd0
%changelog
4d8cd0
* Tue May 14 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.0.0-1
4d8cd0
- Update to 4.0.0 + azure-mgmt-compute 5.0.0 (for skip_shutdown feature)
4d8cd0
4d8cd0
  Resolves: rhbz#1707857
4d8cd0
4d8cd0
* Thu Jan 25 2018 Oyvind Albrigtsen <oalbrigt@redhat.com> - 2.0.0-3
4d8cd0
- Remove examples-directory from Source tarball due to possible
4d8cd0
  licensing issues
4d8cd0
- Append python-keyring bundled directory to search path where needed
4d8cd0
4d8cd0
  Resolves: rhbz#1511222
4d8cd0
4d8cd0
* Sun Sep 03 2017 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-2
4d8cd0
- Use python2- prefix for Fedora dependencies if possible
4d8cd0
- Use parallel make to build documentation
4d8cd0
4d8cd0
* Thu Jun 15 2017 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-1
4d8cd0
- Update to 2.0.0
4d8cd0
- Move documentation to a subpackage
4d8cd0
4d8cd0
* Tue Sep 27 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-0.8.rc6
4d8cd0
- Update to 2.0.0rc6
4d8cd0
4d8cd0
* Thu Jul 21 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-0.7.rc5
4d8cd0
- Update to 2.0.0rc5
4d8cd0
- Build documentation
4d8cd0
- Run tests at build
4d8cd0
4d8cd0
* Thu May 26 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-0.6.rc4
4d8cd0
- Update to 2.0.0rc4
4d8cd0
4d8cd0
* Sun May 01 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-0.5.rc3
4d8cd0
- Update to 2.0.0rc3
4d8cd0
4d8cd0
* Mon Apr 11 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-0.4.rc2
4d8cd0
- Update to 2.0.0rc2
4d8cd0
4d8cd0
* Fri Mar 25 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-0.3.rc1
4d8cd0
- Add missing dependency to enum34 Python module
4d8cd0
4d8cd0
* Sat Mar 05 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-0.2.rc1
4d8cd0
- Update to 2.0.0rc1
4d8cd0
4d8cd0
* Mon Feb 29 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 2.0.0-0.1.a1
4d8cd0
- Update to 2.0.0a1
4d8cd0
- Improve macros for Python 3 subpackage
4d8cd0
4d8cd0
* Mon Feb 08 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.0.3-1
4d8cd0
- Update to 1.0.3
4d8cd0
4d8cd0
* Sun Jan 10 2016 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.0.2-1
4d8cd0
- Initial RPM release