python-sphinx_rtd_theme/python-sphinx_rtd_theme.spec

108 lines
2.8 KiB
RPMSpec
Raw Normal View History

2015-02-22 00:13:50 +00:00
%if 0%{?fedora} || 0%{?rhel} >= 8
2014-07-08 15:40:50 +00:00
%global with_py3 1
%endif
%global pkgname sphinx_rtd_theme
Name: python-%{pkgname}
2015-03-11 17:02:06 +00:00
Version: 0.1.7
Release: 1%{?dist}
2014-07-08 15:40:50 +00:00
Summary: Sphinx theme for readthedocs.org
License: MIT
URL: https://github.com/snide/sphinx_rtd_theme
Source0: https://pypi.python.org/packages/source/s/%{pkgname}/%{pkgname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python-devel
BuildRequires: python-setuptools
%if 0%{?with_py3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
Requires: fontawesome-fonts
%description
This is a prototype mobile-friendly sphinx theme for readthedocs.org.
It's currently in development and includes some rtd variable checks that
can be ignored if you're just trying to use it on your project outside
of that site.
%if 0%{?with_py3}
%package -n python3-%{pkgname}
Summary: Sphinx theme for readthedocs.org
Requires: fontawesome-fonts
%description -n python3-%{pkgname}
This is a prototype mobile-friendly sphinx theme for readthedocs.org.
It's currently in development and includes some rtd variable checks that
can be ignored if you're just trying to use it on your project outside
of that site.
%endif
%prep
%setup -q -c
# Prepare for python3 build
cp -a %{pkgname}-%{version} python3-%{pkgname}-%{version}
%build
# Python 2 build
pushd %{pkgname}-%{version}
%{__python2} setup.py build
popd
%if 0%{?with_py3}
# Python 3 build
pushd python3-%{pkgname}-%{version}
%{__python3} setup.py build
popd
%endif
%install
# Python 2 install
pushd %{pkgname}-%{version}
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
popd
# Don't use the bundled font
rm %{buildroot}/%{python2_sitelib}/%{pkgname}/static/fonts/*.ttf
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.ttf \
%{buildroot}/%{python2_sitelib}/%{pkgname}/static/fonts/
%if 0%{?with_py3}
# Python 3 install
pushd python3-%{pkgname}-%{version}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
# Don't use the bundled font
rm %{buildroot}/%{python3_sitelib}/%{pkgname}/static/fonts/*.ttf
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.ttf \
%{buildroot}/%{python3_sitelib}/%{pkgname}/static/fonts/
%endif
%files
2015-02-22 00:13:50 +00:00
%doc %{pkgname}-%{version}/README.rst
%license %{pkgname}-%{version}/LICENSE
2014-07-08 15:40:50 +00:00
%{python2_sitelib}/%{pkgname}*
%if 0%{?with_py3}
%files -n python3-%{pkgname}
2015-02-22 00:13:50 +00:00
%doc python3-%{pkgname}-%{version}/README.rst
%license python3-%{pkgname}-%{version}/LICENSE
2014-07-08 15:40:50 +00:00
%{python3_sitelib}/%{pkgname}*
%endif
%changelog
2015-03-11 17:02:06 +00:00
* Wed Mar 11 2015 Jerry James <loganjerry@gmail.com> - 0.1.7-1
- New upstream version
2015-02-22 00:13:50 +00:00
* Sat Feb 21 2015 Jerry James <loganjerry@gmail.com> - 0.1.6-2
- Use license macro
2014-07-08 15:40:50 +00:00
* Thu Jul 3 2014 Jerry James <loganjerry@gmail.com> - 0.1.6-1
- Initial RPM