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