]>
Commit | Line | Data |
---|---|---|
a2946a5f 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 | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: pathlib-compatible Zipfile object wrapper | |
9 | Summary(pl.UTF-8): Obiektowe obudowanie Zipfile zgodne z pathlib | |
10 | Name: python-zipp | |
fa77fd09 JB |
11 | # keep 1.x here for python2 support |
12 | Version: 1.2.0 | |
13 | Release: 1 | |
a2946a5f JB |
14 | License: MIT |
15 | Group: Libraries/Python | |
16 | #Source0Download: https://pypi.org/simple/zipp/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/z/zipp/zipp-%{version}.tar.gz | |
fa77fd09 | 18 | # Source0-md5: c25d36db01d011eb2067c722cbd56279 |
a2946a5f JB |
19 | URL: https://pypi.org/project/zipp/ |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules >= 1:2.7 | |
9a699eed | 22 | BuildRequires: python-setuptools >= 1:31.0.1 |
a2946a5f JB |
23 | BuildRequires: python-setuptools_scm >= 1.15.0 |
24 | %if %{with tests} | |
25 | BuildRequires: python-contextlib2 | |
fa77fd09 JB |
26 | BuildRequires: python-func_timeout |
27 | BuildRequires: python-jaraco.itertools | |
af20f0e6 | 28 | BuildRequires: python-linecache2 |
af20f0e6 MK |
29 | BuildRequires: python-pathlib2 |
30 | BuildRequires: python-traceback2 | |
a2946a5f JB |
31 | BuildRequires: python-unittest2 |
32 | %endif | |
33 | %endif | |
34 | %if %{with python3} | |
35 | BuildRequires: python3-modules >= 1:3.2 | |
9a699eed | 36 | BuildRequires: python3-setuptools >= 1:31.0.1 |
a2946a5f JB |
37 | BuildRequires: python3-setuptools_scm >= 1.15.0 |
38 | %if %{with tests} | |
fa77fd09 JB |
39 | BuildRequires: python3-func_timeout |
40 | BuildRequires: python3-jaraco.itertools | |
a2946a5f JB |
41 | %endif |
42 | %endif | |
43 | BuildRequires: rpm-pythonprov | |
44 | BuildRequires: rpmbuild(macros) >= 1.714 | |
45 | %if %{with doc} | |
fa77fd09 JB |
46 | BuildRequires: python-jaraco.packaging >= 3.2 |
47 | BuildRequires: python-rst.linker >= 1.9 | |
48 | BuildRequires: sphinx-pdg-2 | |
a2946a5f JB |
49 | %endif |
50 | Requires: python-modules >= 1:2.7 | |
51 | BuildArch: noarch | |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
53 | ||
54 | %description | |
55 | pathlib-compatible Zipfile object wrapper - backport from Python 3.8 | |
56 | zipfile module. | |
57 | ||
58 | %description -l pl.UTF-8 | |
59 | Obiektowe obudowanie Zipfile zgodne z pathlib - backport z modułu | |
60 | zipfile Pythona 3.8. | |
61 | ||
62 | %package -n python3-zipp | |
63 | Summary: pathlib-compatible Zipfile object wrapper | |
64 | Summary(pl.UTF-8): Obiektowe obudowanie Zipfile zgodne z pathlib | |
65 | Group: Libraries/Python | |
66 | Requires: python3-modules >= 1:3.2 | |
67 | ||
68 | %description -n python3-zipp | |
69 | pathlib-compatible Zipfile object wrapper - backport from Python 3.8 | |
70 | zipfile module. | |
71 | ||
72 | %description -n python3-zipp -l pl.UTF-8 | |
73 | Obiektowe obudowanie Zipfile zgodne z pathlib - backport z modułu | |
74 | zipfile Pythona 3.8. | |
75 | ||
76 | %package apidocs | |
77 | Summary: API documentation for Python zipp module | |
78 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona zipp | |
79 | Group: Documentation | |
80 | ||
81 | %description apidocs | |
82 | API documentation for Python zipp module. | |
83 | ||
84 | %description apidocs -l pl.UTF-8 | |
85 | Dokumentacja API modułu Pythona zipp. | |
86 | ||
87 | %prep | |
88 | %setup -q -n zipp-%{version} | |
89 | ||
90 | %build | |
91 | %if %{with python2} | |
9a699eed JB |
92 | %py_build |
93 | ||
94 | %if %{with tests} | |
95 | %{__python} -m unittest test_zipp | |
96 | %endif | |
a2946a5f JB |
97 | %endif |
98 | ||
99 | %if %{with python3} | |
9a699eed JB |
100 | %py3_build |
101 | ||
102 | %if %{with tests} | |
103 | %{__python3} -m unittest test_zipp | |
104 | %endif | |
a2946a5f JB |
105 | %endif |
106 | ||
107 | %if %{with doc} | |
fa77fd09 | 108 | sphinx-build-2 -b html docs docs/_build/html |
a2946a5f JB |
109 | %endif |
110 | ||
111 | %install | |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
114 | %if %{with python2} | |
115 | %py_install | |
116 | ||
117 | %py_postclean | |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
121 | %py3_install | |
122 | %endif | |
123 | ||
124 | %clean | |
125 | rm -rf $RPM_BUILD_ROOT | |
126 | ||
127 | %if %{with python2} | |
128 | %files | |
129 | %defattr(644,root,root,755) | |
130 | %doc CHANGES.rst LICENSE README.rst | |
131 | %{py_sitescriptdir}/zipp.py[co] | |
132 | %{py_sitescriptdir}/zipp-%{version}-py*.egg-info | |
133 | %endif | |
134 | ||
135 | %if %{with python3} | |
136 | %files -n python3-zipp | |
137 | %defattr(644,root,root,755) | |
138 | %doc CHANGES.rst LICENSE README.rst | |
139 | %{py3_sitescriptdir}/zipp.py | |
140 | %{py3_sitescriptdir}/__pycache__/zipp.cpython-*.py[co] | |
141 | %{py3_sitescriptdir}/zipp-%{version}-py*.egg-info | |
142 | %endif | |
143 | ||
144 | %if %{with doc} | |
145 | %files apidocs | |
146 | %defattr(644,root,root,755) | |
147 | %doc docs/_build/html/{_static,*.html,*.js} | |
148 | %endif |