]>
Commit | Line | Data |
---|---|---|
f4b092e9 JB |
1 | # |
2 | # Conditional build: | |
0fbef234 | 3 | %bcond_without doc # Sphinx documentation |
f4b092e9 JB |
4 | %bcond_without tests # do not perform "make test" |
5 | %bcond_without python2 # CPython 2.x module | |
0fbef234 | 6 | %bcond_with python3 # CPython 3.x module (not needed for Python 3.7+) |
f4b092e9 | 7 | |
0fbef234 JB |
8 | Summary: Updated configparser from Python 3.7 to Python 2 |
9 | Summary(pl.UTF-8): Uaktualniony configparser z Pythona 3.7 do Pythona 2 | |
f4b092e9 | 10 | Name: python-configparser |
0fbef234 | 11 | Version: 4.0.2 |
14704947 | 12 | Release: 2 |
f4b092e9 JB |
13 | License: BSD |
14 | Group: Libraries/Python | |
0fbef234 | 15 | #Source0Download: https://pypi.org/simple/configparser/ |
f4b092e9 | 16 | Source0: https://files.pythonhosted.org/packages/source/c/configparser/configparser-%{version}.tar.gz |
0fbef234 JB |
17 | # Source0-md5: 35926cc4b9133f1f9ca70a1fd2fdf237 |
18 | URL: https://pypi.org/project/configparser/ | |
f4b092e9 JB |
19 | %if %{with python2} |
20 | BuildRequires: python >= 1:2.6 | |
21 | BuildRequires: python-modules >= 1:2.6 | |
22 | BuildRequires: python-setuptools | |
0fbef234 JB |
23 | BuildRequires: python-setuptools_scm >= 1.15.0 |
24 | %if %{with additional_tests} | |
25 | BuildRequires: python-pytest >= 3.5 | |
26 | BuildRequires: python-pytest-black-multipy | |
27 | BuildRequires: python-pytest-checkdocs >= 1.2 | |
28 | BuildRequires: python-pytest-flake8 | |
29 | %endif | |
f4b092e9 JB |
30 | %endif |
31 | %if %{with python3} | |
32 | BuildRequires: python3 >= 1:3.4 | |
33 | BuildRequires: python3-modules >= 1:3.4 | |
34 | BuildRequires: python3-setuptools | |
0fbef234 JB |
35 | BuildRequires: python3-setuptools_scm >= 1.15.0 |
36 | %if %{with additional_tests} | |
37 | BuildRequires: python3-pytest >= 3.5 | |
38 | BuildRequires: python3-pytest-black-multipy | |
39 | BuildRequires: python3-pytest-checkdocs >= 1.2 | |
40 | BuildRequires: python3-pytest-flake8 | |
41 | %endif | |
f4b092e9 JB |
42 | %endif |
43 | BuildRequires: rpm-pythonprov | |
44 | BuildRequires: rpmbuild(macros) >= 1.714 | |
0fbef234 JB |
45 | %if %{with doc} |
46 | BuildRequires: python3-jaraco.packaging >= 3.2 | |
47 | BuildRequires: python3-rst.linker >= 1.9 | |
48 | BuildRequires: sphinx-pdg-3 | |
49 | %endif | |
f4b092e9 JB |
50 | Requires: python-backports |
51 | Requires: python-modules >= 1:2.6 | |
52 | BuildArch: noarch | |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
54 | ||
55 | %description | |
56 | The ancient ConfigParser module available in the standard library 2.x | |
57 | has seen a major update in Python 3.2. This is a backport of those | |
0fbef234 | 58 | changes so that they can be used directly in Python 2.6 - 3.6. |
f4b092e9 JB |
59 | |
60 | %description -l pl.UTF-8 | |
61 | Przestarzały moduł ConfigParser dostępny w bibliotece standardowej | |
62 | Pythona 2.x został znacząco uaktualniony w Pythonie 3.2. Niniejszy | |
63 | moduł zawiera backport tych zmian, aby można ich było używać | |
0fbef234 | 64 | bezpośrednio w Pythonie 2.6 - 3.6. |
f4b092e9 JB |
65 | |
66 | %package -n python3-configparser | |
0fbef234 JB |
67 | Summary: Updated configparser from Python 3.7 to older Python 3 |
68 | Summary(pl.UTF-8): Uaktualniony configparser z Pythona 3.7 do starszego Pythona 3 | |
f4b092e9 JB |
69 | Group: Libraries/Python |
70 | Requires: python3-modules >= 1:3.4 | |
71 | ||
72 | %description -n python3-configparser | |
73 | The ancient ConfigParser module available in the standard library 2.x | |
74 | has seen a major update in Python 3.2. This is a backport of those | |
0fbef234 | 75 | changes so that they can be used directly in Python 2.6 - 3.6. |
f4b092e9 JB |
76 | |
77 | %description -n python3-configparser -l pl.UTF-8 | |
78 | Przestarzały moduł ConfigParser dostępny w bibliotece standardowej | |
79 | Pythona 2.x został znacząco uaktualniony w Pythonie 3.2. Niniejszy | |
80 | moduł zawiera backport tych zmian, aby można ich było używać | |
0fbef234 JB |
81 | bezpośrednio w Pythonie 2.6 - 3.6. |
82 | ||
83 | %package apidocs | |
84 | Summary: API documentation for Python configparser module | |
85 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona configparser | |
86 | Group: Documentation | |
87 | ||
88 | %description apidocs | |
89 | API documentation for Python configparser module. | |
90 | ||
91 | %description apidocs -l pl.UTF-8 | |
92 | Dokumentacja API modułu Pythona configparser. | |
f4b092e9 JB |
93 | |
94 | %prep | |
95 | %setup -q -n configparser-%{version} | |
96 | ||
97 | %build | |
98 | %if %{with python2} | |
99 | %py_build | |
0fbef234 JB |
100 | |
101 | %if %{with tests} | |
102 | %{__python} -m unittest discover -s src | |
103 | %endif | |
f4b092e9 JB |
104 | %endif |
105 | ||
106 | %if %{with python3} | |
107 | %py3_build | |
0fbef234 JB |
108 | |
109 | %if %{with tests} | |
110 | %{__python3} -m unittest discover -s src | |
111 | %endif | |
112 | %endif | |
113 | ||
114 | %if %{with doc} | |
115 | sphinx-build-3 -b html docs docs/_build/html | |
f4b092e9 JB |
116 | %endif |
117 | ||
118 | %install | |
119 | rm -rf $RPM_BUILD_ROOT | |
120 | ||
121 | %if %{with python2} | |
122 | %py_install | |
123 | ||
124 | %py_postclean | |
a9ce0343 | 125 | |
b49244b8 AM |
126 | # https://bitbucket.org/ambv/configparser/issues/21/configparser-should-not-declare-a |
127 | # hack for: import configparser and from backports import configparser to work | |
02e090dd AM |
128 | ln -s ../../configparser.pyc $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/configparser/ |
129 | ln -s ../../configparser.pyo $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/configparser/ | |
0fbef234 JB |
130 | |
131 | # belongs to python-backports.spec | |
132 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/__init__.py* | |
f4b092e9 JB |
133 | %endif |
134 | ||
135 | %if %{with python3} | |
136 | %py3_install | |
0fbef234 JB |
137 | |
138 | # belongs to python-backports.spec | |
139 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/backports/__init__.py* | |
140 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/backports/__pycache__ | |
f4b092e9 JB |
141 | %endif |
142 | ||
143 | %clean | |
144 | rm -rf $RPM_BUILD_ROOT | |
145 | ||
146 | %if %{with python2} | |
147 | %files | |
148 | %defattr(644,root,root,755) | |
149 | %doc README.rst configparser.rst | |
150 | %{py_sitescriptdir}/backports/configparser | |
151 | %{py_sitescriptdir}/configparser.py[co] | |
f4b092e9 JB |
152 | %{py_sitescriptdir}/configparser-%{version}-py*.egg-info |
153 | %endif | |
154 | ||
155 | %if %{with python3} | |
156 | %files -n python3-configparser | |
157 | %defattr(644,root,root,755) | |
158 | %doc README.rst configparser.rst | |
f4b092e9 | 159 | %{py3_sitescriptdir}/backports/configparser |
0fbef234 JB |
160 | %{py3_sitescriptdir}/configparser.py |
161 | %{py3_sitescriptdir}/__pycache__/configparser.cpython-*.py[co] | |
f4b092e9 JB |
162 | %{py3_sitescriptdir}/configparser-%{version}-py*.egg-info |
163 | %endif | |
0fbef234 JB |
164 | |
165 | %if %{with doc} | |
166 | %files apidocs | |
167 | %defattr(644,root,root,755) | |
168 | %doc docs/_build/html/{_static,*.html,*.js} | |
169 | %endif |