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