]>
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} |
b6a5de00 | 13 | Version: 1.16.0 |
2b9c50fe | 14 | Release: 2 |
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 | |
b6a5de00 | 19 | # Source0-md5: a7c927740e4964dd29b72cebfc1429bb |
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} | |
1dc0d369 | 105 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
7a7ec46e JB |
106 | PYTHONPATH=$(pwd) \ |
107 | %{__python} -m pytest test_six.py | |
108 | %endif | |
0e35a0fa | 109 | %endif |
7a7ec46e | 110 | |
0e35a0fa | 111 | %if %{with python3} |
1c4b2e5b | 112 | %py3_build |
7a7ec46e JB |
113 | |
114 | %if %{with tests} | |
1dc0d369 | 115 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
7a7ec46e JB |
116 | PYTHONPATH=$(pwd) \ |
117 | %{__python3} -m pytest test_six.py | |
118 | %endif | |
119 | %endif | |
120 | ||
121 | %if %{with doc} | |
122 | %{__make} -C documentation html | |
0e35a0fa JK |
123 | %endif |
124 | ||
125 | %install | |
126 | rm -rf $RPM_BUILD_ROOT | |
2a218e90 | 127 | |
0e35a0fa | 128 | %if %{with python2} |
1c4b2e5b | 129 | %py_install |
0e35a0fa | 130 | |
0e35a0fa JK |
131 | %py_postclean |
132 | %endif | |
133 | ||
134 | %if %{with python3} | |
1c4b2e5b | 135 | %py3_install |
0e35a0fa JK |
136 | %endif |
137 | ||
138 | %clean | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %if %{with python2} | |
142 | %files | |
143 | %defattr(644,root,root,755) | |
7a7ec46e | 144 | %doc CHANGES LICENSE README.rst |
2a218e90 | 145 | %{py_sitescriptdir}/six.py[co] |
2a218e90 | 146 | %{py_sitescriptdir}/six-%{version}-py*.egg-info |
0e35a0fa | 147 | %endif |
0e35a0fa JK |
148 | |
149 | %if %{with python3} | |
150 | %files -n python3-%{module} | |
151 | %defattr(644,root,root,755) | |
7a7ec46e | 152 | %doc CHANGES LICENSE README.rst |
2a218e90 JB |
153 | %{py3_sitescriptdir}/six.py |
154 | %{py3_sitescriptdir}/__pycache__/six.*.py[co] | |
155 | %{py3_sitescriptdir}/six-%{version}-py*.egg-info | |
0e35a0fa | 156 | %endif |
7a7ec46e JB |
157 | |
158 | %if %{with doc} | |
159 | %files apidocs | |
160 | %defattr(644,root,root,755) | |
161 | %doc documentation/_build/html/{_static,*.html,*.js} | |
162 | %endif |