]> git.pld-linux.org Git - packages/python-configparser.git/blob - python-configparser.spec
293c711adc260500c7bffcd9890cf0b93adf4bd1
[packages/python-configparser.git] / python-configparser.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # do not perform "make test"
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_with     python3 # CPython 3.x module (not needed for Python 3.7+)
7
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
10 Name:           python-configparser
11 Version:        4.0.2
12 Release:        1
13 License:        BSD
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/configparser/
16 Source0:        https://files.pythonhosted.org/packages/source/c/configparser/configparser-%{version}.tar.gz
17 # Source0-md5:  35926cc4b9133f1f9ca70a1fd2fdf237
18 URL:            https://pypi.org/project/configparser/
19 %if %{with python2}
20 BuildRequires:  python >= 1:2.6
21 BuildRequires:  python-modules >= 1:2.6
22 BuildRequires:  python-setuptools
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
30 %endif
31 %if %{with python3}
32 BuildRequires:  python3 >= 1:3.4
33 BuildRequires:  python3-modules >= 1:3.4
34 BuildRequires:  python3-setuptools
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
42 %endif
43 BuildRequires:  rpm-pythonprov
44 BuildRequires:  rpmbuild(macros) >= 1.714
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
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
58 changes so that they can be used directly in Python 2.6 - 3.6.
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ć
64 bezpośrednio w Pythonie 2.6 - 3.6.
65
66 %package -n python3-configparser
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
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
75 changes so that they can be used directly in Python 2.6 - 3.6.
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ć
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.
93
94 %prep
95 %setup -q -n configparser-%{version}
96
97 %build
98 %if %{with python2}
99 %py_build
100
101 %if %{with tests}
102 %{__python} -m unittest discover -s src
103 %endif
104 %endif
105
106 %if %{with python3}
107 %py3_build
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
116 %endif
117
118 %install
119 rm -rf $RPM_BUILD_ROOT
120
121 %if %{with python2}
122 %py_install
123
124 %py_postclean
125
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
128 ln -s ../../configparser.pyc $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/configparser/
129 ln -s ../../configparser.pyo $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/configparser/
130
131 # belongs to python-backports.spec
132 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/__init__.py*
133 %endif
134
135 %if %{with python3}
136 %py3_install
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__
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]
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
159 %{py3_sitescriptdir}/backports/configparser
160 %{py3_sitescriptdir}/configparser.py
161 %{py3_sitescriptdir}/__pycache__/configparser.cpython-*.py[co]
162 %{py3_sitescriptdir}/configparser-%{version}-py*.egg-info
163 %endif
164
165 %if %{with doc}
166 %files apidocs
167 %defattr(644,root,root,755)
168 %doc docs/_build/html/{_static,*.html,*.js}
169 %endif
This page took 0.049599 seconds and 2 git commands to generate.