]>
Commit | Line | Data |
---|---|---|
8e8cef05 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
6c3b921d | 5 | %bcond_without tests # unit tests |
8e8cef05 JK |
6 | |
7 | %define module sphinx_rtd_theme | |
65e13b34 JB |
8 | Summary: ReadTheDocs.org theme for Sphinx |
9 | Summary(pl.UTF-8): Motyw ReadTheDocs.org dla Sphinksa | |
8e8cef05 | 10 | Name: python-%{module} |
6028a540 | 11 | Version: 1.0.0 |
8187f455 | 12 | Release: 3 |
8e8cef05 JK |
13 | License: MIT |
14 | Group: Libraries/Python | |
65e13b34 | 15 | #Source0Download: https://pypi.org/simple/sphinx_rtd_theme/ |
9eb3cc7f | 16 | Source0: https://files.pythonhosted.org/packages/source/s/sphinx_rtd_theme/%{module}-%{version}.tar.gz |
6028a540 JB |
17 | # Source0-md5: fdfc7d2e102cb96eca0f6155dde7403e |
18 | Patch0: %{name}-docutils.patch | |
8e8cef05 JK |
19 | URL: https://github.com/snide/sphinx_rtd_theme/ |
20 | BuildRequires: rpm-pythonprov | |
65e13b34 | 21 | BuildRequires: rpmbuild(macros) >= 1.714 |
8e8cef05 | 22 | %if %{with python2} |
168104da | 23 | BuildRequires: python-modules >= 1:2.7 |
8e8cef05 | 24 | BuildRequires: python-setuptools |
6c3b921d JB |
25 | %if %{with tests} |
26 | BuildRequires: python-pytest | |
27 | BuildRequires: python-readthedocs-sphinx-ext | |
28 | %endif | |
8e8cef05 JK |
29 | %endif |
30 | %if %{with python3} | |
6028a540 | 31 | BuildRequires: python3-modules >= 1:3.4 |
8e8cef05 | 32 | BuildRequires: python3-setuptools |
6c3b921d JB |
33 | %if %{with tests} |
34 | BuildRequires: python3-pytest | |
35 | BuildRequires: python3-readthedocs-sphinx-ext | |
36 | %endif | |
8e8cef05 | 37 | %endif |
168104da | 38 | Requires: python-modules >= 1:2.7 |
8e8cef05 JK |
39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
759a6ef1 JB |
43 | This is a mobile-friendly Sphinx theme made for readthedocs.org. |
44 | ||
45 | %description -l pl.UTF-8 | |
46 | Ten pakiet zawiera przyjazny dla urządzeń przenośnych motyw Sphinksa | |
47 | wykonany przez readthedocs.org. | |
8e8cef05 JK |
48 | |
49 | %package -n python3-%{module} | |
65e13b34 JB |
50 | Summary: ReadTheDocs.org theme for Sphinx |
51 | Summary(pl.UTF-8): Motyw ReadTheDocs.org dla Sphinksa | |
8e8cef05 | 52 | Group: Libraries/Python |
6028a540 | 53 | Requires: python3-modules >= 1:3.4 |
8e8cef05 JK |
54 | |
55 | %description -n python3-%{module} | |
759a6ef1 JB |
56 | This is a mobile-friendly Sphinx theme made for readthedocs.org. |
57 | ||
58 | %description -n python3-%{module} -l pl.UTF-8 | |
59 | Ten pakiet zawiera przyjazny dla urządzeń przenośnych motyw Sphinksa | |
60 | wykonany przez readthedocs.org. | |
8e8cef05 JK |
61 | |
62 | %prep | |
63 | %setup -q -n %{module}-%{version} | |
6028a540 | 64 | %patch0 -p1 |
8e8cef05 JK |
65 | |
66 | %build | |
67 | %if %{with python2} | |
6c3b921d JB |
68 | %py_build |
69 | ||
70 | %if %{with tests} | |
13f60bf2 | 71 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
6c3b921d JB |
72 | %{__python} -m pytest tests |
73 | %endif | |
8e8cef05 JK |
74 | %endif |
75 | ||
76 | %if %{with python3} | |
6c3b921d JB |
77 | %py3_build |
78 | ||
79 | %if %{with tests} | |
13f60bf2 | 80 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
6c3b921d JB |
81 | %{__python3} -m pytest tests |
82 | %endif | |
8e8cef05 JK |
83 | %endif |
84 | ||
85 | %install | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
415c71e6 | 89 | %py_install |
8e8cef05 JK |
90 | |
91 | %py_postclean | |
92 | %endif | |
93 | ||
94 | %if %{with python3} | |
415c71e6 | 95 | %py3_install |
8e8cef05 JK |
96 | %endif |
97 | ||
98 | %clean | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %if %{with python2} | |
102 | %files | |
103 | %defattr(644,root,root,755) | |
9eb3cc7f | 104 | %doc LICENSE README.rst |
8e8cef05 JK |
105 | %{py_sitescriptdir}/%{module} |
106 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
107 | %endif | |
108 | ||
109 | %if %{with python3} | |
110 | %files -n python3-%{module} | |
111 | %defattr(644,root,root,755) | |
9eb3cc7f | 112 | %doc LICENSE README.rst |
8e8cef05 JK |
113 | %{py3_sitescriptdir}/%{module} |
114 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
115 | %endif |