Blob Blame History Raw
%global srcname sphinx-ansible-theme
%global pkgname sphinx_ansible_theme
%global forgeurl{pkgname}

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

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

BuildRequires:  python3-devel
BuildRequires:  pyproject-rpm-macros
BuildRequires:  python3dist(sphinx-notfound-page)

%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-%{pkgname}-doc
Summary: %{summary}
%description -n python-%{pkgname}-doc
Documentation for sphinx_ansible_theme

%package -n python3-%{pkgname}
Summary: %{summary}
%description -n python3-%{pkgname} %{_description}

%autosetup -p1 -n %{srcname}-%{version}

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

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-%{pkgname}
%doc README.rst
%license LICENSE

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