]>
Commit | Line | Data |
---|---|---|
2a218e90 | 1 | # |
0e35a0fa | 2 | # Conditional build: |
c0646e2a JB |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
5 | %bcond_without tests # unit tests | |
6 | %bcond_without doc # Sphinx documentation | |
7 | %bcond_without setuptools # build without setuptools (for bootstraping) | |
0e35a0fa JK |
8 | |
9 | %define module six | |
2a218e90 JB |
10 | Summary: Six - Python 2 and 3 Compatibility Library (Python 2 module) |
11 | Summary(pl.UTF-8): Biblioteka kompatybilności między Pythonem 2 i 3 (moduł Pythona 2) | |
0e35a0fa | 12 | Name: python-%{module} |
94529348 | 13 | Version: 1.15.0 |
504de7d9 | 14 | Release: 4 |
0e35a0fa JK |
15 | License: MIT |
16 | Group: Libraries/Python | |
7a7ec46e JB |
17 | #Source0Download: https://pypi.org/simple/six/ |
18 | Source0: https://files.pythonhosted.org/packages/source/s/six/six-%{version}.tar.gz | |
94529348 | 19 | # Source0-md5: 9f90a0eaa0ea7747fda01ca79d21ebcb |
7a7ec46e | 20 | Patch0: %{name}-tests.patch |
c0646e2a | 21 | URL: https://pypi.org/project/six/ |
0e35a0fa | 22 | %if %{with python2} |
93600f39 JB |
23 | BuildRequires: python >= 1:2.7 |
24 | BuildRequires: python-modules >= 1:2.7 | |
c0646e2a | 25 | %{?with_setuptools:BuildRequires: python-setuptools} |
7a7ec46e | 26 | %if %{with tests} |
93600f39 | 27 | BuildRequires: python-pytest >= 2.2.0 |
7a7ec46e | 28 | %endif |
0e35a0fa JK |
29 | %endif |
30 | %if %{with python3} | |
93600f39 JB |
31 | BuildRequires: python3 >= 1:3.3 |
32 | BuildRequires: python3-modules >= 1:3.3 | |
c0646e2a | 33 | %{?with_setuptools:BuildRequires: python3-setuptools} |
7a7ec46e | 34 | %if %{with tests} |
93600f39 | 35 | BuildRequires: python3-pytest >= 2.2.0 |
7a7ec46e | 36 | %endif |
0e35a0fa JK |
37 | %endif |
38 | BuildRequires: rpm-pythonprov | |
c0646e2a | 39 | BuildRequires: rpmbuild(macros) >= 1.714 |
7a7ec46e | 40 | %if %{with doc} |
c0646e2a | 41 | BuildRequires: sphinx-pdg >= 1.0 |
7a7ec46e | 42 | %endif |
93600f39 | 43 | Requires: python-modules >= 1:2.7 |
0e35a0fa JK |
44 | BuildArch: noarch |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | Six provides simple utilities for wrapping over differences between | |
49 | Python 2 and Python 3. It is intended to support codebases that work | |
50 | on both Python 2 and 3 without modification. six consists of only one | |
51 | Python file, so it is painless to copy into a project. | |
52 | ||
2a218e90 JB |
53 | This package contains Python 2 module. |
54 | ||
55 | %description -l pl.UTF-8 | |
56 | Six dostarcza proste narzędzia obudowujące różnice między Pythonem 2 a | |
57 | Pythonem 3. Celem jest wsparcie kodu działającego zarówno z Pythonem 2 | |
58 | jak i 3 bez modyfikacji. six składa się z tylko jednego pliku | |
59 | pythonowego, więc można go bezproblemowo skopiować do projektu. | |
60 | ||
61 | Ten pakiet zawiera moduł Pythona 2. | |
62 | ||
0e35a0fa | 63 | %package -n python3-%{module} |
2a218e90 JB |
64 | Summary: Six - Python 2 and 3 Compatibility Library (Python 3 module) |
65 | Summary(pl.UTF-8): Biblioteka kompatybilności między Pythonem 2 i 3 (moduł Pythona 3) | |
0e35a0fa | 66 | Group: Libraries/Python |
93600f39 | 67 | Requires: python3-modules >= 1:3.3 |
0e35a0fa JK |
68 | |
69 | %description -n python3-%{module} | |
70 | Six provides simple utilities for wrapping over differences between | |
71 | Python 2 and Python 3. It is intended to support codebases that work | |
72 | on both Python 2 and 3 without modification. six consists of only one | |
73 | Python file, so it is painless to copy into a project. | |
74 | ||
2a218e90 JB |
75 | This package contains Python 3 module. |
76 | ||
77 | %description -n python3-%{module} -l pl.UTF-8 | |
78 | Six dostarcza proste narzędzia obudowujące różnice między Pythonem 2 a | |
79 | Pythonem 3. Celem jest wsparcie kodu działającego zarówno z Pythonem 2 | |
80 | jak i 3 bez modyfikacji. six składa się z tylko jednego pliku | |
81 | pythonowego, więc można go bezproblemowo skopiować do projektu. | |
82 | ||
83 | Ten pakiet zawiera moduł Pythona 3. | |
84 | ||
7a7ec46e JB |
85 | %package apidocs |
86 | Summary: Documentation for Python six module | |
87 | Summary(pl.UTF-8): Dokumentacja modułu Pythona six | |
88 | Group: Documentation | |
89 | ||
90 | %description apidocs | |
91 | Documentation for Python six module. | |
92 | ||
93 | %description apidocs -l pl.UTF-8 | |
94 | Dokumentacja modułu Pythona six. | |
95 | ||
0e35a0fa JK |
96 | %prep |
97 | %setup -q -n %{module}-%{version} | |
7a7ec46e | 98 | %patch0 -p1 |
0e35a0fa JK |
99 | |
100 | %build | |
101 | %if %{with python2} | |
1c4b2e5b | 102 | %py_build |
7a7ec46e JB |
103 | |
104 | %if %{with tests} | |
105 | PYTHONPATH=$(pwd) \ | |
106 | %{__python} -m pytest test_six.py | |
107 | %endif | |
0e35a0fa | 108 | %endif |
7a7ec46e | 109 | |
0e35a0fa | 110 | %if %{with python3} |
1c4b2e5b | 111 | %py3_build |
7a7ec46e JB |
112 | |
113 | %if %{with tests} | |
114 | PYTHONPATH=$(pwd) \ | |
115 | %{__python3} -m pytest test_six.py | |
116 | %endif | |
117 | %endif | |
118 | ||
119 | %if %{with doc} | |
120 | %{__make} -C documentation html | |
0e35a0fa JK |
121 | %endif |
122 | ||
123 | %install | |
124 | rm -rf $RPM_BUILD_ROOT | |
2a218e90 | 125 | |
0e35a0fa | 126 | %if %{with python2} |
1c4b2e5b | 127 | %py_install |
0e35a0fa | 128 | |
0e35a0fa JK |
129 | %py_postclean |
130 | %endif | |
131 | ||
132 | %if %{with python3} | |
1c4b2e5b | 133 | %py3_install |
0e35a0fa JK |
134 | %endif |
135 | ||
136 | %clean | |
137 | rm -rf $RPM_BUILD_ROOT | |
138 | ||
139 | %if %{with python2} | |
140 | %files | |
141 | %defattr(644,root,root,755) | |
7a7ec46e | 142 | %doc CHANGES LICENSE README.rst |
2a218e90 | 143 | %{py_sitescriptdir}/six.py[co] |
2a218e90 | 144 | %{py_sitescriptdir}/six-%{version}-py*.egg-info |
0e35a0fa | 145 | %endif |
0e35a0fa JK |
146 | |
147 | %if %{with python3} | |
148 | %files -n python3-%{module} | |
149 | %defattr(644,root,root,755) | |
7a7ec46e | 150 | %doc CHANGES LICENSE README.rst |
2a218e90 JB |
151 | %{py3_sitescriptdir}/six.py |
152 | %{py3_sitescriptdir}/__pycache__/six.*.py[co] | |
153 | %{py3_sitescriptdir}/six-%{version}-py*.egg-info | |
0e35a0fa | 154 | %endif |
7a7ec46e JB |
155 | |
156 | %if %{with doc} | |
157 | %files apidocs | |
158 | %defattr(644,root,root,755) | |
159 | %doc documentation/_build/html/{_static,*.html,*.js} | |
160 | %endif |