Add bootstrap bcond

This commit is contained in:
Miro Hrončok 2019-03-19 18:40:56 +01:00
parent a61c36af85
commit 8185a3a893

View File

@ -1,5 +1,8 @@
%global srcname sphinx_rtd_theme %global srcname sphinx_rtd_theme
# Disables tests and docs
%bcond_with bootstrap
Name: python-%{srcname} Name: python-%{srcname}
Version: 0.4.3 Version: 0.4.3
Release: 2%{?dist} Release: 2%{?dist}
@ -11,10 +14,12 @@ Source0: https://github.com/rtfd/%{srcname}/archive/%{version}/%{srcname}
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(setuptools) BuildRequires: python3dist(setuptools)
%if %{without bootstrap}
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinxcontrib-httpdomain) BuildRequires: python3dist(sphinxcontrib-httpdomain)
%endif
%description %description
This is a prototype mobile-friendly sphinx theme for readthedocs.org. This is a prototype mobile-friendly sphinx theme for readthedocs.org.
@ -43,8 +48,10 @@ of that site.
%build %build
%py3_build %py3_build
%if %{without bootstrap}
# Build the documentation # Build the documentation
make -C docs html SPHINXBUILD=sphinx-build-3 make -C docs html SPHINXBUILD=sphinx-build-3
%endif
%install %install
@ -70,12 +77,18 @@ cp -p fonts/RobotoSlab/*.{eot,woff,woff2} \
%{buildroot}%{python3_sitelib}/%{srcname}/static/fonts/RobotoSlab %{buildroot}%{python3_sitelib}/%{srcname}/static/fonts/RobotoSlab
cp -p fonts/Lato/*.{eot,woff,woff2} \ cp -p fonts/Lato/*.{eot,woff,woff2} \
%{buildroot}%{python3_sitelib}/%{srcname}/static/fonts/Lato %{buildroot}%{python3_sitelib}/%{srcname}/static/fonts/Lato
%if %{without bootstrap}
rm -fr docs/build/html/_static/fonts rm -fr docs/build/html/_static/fonts
cp -a %{buildroot}%{python3_sitelib}/%{srcname}/static/fonts \ cp -a %{buildroot}%{python3_sitelib}/%{srcname}/static/fonts \
docs/build/html/_static docs/build/html/_static
%endif
%if %{without bootstrap}
%check %check
%{__python3} setup.py test %{__python3} setup.py test
%endif
%files -n python3-%{srcname} %files -n python3-%{srcname}
%doc README.rst %doc README.rst