]>
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 | |
5 | ||
6 | %define module sphinx_rtd_theme | |
7 | Summary: ReadTheDocs.org theme for Sphinx, 2013 version | |
8 | Name: python-%{module} | |
9 | Version: 0.1.8 | |
10 | Release: 1 | |
11 | License: MIT | |
12 | Group: Libraries/Python | |
13 | Source0: https://pypi.python.org/packages/source/s/sphinx_rtd_theme/%{module}-%{version}.tar.gz | |
14 | # Source0-md5: 713ce7c53239449bdd799385577329ee | |
15 | URL: https://github.com/snide/sphinx_rtd_theme/ | |
16 | BuildRequires: rpm-pythonprov | |
17 | BuildRequires: rpmbuild(macros) >= 1.219 | |
18 | %if %{with python2} | |
19 | BuildRequires: python-setuptools | |
20 | %endif | |
21 | %if %{with python3} | |
22 | BuildRequires: python3-setuptools | |
23 | %endif | |
24 | Requires: python-modules | |
25 | BuildArch: noarch | |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | %description | |
29 | This is a mobile-friendly sphinx theme made for readthedocs.org. | |
30 | ||
31 | %package -n python3-%{module} | |
32 | Summary: ReadTheDocs.org theme for Sphinx, 2013 version | |
33 | Group: Libraries/Python | |
34 | Requires: python3-modules | |
35 | ||
36 | %description -n python3-%{module} | |
37 | This is a mobile-friendly sphinx theme made for readthedocs.org. | |
38 | ||
39 | %prep | |
40 | %setup -q -n %{module}-%{version} | |
41 | ||
42 | %build | |
43 | %if %{with python2} | |
44 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
45 | %endif | |
46 | ||
47 | %if %{with python3} | |
48 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
49 | %endif | |
50 | ||
51 | %install | |
52 | rm -rf $RPM_BUILD_ROOT | |
53 | ||
54 | %if %{with python2} | |
55 | %{__python} setup.py \ | |
56 | build --build-base build-2 \ | |
57 | install --skip-build \ | |
58 | --optimize=2 \ | |
59 | --root=$RPM_BUILD_ROOT | |
60 | ||
61 | %py_postclean | |
62 | %endif | |
63 | ||
64 | %if %{with python3} | |
65 | %{__python3} setup.py \ | |
66 | build --build-base build-3 \ | |
67 | install --skip-build \ | |
68 | --optimize=2 \ | |
69 | --root=$RPM_BUILD_ROOT | |
70 | %endif | |
71 | ||
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %if %{with python2} | |
76 | %files | |
77 | %defattr(644,root,root,755) | |
78 | %doc README.rst | |
79 | %{py_sitescriptdir}/%{module} | |
80 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
84 | %files -n python3-%{module} | |
85 | %defattr(644,root,root,755) | |
86 | %doc README.rst | |
87 | %{py3_sitescriptdir}/%{module} | |
88 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
89 | %endif |