]>
Commit | Line | Data |
---|---|---|
0f5c66f7 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
a6753627 | 6 | %bcond_with python3 # CPython 3.x module (built from python3-jaraco.itertools.spec) |
0f5c66f7 JB |
7 | |
8 | Summary: jaraco.itertools module | |
9 | Summary(pl.UTF-8): Moduł jaraco.itertools | |
10 | Name: python-jaraco.itertools | |
11 | # keep 4.x here for python 2.x support | |
12 | Version: 4.4.2 | |
13 | Release: 1 | |
14 | License: MIT | |
15 | Group: Libraries/Python | |
16 | #Source0Download: https://pypi.org/simple/jaraco-itertools/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/j/jaraco.itertools/jaraco.itertools-%{version}.tar.gz | |
18 | # Source0-md5: 4472a08481110e531ac6b6443658eb00 | |
19 | URL: https://pypi.org/project/jaraco.itertools/ | |
20 | BuildRequires: rpm-pythonprov | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules >= 1:2.7 | |
24 | BuildRequires: python-setuptools >= 1:31.0.1 | |
25 | BuildRequires: python-setuptools_scm >= 1.15.0 | |
26 | %if %{with tests} | |
27 | BuildRequires: python-inflect | |
28 | BuildRequires: python-more_itertools >= 4.0.0 | |
29 | BuildRequires: python-pytest >= 3.5 | |
30 | #BuildRequires: python-pytest-checkdocs | |
31 | BuildRequires: python-pytest-flake8 | |
32 | BuildRequires: python-six | |
33 | %endif | |
34 | %endif | |
35 | %if %{with python3} | |
36 | BuildRequires: python3-modules >= 1:3.2 | |
37 | BuildRequires: python3-setuptools >= 1:31.0.1 | |
38 | BuildRequires: python3-setuptools_scm >= 1.15 | |
39 | %if %{with tests} | |
40 | BuildRequires: python3-inflect | |
41 | BuildRequires: python3-more_itertools >= 4.0.0 | |
42 | BuildRequires: python3-pytest >= 3.5 | |
43 | #BuildRequires: python3-pytest-checkdocs | |
44 | BuildRequires: python3-pytest-flake8 | |
45 | BuildRequires: python3-six | |
46 | %endif | |
47 | %endif | |
48 | %if %{with doc} | |
49 | BuildRequires: python-jaraco.packaging >= 3.2 | |
50 | BuildRequires: python-rst.linker >= 1.9 | |
51 | BuildRequires: sphinx-pdg-2 | |
52 | %endif | |
53 | Requires: python-jaraco | |
54 | Requires: python-modules >= 1:2.7 | |
55 | BuildArch: noarch | |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
57 | ||
58 | %description | |
59 | jaraco.itertools module. | |
60 | ||
61 | %description -l pl.UTF-8 | |
62 | Moduł jaraco.itertools. | |
63 | ||
64 | %package -n python3-jaraco.itertools | |
65 | Summary: jaraco.itertools module | |
66 | Summary(pl.UTF-8): Moduł jaraco.itertools | |
67 | Group: Libraries/Python | |
68 | Requires: python3-jaraco | |
69 | Requires: python3-modules >= 1:3.2 | |
70 | ||
71 | %description -n python3-jaraco.itertools | |
72 | jaraco.itertools module. | |
73 | ||
74 | %description -n python3-jaraco.itertools -l pl.UTF-8 | |
75 | Moduł jaraco.itertools. | |
76 | ||
77 | %package apidocs | |
78 | Summary: API documentation for Python jaraco.itertools module | |
79 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona jaraco.itertools | |
80 | Group: Documentation | |
81 | ||
82 | %description apidocs | |
83 | API documentation for Python jaraco.itertools module. | |
84 | ||
85 | %description apidocs -l pl.UTF-8 | |
86 | Dokumentacja API modułu Pythona jaraco.itertools. | |
87 | ||
88 | %prep | |
89 | %setup -q -n jaraco.itertools-%{version} | |
90 | ||
91 | %build | |
92 | %if %{with python2} | |
93 | %py_build | |
94 | ||
95 | %if %{with tests} | |
96 | cd build-2/lib | |
97 | %{__python} -m pytest | |
98 | cd ../.. | |
99 | %endif | |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
103 | %py3_build | |
104 | ||
105 | %if %{with tests} | |
106 | cd build-3/lib | |
107 | %{__python3} -m pytest | |
108 | cd ../.. | |
109 | %endif | |
110 | %endif | |
111 | ||
112 | %if %{with doc} | |
113 | sphinx-build-2 -b html docs docs/build/html | |
114 | %endif | |
115 | ||
116 | %install | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
119 | %if %{with python2} | |
120 | %py_install | |
121 | ||
122 | %py_postclean | |
123 | ||
124 | # packaged in python-jaraco.spec | |
125 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/jaraco/__init__.py* | |
126 | %endif | |
127 | ||
128 | %if %{with python3} | |
129 | %py3_install | |
130 | ||
131 | # packaged in python-jaraco.spec | |
132 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/jaraco/__init__.py | |
133 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/jaraco/__pycache__/__init__.* | |
134 | %endif | |
135 | ||
136 | %clean | |
137 | rm -rf $RPM_BUILD_ROOT | |
138 | ||
139 | %if %{with python2} | |
140 | %files | |
141 | %defattr(644,root,root,755) | |
142 | %doc CHANGES.rst LICENSE README.rst | |
143 | %{py_sitescriptdir}/jaraco/itertools.py[co] | |
144 | %{py_sitescriptdir}/jaraco.itertools-%{version}-py*.egg-info | |
145 | %endif | |
146 | ||
147 | %if %{with python3} | |
148 | %files -n python3-jaraco.itertools | |
149 | %defattr(644,root,root,755) | |
150 | %doc CHANGES.rst LICENSE README.rst | |
151 | %{py3_sitescriptdir}/jaraco/itertools.py | |
152 | %{py3_sitescriptdir}/jaraco/__pycache__/itertools.cpython-*.py[co] | |
153 | %{py3_sitescriptdir}/jaraco.itertools-%{version}-py*.egg-info | |
154 | %endif | |
155 | ||
156 | %if %{with doc} | |
157 | %files apidocs | |
158 | %defattr(644,root,root,755) | |
159 | %doc docs/build/html/{_static,*.html,*.js} | |
160 | %endif |