]>
Commit | Line | Data |
---|---|---|
f86f7cb6 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
b191528a | 4 | %bcond_with tests # unit tests (not included in sdist) |
f86f7cb6 | 5 | %bcond_without python2 # CPython 2.x module |
b191528a | 6 | %bcond_with python3 # CPython 3.x module (built from python3-sphinxcontrib-asyncio.spec) |
f86f7cb6 JB |
7 | |
8 | Summary: Sphinx extension to support coroutines in markup | |
9 | Summary(pl.UTF-8): Rozszerzenie Sphinksa do obsługi korutyn w znacznikach | |
10 | Name: python-sphinxcontrib-asyncio | |
b191528a | 11 | # keep 0.2.x here for python2/sphinx 1.x support |
f86f7cb6 | 12 | Version: 0.2.0 |
4aa815e1 | 13 | Release: 4 |
f86f7cb6 JB |
14 | License: Apache v2 |
15 | Group: Libraries/Python | |
16 | #Source0Download: https://pypi.org/simple/sphinxcontrib-asyncio/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/s/sphinxcontrib-asyncio/sphinxcontrib-asyncio-%{version}.tar.gz | |
18 | # Source0-md5: ad3372cb3be157a98834c2f121674862 | |
19 | URL: https://pypi.org/project/sphinxcontrib-asyncio/ | |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules >= 1:2.7 | |
22 | BuildRequires: python-setuptools | |
23 | %if %{with tests} | |
b191528a | 24 | BuildRequires: python-Sphinx |
f86f7cb6 JB |
25 | BuildRequires: python-pytest |
26 | %endif | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.3 | |
30 | BuildRequires: python3-setuptools | |
31 | %if %{with tests} | |
b191528a | 32 | BuildRequires: python3-Sphinx |
f86f7cb6 JB |
33 | BuildRequires: python3-pytest |
34 | %endif | |
35 | %endif | |
36 | BuildRequires: rpm-pythonprov | |
37 | BuildRequires: rpmbuild(macros) >= 1.714 | |
38 | %if %{with doc} | |
f501600c | 39 | BuildRequires: sphinx-pdg-2 |
f86f7cb6 JB |
40 | %endif |
41 | Requires: python-modules >= 1:2.7 | |
7f13dc0d | 42 | Requires: python-sphinxcontrib |
f86f7cb6 JB |
43 | BuildArch: noarch |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | Sphinx extension for adding asyncio-specific markups. | |
48 | ||
49 | %description -l pl.UTF-8 | |
50 | Rozszerzenie Sphinksa do dodawania oznaczeń specyficznych dla asyncio. | |
51 | ||
52 | %package -n python3-sphinxcontrib-asyncio | |
53 | Summary: Sphinx extension to support coroutines in markup | |
54 | Summary(pl.UTF-8): Rozszerzenie Sphinksa do obsługi korutyn w znacznikach | |
55 | Group: Libraries/Python | |
56 | Requires: python3-modules >= 1:3.3 | |
7f13dc0d | 57 | Requires: python3-sphinxcontrib |
f86f7cb6 JB |
58 | |
59 | %description -n python3-sphinxcontrib-asyncio | |
60 | Sphinx extension for adding asyncio-specific markups. | |
61 | ||
62 | %description -n python3-sphinxcontrib-asyncio -l pl.UTF-8 | |
63 | Rozszerzenie Sphinksa do dodawania oznaczeń specyficznych dla asyncio. | |
64 | ||
65 | %package apidocs | |
66 | Summary: API documentation for Python sphinxcontrib-asyncio module | |
67 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona sphinxcontrib-asyncio | |
68 | Group: Documentation | |
69 | ||
70 | %description apidocs | |
71 | API documentation for Python sphinxcontrib-asyncio module. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja API modułu Pythona sphinxcontrib-asyncio. | |
75 | ||
76 | %prep | |
77 | %setup -q -n sphinxcontrib-asyncio-%{version} | |
78 | ||
79 | %build | |
80 | %if %{with python2} | |
81 | %py_build | |
82 | ||
83 | %if %{with tests} | |
b191528a | 84 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
f86f7cb6 JB |
85 | %{__python} -m pytest tests |
86 | %endif | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
90 | %py3_build | |
91 | ||
92 | %if %{with tests} | |
b191528a | 93 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
f86f7cb6 JB |
94 | %{__python3} -m pytest tests |
95 | %endif | |
96 | %endif | |
97 | ||
98 | %if %{with doc} | |
99 | PYTHONPATH=$(pwd) \ | |
f501600c JB |
100 | %{__make} -C docs html \ |
101 | SPHINXBUILD=sphinx-build-2 | |
f86f7cb6 JB |
102 | %endif |
103 | ||
104 | %install | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %if %{with python2} | |
108 | %py_install | |
109 | ||
110 | %py_postclean | |
7f13dc0d JB |
111 | # provides by python-sphinxcontrib in PLD |
112 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/sphinxcontrib/__init__.py* | |
f86f7cb6 JB |
113 | %endif |
114 | ||
115 | %if %{with python3} | |
116 | %py3_install | |
7f13dc0d JB |
117 | |
118 | # provides by python3-sphinxcontrib in PLD | |
119 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/sphinxcontrib/__init__.py \ | |
120 | $RPM_BUILD_ROOT%{py3_sitescriptdir}/sphinxcontrib/__pycache__/__init__.*.py* | |
f86f7cb6 JB |
121 | %endif |
122 | ||
123 | %clean | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
126 | %if %{with python2} | |
127 | %files | |
128 | %defattr(644,root,root,755) | |
129 | %doc CHANGES.rst README.rst | |
f86f7cb6 JB |
130 | %{py_sitescriptdir}/sphinxcontrib/asyncio.py[co] |
131 | %{py_sitescriptdir}/sphinxcontrib_asyncio-%{version}-py*.egg-info | |
132 | %endif | |
133 | ||
134 | %if %{with python3} | |
135 | %files -n python3-sphinxcontrib-asyncio | |
136 | %defattr(644,root,root,755) | |
137 | %doc CHANGES.rst README.rst | |
f86f7cb6 JB |
138 | %{py3_sitescriptdir}/sphinxcontrib/asyncio.py |
139 | %{py3_sitescriptdir}/sphinxcontrib/__pycache__/asyncio.cpython-*.py[co] | |
f86f7cb6 JB |
140 | %{py3_sitescriptdir}/sphinxcontrib_asyncio-%{version}-py*.egg-info |
141 | %endif | |
142 | ||
143 | %if %{with doc} | |
144 | %files apidocs | |
145 | %defattr(644,root,root,755) | |
146 | %doc docs/_build/html/{_static,*.html,*.js} | |
147 | %endif |