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