]>
Commit | Line | Data |
---|---|---|
88d1161d JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_with tests # unit tests (cannot find app fixture) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: Sphinx extension to build a 404 page with absolute URLs | |
9 | Summary(pl.UTF-8): Rozszerzenie Sphinksa do tworzenia strony 404 z bezwzględnymi URL-ami | |
10 | Name: python-sphinx-notfound-page | |
11 | Version: 0.8 | |
26f533fd | 12 | Release: 4 |
88d1161d JB |
13 | License: MIT |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/sphinx-notfound-page/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/s/sphinx-notfound-page/sphinx-notfound-page-%{version}.tar.gz | |
17 | # Source0-md5: 2e1563e824b14391a065dae6dca39f91 | |
18 | URL: https://pypi.org/project/sphinx-notfound-page/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
23 | BuildRequires: python-Sphinx | |
24 | BuildRequires: python-pytest | |
25 | BuildRequires: sphinx-pdg | |
26 | %endif | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.2 | |
30 | BuildRequires: python3-setuptools | |
31 | %if %{with tests} | |
32 | BuildRequires: python3-Sphinx | |
33 | BuildRequires: python3-pytest | |
34 | BuildRequires: sphinx-pdg | |
35 | %endif | |
36 | %endif | |
37 | BuildRequires: rpm-pythonprov | |
38 | BuildRequires: rpmbuild(macros) >= 1.714 | |
39 | # generated docs are incluced in sdist, so regeneration is disabled | |
40 | %if %{with rebuild_doc} | |
41 | BuildRequires: python3-sphinx-autoapi | |
42 | BuildRequires: python3-sphinx-prompt | |
43 | BuildRequires: python3-sphinx_rtd_theme | |
44 | BuildRequires: python3-sphinx_tabs | |
45 | BuildRequires: python3-sphinxemoji | |
46 | BuildRequires: sphinx-pdg-3 | |
47 | %endif | |
48 | Requires: python-modules >= 1:2.7 | |
49 | BuildArch: noarch | |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
51 | ||
52 | %description | |
53 | Sphinx extension to create a custom 404 page with absolute URLs | |
54 | hardcoded. | |
55 | ||
56 | %description -l pl.UTF-8 | |
57 | Rozszerzenie Sphinksa do tworzenia własnej strony 404 z zakodowanymi | |
58 | bezwzględnymi URL-ami. | |
59 | ||
60 | %package -n python3-sphinx-notfound-page | |
61 | Summary: Sphinx extension to build a 404 page with absolute URLs | |
62 | Summary(pl.UTF-8): Rozszerzenie Sphinksa do tworzenia strony 404 z bezwzględnymi URL-ami | |
63 | Group: Libraries/Python | |
64 | Requires: python3-modules >= 1:3.2 | |
65 | ||
66 | %description -n python3-sphinx-notfound-page | |
67 | Sphinx extension to create a custom 404 page with absolute URLs | |
68 | hardcoded. | |
69 | ||
70 | %description -n python3-sphinx-notfound-page -l pl.UTF-8 | |
71 | Rozszerzenie Sphinksa do tworzenia własnej strony 404 z zakodowanymi | |
72 | bezwzględnymi URL-ami. | |
73 | ||
74 | %package apidocs | |
75 | Summary: API documentation for Python sphinx-notfound-page module | |
76 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona sphinx-notfound-page | |
77 | Group: Documentation | |
78 | ||
79 | %description apidocs | |
80 | API documentation for Python sphinx-notfound-page module. | |
81 | ||
82 | %description apidocs -l pl.UTF-8 | |
83 | Dokumentacja API modułu Pythona sphinx-notfound-page. | |
84 | ||
85 | %prep | |
86 | %setup -q -n sphinx-notfound-page-%{version} | |
87 | ||
88 | %build | |
89 | %if %{with python2} | |
90 | %py_build | |
91 | ||
92 | %if %{with tests} | |
93 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
94 | PYTHONPATH=$(pwd) \ | |
95 | %{__python} -m pytest tests | |
96 | %endif | |
97 | %endif | |
98 | ||
99 | %if %{with python3} | |
100 | %py3_build | |
101 | ||
102 | %if %{with tests} | |
103 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
104 | PYTHONPATH=$(pwd) \ | |
105 | %{__python3} -m pytest tests | |
106 | %endif | |
107 | %endif | |
108 | ||
109 | %if %{with rebuild_doc} | |
110 | %{__make} -C docs html | |
111 | %endif | |
112 | ||
113 | %install | |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
116 | %if %{with python2} | |
117 | %py_install | |
118 | ||
119 | %py_postclean | |
120 | %endif | |
121 | ||
122 | %if %{with python3} | |
123 | %py3_install | |
124 | %endif | |
125 | ||
126 | %clean | |
127 | rm -rf $RPM_BUILD_ROOT | |
128 | ||
129 | %if %{with python2} | |
130 | %files | |
131 | %defattr(644,root,root,755) | |
132 | %doc LICENSE README.rst | |
133 | %{py_sitescriptdir}/notfound | |
134 | %{py_sitescriptdir}/sphinx_notfound_page-%{version}-py*.egg-info | |
135 | %endif | |
136 | ||
137 | %if %{with python3} | |
138 | %files -n python3-sphinx-notfound-page | |
139 | %defattr(644,root,root,755) | |
140 | %doc LICENSE README.rst | |
141 | %{py3_sitescriptdir}/notfound | |
142 | %{py3_sitescriptdir}/sphinx_notfound_page-%{version}-py*.egg-info | |
143 | %endif | |
144 | ||
145 | %if %{with doc} | |
146 | %files apidocs | |
147 | %defattr(644,root,root,755) | |
148 | %doc docs/_build/html/{_images,_static,autoapi,*.html,*.js} | |
149 | %endif |