New upstream version.

Also:
- Use the github tarball, which has docs, instead of the pypi tarball.
- Add %check script.
This commit is contained in:
Jerry James 2019-02-12 21:00:03 -07:00
parent b6df78d6be
commit ce8f49f95b
2 changed files with 64 additions and 14 deletions

View File

@ -5,23 +5,28 @@
%global srcname sphinx_rtd_theme
Name: python-%{srcname}
Version: 0.4.2
Release: 2%{?dist}
Version: 0.4.3
Release: 1%{?dist}
Summary: Sphinx theme for readthedocs.org
License: MIT
URL: https://github.com/snide/sphinx_rtd_theme
Source0: %pypi_source
URL: https://github.com/rtfd/%{srcname}
Source0: https://github.com/rtfd/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2dist(pytest)
BuildRequires: python2dist(setuptools)
BuildRequires: python2dist(sphinx)
%if 0%{?with_py3}
BuildRequires: python3-devel
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinxcontrib-httpdomain)
%else
BuildRequires: python2dist(sphinxcontrib-httpdomain)
%endif
%description
@ -36,7 +41,6 @@ Requires: fontawesome-fonts-web
Requires: font(fontawesome)
Requires: font(lato)
Requires: font(robotoslab)
Requires: python2dist(sphinx)
%{?python_provide:%python_provide python2-%{srcname}}
@ -53,7 +57,6 @@ Requires: fontawesome-fonts-web
Requires: font(fontawesome)
Requires: font(lato)
Requires: font(robotoslab)
Requires: python3dist(sphinx)
%{?python_provide:%python_provide python3-%{srcname}}
@ -80,6 +83,13 @@ popd
# Python 3 build
pushd python3-%{srcname}-%{version}
%py3_build
# Build the documentation
make -C docs html SPHINXBUILD=sphinx-build-3
popd
%else
pushd %{srcname}-%{version}
make -C docs html SPHINXBUILD=sphinx-build-2
popd
%endif
@ -89,9 +99,10 @@ pushd %{srcname}-%{version}
%py2_install
popd
# Don't use the bundled fonts
pushd %{buildroot}/%{python2_sitelib}/%{srcname}/static/fonts
rm fontawesome-webfont.* Lato/*.ttf RobotoSlab/*.ttf
# Link to the required fonts and copy the parts not shipped by Fedora
pushd %{buildroot}%{python2_sitelib}/%{srcname}/static/fonts
mkdir Lato RobotoSlab
rm -f fontawesome-webfont.*
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.eot .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.svg .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.ttf .
@ -104,6 +115,10 @@ ln -s %{_datadir}/fonts/lato/Lato-BoldItalic.ttf Lato/lato-bolditalic.ttf
ln -s %{_datadir}/fonts/lato/Lato-Italic.ttf Lato/lato-italic.ttf
ln -s %{_datadir}/fonts/lato/Lato-Regular.ttf Lato/lato-regular.ttf
popd
cp -p %{srcname}-%{version}/fonts/RobotoSlab/*.{eot,woff,woff2} \
%{buildroot}%{python2_sitelib}/%{srcname}/static/fonts/RobotoSlab
cp -p %{srcname}-%{version}/fonts/Lato/*.{eot,woff,woff2} \
%{buildroot}%{python2_sitelib}/%{srcname}/static/fonts/Lato
%if 0%{?with_py3}
# Python 3 install
@ -111,9 +126,10 @@ pushd python3-%{srcname}-%{version}
%py3_install
popd
# Don't use the bundled fonts
pushd %{buildroot}/%{python3_sitelib}/%{srcname}/static/fonts
rm fontawesome-webfont.* Lato/*.ttf RobotoSlab/*.ttf
# Link to the required fonts and copy the parts not shipped by Fedora
pushd %{buildroot}%{python3_sitelib}/%{srcname}/static/fonts
mkdir Lato RobotoSlab
rm -f fontawesome-webfont.*
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.eot .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.svg .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.ttf .
@ -126,8 +142,37 @@ ln -s %{_datadir}/fonts/lato/Lato-BoldItalic.ttf Lato/lato-bolditalic.ttf
ln -s %{_datadir}/fonts/lato/Lato-Italic.ttf Lato/lato-italic.ttf
ln -s %{_datadir}/fonts/lato/Lato-Regular.ttf Lato/lato-regular.ttf
popd
cp -p python3-%{srcname}-%{version}/fonts/RobotoSlab/*.{eot,woff,woff2} \
%{buildroot}%{python3_sitelib}/%{srcname}/static/fonts/RobotoSlab
cp -p python3-%{srcname}-%{version}/fonts/Lato/*.{eot,woff,woff2} \
%{buildroot}%{python3_sitelib}/%{srcname}/static/fonts/Lato
rm -fr python3-%{srcname}-%{version}/docs/build/html/_static/fonts
cp -a %{buildroot}%{python3_sitelib}/%{srcname}/static/fonts \
python3-%{srcname}-%{version}/docs/build/html/_static
%else
rm -fr %{srcname}-%{version}/docs/build/html/_static/fonts
cp -a %{buildroot}%{python2_sitelib}/%{srcname}/static/fonts \
%{srcname}-%{version}/docs/build/html/_static
%endif
%check
pushd %{srcname}-%{version}
%{__python2} setup.py test
popd
%if 0%{?with_py3}
pushd python3-%{srcname}-%{version}
%{__python3} setup.py test
popd
%endif
%files
%if 0%{?with_py3}
%doc python3-%{srcname}-%{version}/docs/build/html/*
%else
%doc %{srcname}-%{version}/docs/build/html/*
%endif
%files -n python2-%{srcname}
%doc %{srcname}-%{version}/README.rst
%license %{srcname}-%{version}/LICENSE
@ -141,6 +186,11 @@ popd
%endif
%changelog
* Tue Feb 12 2019 Jerry James <loganjerry@gmail.com> - 0.4.3-1
- New upstream version
- Use the github tarball, which has docs, instead of the pypi tarball
- Add %%check script
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (sphinx_rtd_theme-0.4.2.tar.gz) = adfca96515a0e91d16d47c530652a49fce44836deeec0c62035deb9ff5f6f659f11617baf7513bdfa324b661b167ccb02fbc6f7b068f7a11cd26bfedd7cdba4c
SHA512 (sphinx_rtd_theme-0.4.3.tar.gz) = 6e5d4d0c44ea8acdf382dd589a194be2777e4c4f66f27705eb32d0507cf71b9d289df860bc3d9845242629cd92d62154040f9063f1c05ff6f329e210e14a6a9a