]>
Commit | Line | Data |
---|---|---|
e541e8cd | 1 | # |
f7cd7b16 | 2 | # Conditional build: |
e541e8cd | 3 | %bcond_without python2 # Python 2.x version (available as 'py2lint') |
fe336af7 | 4 | %bcond_with python3 # Python 3.x version (available as 'py3lint'; built from pylint.spec) |
e541e8cd | 5 | %bcond_without doc # Sphinx documentation |
f7cd7b16 | 6 | |
df0ba447 JB |
7 | Summary: Python 2 tool that checks if a module satisfy a coding standard |
8 | Summary(pl.UTF-8): Narzędzie Pythona 2 sprawdzające zgodność modułu ze standardem kodowania | |
e541e8cd | 9 | Name: python-pylint |
fe336af7 | 10 | # keep 1.x here for python2 support |
e541e8cd | 11 | Version: 1.9.5 |
597c0ac4 | 12 | Release: 2 |
e74abaa8 | 13 | Epoch: 1 |
e6bafd81 | 14 | License: GPL v2+ |
baeb5efa | 15 | Group: Development/Languages/Python |
e541e8cd JB |
16 | #Source0Download: https://pypi.org/simple/pylint |
17 | Source0: https://github.com/PyCQA/pylint/archive/pylint-%{version}.tar.gz | |
18 | # Source0-md5: 3db0fde1876d50ad313fd707ecd6562b | |
19 | Patch0: %{name}-rc.patch | |
fe336af7 | 20 | URL: https://www.pylint.org/ |
f7cd7b16 | 21 | %if %{with python2} |
e541e8cd JB |
22 | BuildRequires: python-devel >= 1:2.7 |
23 | BuildRequires: python-modules >= 1:2.7 | |
24 | BuildRequires: python-pytest-runner | |
4b67dc91 | 25 | BuildRequires: python-setuptools >= 1:7.0 |
fe336af7 | 26 | %if %{with tests} |
e541e8cd | 27 | BuildRequires: python-astroid >= 1.6.0 |
e541e8cd JB |
28 | BuildRequires: python-backports.functools_lru_cache |
29 | BuildRequires: python-configparser | |
30 | BuildRequires: python-isort >= 4.2.5 | |
31 | BuildRequires: python-mccabe | |
32 | BuildRequires: python-pytest | |
33 | BuildRequires: python-pytest-xdist | |
34 | BuildRequires: python-singledispatch | |
fe336af7 | 35 | BuildRequires: python-six |
f7cd7b16 | 36 | %endif |
3b475c6d | 37 | %endif |
f7cd7b16 | 38 | %if %{with python3} |
e541e8cd JB |
39 | BuildRequires: python3-devel >= 1:3.4 |
40 | BuildRequires: python3-modules >= 1:3.4 | |
e541e8cd | 41 | BuildRequires: python3-pytest-runner |
4b67dc91 | 42 | BuildRequires: python3-setuptools >= 1:7.0 |
fe336af7 | 43 | %if %{with tests} |
e541e8cd | 44 | BuildRequires: python3-astroid >= 1.6.0 |
e541e8cd JB |
45 | BuildRequires: python3-isort >= 4.2.5 |
46 | BuildRequires: python3-pytest | |
47 | BuildRequires: python3-pytest-xdist | |
48 | BuildRequires: python3-mccabe | |
fe336af7 | 49 | BuildRequires: python3-six |
e541e8cd | 50 | %endif |
f7cd7b16 | 51 | %endif |
2ae24f33 | 52 | BuildRequires: rpm-pythonprov |
e541e8cd JB |
53 | BuildRequires: rpmbuild(macros) >= 1.714 |
54 | %if %{with doc} | |
fe336af7 JB |
55 | BuildRequires: python-astroid >= 1.6.0 |
56 | BuildRequires: python-backports.functools_lru_cache | |
57 | BuildRequires: python-configparser | |
58 | BuildRequires: python-isort >= 4.2.5 | |
59 | BuildRequires: python-mccabe | |
60 | BuildRequires: python-singledispatch | |
61 | BuildRequires: python-six | |
62 | BuildRequires: sphinx-pdg-2 >= 1 | |
e541e8cd | 63 | %endif |
93850ade | 64 | Suggests: python-devel-src |
baeb5efa | 65 | BuildArch: noarch |
66 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
67 | ||
68 | %description | |
df0ba447 | 69 | Python 2 tool that checks if a module satisfy a coding standard. |
baeb5efa | 70 | |
e541e8cd JB |
71 | This package contains only the Python modules used by the tool. |
72 | ||
65b81fbb | 73 | %description -l pl.UTF-8 |
df0ba447 JB |
74 | Narzędzie Pythona 2 sprawdzające zgodność modułów napisanych w języku |
75 | Python z regułami tworzenia kodu źródłowego. | |
c85c0a5a | 76 | |
e541e8cd JB |
77 | Ten pakiet zawiera tylko moduły Pythona używane przez to narzędzie. |
78 | ||
79 | %package -n py2lint | |
df0ba447 JB |
80 | Summary: Python 2 tool that checks if a module satisfy a coding standard (modules) |
81 | Summary(pl.UTF-8): Narzędzie Pythona sprawdzające zgodność modułu ze standardem kodowania (moduły) | |
345b7a9d | 82 | Group: Libraries/Python |
e74abaa8 | 83 | Requires: %{name} = %{epoch}:%{version}-%{release} |
345b7a9d | 84 | |
e541e8cd | 85 | %description -n py2lint |
df0ba447 | 86 | Python 2 tool that checks if a module satisfy a coding standard. |
345b7a9d | 87 | |
e541e8cd JB |
88 | %description -n py2lint -l pl.UTF-8 |
89 | Narzędzie Pythona 2 sprawdzające zgodność modułów napisanych w języku | |
90 | Python z regułami tworzenia kodu źródłowego. | |
91 | ||
92 | %package -n python3-pylint | |
93 | Summary: Python 3 tool that checks if a module satisfy a coding standard (moduły) | |
94 | Summary(pl.UTF-8): Narzędzie Pythona 3 sprawdzające zgodność modułu ze standardem kodowania (modules) | |
95 | Group: Libraries/Python | |
96 | ||
97 | %description -n python3-pylint | |
98 | Python 3 tool that checks if a module satisfy a coding standard. | |
99 | ||
df0ba447 | 100 | This package contains only the Python modules used by the tool. |
345b7a9d | 101 | |
e541e8cd JB |
102 | %description -n python3-pylint -l pl.UTF-8 |
103 | Narzędzie Pythona 3 sprawdzające zgodność modułów napisanych w języku | |
df0ba447 | 104 | Python z regułami tworzenia kodu źródłowego. |
345b7a9d | 105 | |
df0ba447 | 106 | Ten pakiet zawiera tylko moduły Pythona używane przez to narzędzie. |
345b7a9d | 107 | |
704b7472 | 108 | %package -n py3lint |
df0ba447 JB |
109 | Summary: Python 3 tool that checks if a module satisfy a coding standard |
110 | Summary(pl.UTF-8): Narzędzie Pythona 3 sprawdzające zgodność modułu ze standardem kodowania | |
f7cd7b16 | 111 | Group: Development/Languages/Python |
e74abaa8 | 112 | Requires: python3-pylint = %{epoch}:%{version}-%{release} |
704b7472 | 113 | Obsoletes: pylint-python3 < 1.0.0-2 |
f7cd7b16 | 114 | |
704b7472 | 115 | %description -n py3lint |
df0ba447 | 116 | Python 3 tool that checks if a module satisfy a coding standard. |
f7cd7b16 JK |
117 | |
118 | Python 3.x version, available via the 'py3lint' command. | |
119 | ||
704b7472 | 120 | %description -n py3lint -l pl.UTF-8 |
df0ba447 JB |
121 | Narzędzie Pythona 3 sprawdzające zgodność modułów napisanych w języku |
122 | Python z regułami tworzenia kodu źródłowego. | |
f7cd7b16 JK |
123 | |
124 | Wersja dla Pythona 3.x, dostępna przez polecenie 'py3lint'. | |
125 | ||
e541e8cd JB |
126 | %package doc |
127 | Summary: Documentation for pylint module and tool | |
128 | Summary(pl.UTF-8): Dokumentacja do modułu i narzędzia pylint | |
129 | Group: Documentation | |
345b7a9d | 130 | |
e541e8cd JB |
131 | %description doc |
132 | Documentation for pylint module and tool. | |
345b7a9d | 133 | |
e541e8cd JB |
134 | %description doc -l pl.UTF-8 |
135 | Dokumentacja do modułu i narzędzia pylint. | |
345b7a9d | 136 | |
baeb5efa | 137 | %prep |
19641c03 | 138 | %setup -q -n pylint-pylint-%{version} |
e541e8cd | 139 | %patch0 -p1 |
8b70ac82 | 140 | |
baeb5efa | 141 | %build |
f7cd7b16 | 142 | %if %{with python2} |
15bfcc2d | 143 | %py_build |
f7cd7b16 JK |
144 | %endif |
145 | ||
146 | %if %{with python3} | |
15bfcc2d | 147 | %py3_build |
f7cd7b16 | 148 | %endif |
baeb5efa | 149 | |
e541e8cd | 150 | %if %{with doc} |
e1ce958c | 151 | %{__make} -C doc text \ |
fe336af7 JB |
152 | PYTHONPATH=$PWD \ |
153 | SPHINXBUILD=sphinx-build-2 | |
e541e8cd | 154 | %endif |
ad173d2e | 155 | |
baeb5efa | 156 | %install |
704b7472 | 157 | rm -rf $RPM_BUILD_ROOT |
4ec6f79e | 158 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} |
baeb5efa | 159 | |
f7cd7b16 | 160 | %if %{with python2} |
15bfcc2d | 161 | %py_install |
7c199dbc | 162 | %py_postclean |
e541e8cd JB |
163 | |
164 | for tool in epylint pylint pyreverse symilar ; do | |
165 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/${tool} $RPM_BUILD_ROOT%{_bindir}/${tool}-2 | |
166 | cp -p man/${tool}.1 $RPM_BUILD_ROOT%{_mandir}/man1/${tool}-2.1 | |
167 | done | |
168 | ||
169 | cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc-2 | |
0a714190 JR |
170 | |
171 | # don't package unit test data | |
172 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pylint/test | |
f7cd7b16 JK |
173 | %endif |
174 | ||
e541e8cd JB |
175 | %if %{with python3} |
176 | %py3_install | |
177 | ||
178 | for tool in epylint pylint pyreverse symilar ; do | |
179 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/${tool} $RPM_BUILD_ROOT%{_bindir}/${tool}-3 | |
180 | cp -p man/${tool}.1 $RPM_BUILD_ROOT%{_mandir}/man1/${tool}-3.1 | |
181 | done | |
182 | # old PLD package compatibility | |
183 | ln -s epylint-3 $RPM_BUILD_ROOT%{_bindir}/epy3lint | |
184 | ln -s pylint-3 $RPM_BUILD_ROOT%{_bindir}/py3lint | |
185 | ln -s pyreverse-3 $RPM_BUILD_ROOT%{_bindir}/py3reverse | |
186 | echo '.so epylint-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/epy3lint.1 | |
187 | echo '.so pylint-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/py3lint.1 | |
188 | echo '.so pyreverse-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/py3reverse.1 | |
189 | ||
190 | cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc-3 | |
0a714190 JR |
191 | |
192 | # don't package unit test data | |
193 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pylint/test | |
e541e8cd | 194 | %endif |
baeb5efa | 195 | |
196 | %clean | |
197 | rm -rf $RPM_BUILD_ROOT | |
198 | ||
f7cd7b16 | 199 | %if %{with python2} |
baeb5efa | 200 | %files |
201 | %defattr(644,root,root,755) | |
e541e8cd | 202 | %doc ChangeLog README.rst examples |
345b7a9d JK |
203 | %{py_sitescriptdir}/pylint |
204 | %{py_sitescriptdir}/pylint-%{version}-py*.egg-info | |
e541e8cd JB |
205 | |
206 | %files -n py2lint | |
207 | %defattr(644,root,root,755) | |
208 | %attr(755,root,root) %{_bindir}/epylint-2 | |
209 | %attr(755,root,root) %{_bindir}/pylint-2 | |
210 | %attr(755,root,root) %{_bindir}/pyreverse-2 | |
211 | %attr(755,root,root) %{_bindir}/symilar-2 | |
212 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc-2 | |
213 | %{_mandir}/man1/epylint-2.1* | |
214 | %{_mandir}/man1/pylint-2.1* | |
215 | %{_mandir}/man1/pyreverse-2.1* | |
216 | %{_mandir}/man1/symilar-2.1* | |
f7cd7b16 JK |
217 | %endif |
218 | ||
219 | %if %{with python3} | |
e541e8cd JB |
220 | %files -n python3-pylint |
221 | %defattr(644,root,root,755) | |
222 | %doc ChangeLog README.rst examples | |
223 | %{py3_sitescriptdir}/pylint | |
224 | %{py3_sitescriptdir}/pylint-%{version}-py*.egg-info | |
225 | ||
704b7472 | 226 | %files -n py3lint |
f7cd7b16 | 227 | %defattr(644,root,root,755) |
e541e8cd JB |
228 | %attr(755,root,root) %{_bindir}/epylint-3 |
229 | %attr(755,root,root) %{_bindir}/pylint-3 | |
230 | %attr(755,root,root) %{_bindir}/pyreverse-3 | |
231 | %attr(755,root,root) %{_bindir}/symilar-3 | |
f7cd7b16 JK |
232 | %attr(755,root,root) %{_bindir}/epy3lint |
233 | %attr(755,root,root) %{_bindir}/py3lint | |
234 | %attr(755,root,root) %{_bindir}/py3reverse | |
e541e8cd JB |
235 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc-3 |
236 | %{_mandir}/man1/epylint-3.1* | |
237 | %{_mandir}/man1/pylint-3.1* | |
238 | %{_mandir}/man1/pyreverse-3.1* | |
239 | %{_mandir}/man1/symilar-3.1* | |
f7cd7b16 JK |
240 | %{_mandir}/man1/epy3lint.1* |
241 | %{_mandir}/man1/py3lint.1* | |
242 | %{_mandir}/man1/py3reverse.1* | |
e541e8cd | 243 | %endif |
f7cd7b16 | 244 | |
e541e8cd JB |
245 | %if %{with doc} |
246 | %files doc | |
345b7a9d | 247 | %defattr(644,root,root,755) |
e541e8cd | 248 | %doc doc/_build/text/* |
f7cd7b16 | 249 | %endif |