diff --git a/python-adal.spec b/python-adal.spec index 1f2113c..4095696 100644 --- a/python-adal.spec +++ b/python-adal.spec @@ -8,10 +8,14 @@ authenticate to AAD in order to access AAD protected web resources. %global _with_python3 1 # httpretty library is not available for Python 3 in EL %global _with_py3_tests 0%{?fedora} +# Sphinx version provided by EL is missing the imgmath extension +%global _with_doc 0%{?fedora} +%global pydoc_prefix %{?rhel:python}%{?fedora:python%{python3_pkgversion}} +%global sphinxbuild sphinx-build%{?fedora:-%{python3_version}} Name: python-%{srcname} Version: 1.2.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: ADAL for Python License: MIT @@ -45,6 +49,9 @@ BuildRequires: python%{python3_pkgversion}-requests BuildRequires: python%{python3_pkgversion}-pytest %endif %endif +%if 0%{?_with_doc} +BuildRequires: %{pydoc_prefix}-sphinx +%endif BuildArch: noarch %description @@ -79,6 +86,15 @@ Requires: python%{python3_pkgversion}-requests %endif +%if 0%{?_with_doc} +%package doc +Summary: Documentation for %{name} + +%description doc +This package provides documentation for %{name}. +%endif + + %prep %autosetup -p0 -n azure-activedirectory-library-for-python-%{version} @@ -91,6 +107,11 @@ Requires: python%{python3_pkgversion}-requests %py3_build %endif +%if 0%{?_with_doc} +%make_build -C docs/ html SPHINXBUILD=%{sphinxbuild} +rm docs/build/html/{.buildinfo,.nojekyll} +%endif + %install %if 0%{?_with_python2} @@ -114,7 +135,8 @@ py.test-%{python3_version} %files -n python2-%{srcname} %doc README.md %license LICENSE -%{python2_sitelib}/* +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{srcname}-*.egg-info/ %endif @@ -122,11 +144,22 @@ py.test-%{python3_version} %files -n python%{python3_pkgversion}-%{srcname} %doc README.md %license LICENSE -%{python3_sitelib}/* +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{srcname}-*.egg-info/ +%endif + + +%if 0%{?_with_doc} +%files doc +%doc docs/build/html/ +%license LICENSE %endif %changelog +* Sat Nov 10 2018 Mohamed El Morabity - 1.2.0-2 +- Build documentation + * Sat Nov 10 2018 Mohamed El Morabity - 1.2.0-1 - Update to 1.2.0 - Enable Python 3 support for EL