Blob Blame History Raw
%global srcname sphinx_ansible_theme

Name:           python-%{srcname}
Version:        0.3.1
Release:        1%{?dist}
Summary:        A reusable Ansible Sphinx Theme

License:        MIT and BSD
URL:  {srcname}
Source:         %{pypi_source}
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-sphinx_rtd_theme
BuildRequires:  python3-sphinx-notfound-page
BuildRequires:  python3-setuptools_scm_git_archive

# docs requirements
BuildRequires:  python3-sphinx

%global _description %{expand:
A reusable Ansible Sphinx Theme. This theme is building on top
of RTD Theme and adds customization's needed for building projects
which are part of Ansible ecosystem}

%description %{_description}

%package -n python-%{srcname}-doc
Summary: %summary
%description -n python-%{srcname}-doc
Documentation for sphinx_ansible_theme

%package -n python3-%{srcname}
Summary:    %summary
Requires:   python3-sphinx
Requires:   fontawesome-fonts
Requires:   fontawesome-fonts-web
Recommends: python-%{srcname}-doc
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname} %{_description}

%setup -q -n %{srcname}-%{version}

# generate html docs
PYTHONPATH=. sphinx-build-3 docs html
# remove the sphinx-build leftovers
rm -vr html/.{doctrees,buildinfo}

pushd %{buildroot}%{python3_sitelib}/%{srcname}/static/fonts
rm -f FontAwesome.otf
rm -f fontawesome-webfont.*
ln -s %{_datadir}/fonts/fontawesome/FontAwesome.otf .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.eot .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.svg .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.ttf .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.woff .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.woff2 .

%files -n python3-%{srcname}
%doc README.rst
%license LICENSE

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

* Sat Jul 18 2020 Chedi Toueiti <> - 0.3.1-1
- initial commit