]>
Commit | Line | Data |
---|---|---|
bce5cba7 AF |
1 | # TODO: |
2 | # - include examples in package | |
f7cd7b16 JK |
3 | |
4 | # Conditional build: | |
5 | %bcond_without python2 # Python 2.x version | |
6 | %bcond_without python3 # Python 3.x version (available as 'py3lint') | |
7 | ||
baeb5efa | 8 | Summary: Python tool that checks if a module satisfy a coding standard |
24b2f055 | 9 | Summary(pl.UTF-8): Pythonowe narzędzie sprawdzające zgodność modułu ze standardem kodowania |
baeb5efa | 10 | Name: pylint |
d948a3e6 JB |
11 | Version: 1.0.0 |
12 | Release: 1 | |
baeb5efa | 13 | License: GPL |
14 | Group: Development/Languages/Python | |
ad173d2e | 15 | Source0: https://bitbucket.org/logilab/pylint/get/%{name}-version-%{version}.tar.bz2 |
d948a3e6 | 16 | # Source0-md5: 9a83c079c2c608a9156feecf909b7b8a |
8b70ac82 | 17 | Patch0: %{name}-type_error.patch |
ad173d2e | 18 | URL: http://www.pylint.org/ |
f7cd7b16 | 19 | %if %{with python2} |
2ae24f33 | 20 | BuildRequires: python-devel |
baeb5efa | 21 | BuildRequires: python-modules >= 2.2.1 |
f7cd7b16 JK |
22 | %endif |
23 | %if %{with python3} | |
24 | BuildRequires: python3-2to3 | |
25 | BuildRequires: python3-devel | |
26 | BuildRequires: python3-distribute | |
27 | BuildRequires: python3-modules >= 1:3.2 | |
28 | %endif | |
2ae24f33 | 29 | BuildRequires: rpm-pythonprov |
7c199dbc | 30 | BuildRequires: rpmbuild(macros) >= 1.219 |
ad173d2e | 31 | BuildRequires: sphinx-pdg |
07c65085 | 32 | %pyrequires_eq python-modules |
243b3ecd | 33 | Requires: python-logilab-astroid >= 0.24.3 |
87946be2 | 34 | Requires: python-logilab-common >= 0.53.0 |
93850ade | 35 | Suggests: python-devel-src |
baeb5efa | 36 | BuildArch: noarch |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | Python tool that checks if a module satisfy a coding standard. | |
41 | ||
65b81fbb JR |
42 | %description -l pl.UTF-8 |
43 | Narzędzie sprawdzające zgodność modułów napisanych w języku Python | |
44 | z regułami tworzenia kodu źródłowego. | |
c85c0a5a | 45 | |
7c199dbc KK |
46 | %package gui |
47 | Summary: GUI for pylint | |
24b2f055 | 48 | Summary(pl.UTF-8): Graficzny interfejs użytkownika dla pylinta |
7c199dbc KK |
49 | Group: Development/Languages/Python |
50 | Requires: %{name} = %{version}-%{release} | |
51 | Requires: python-tkinter | |
52 | ||
53 | %description gui | |
54 | Tk based GUI for pylint. | |
55 | ||
65b81fbb JR |
56 | %description gui -l pl.UTF-8 |
57 | Oparty na bibliotece Tk graficzny interfejs użytkownika dla pylinta. | |
7c199dbc | 58 | |
f7cd7b16 JK |
59 | %package python3 |
60 | Summary: Python tool that checks if a module satisfy a coding standard | |
61 | Summary(pl.UTF-8): Pythonowe narzędzie sprawdzające zgodność modułu ze standardem kodowania | |
62 | Group: Development/Languages/Python | |
243b3ecd | 63 | Requires: python3-logilab-astroid >= 0.24.3 |
f7cd7b16 JK |
64 | Requires: python3-logilab-common >= 0.53.0 |
65 | ||
66 | %description python3 | |
67 | Python tool that checks if a module satisfy a coding standard. | |
68 | ||
69 | Python 3.x version, available via the 'py3lint' command. | |
70 | ||
71 | %description python3 -l pl.UTF-8 | |
72 | Narzędzie sprawdzające zgodność modułów napisanych w języku Python | |
73 | z regułami tworzenia kodu źródłowego. | |
74 | ||
75 | Wersja dla Pythona 3.x, dostępna przez polecenie 'py3lint'. | |
76 | ||
77 | %package python3-gui | |
78 | Summary: GUI for pylint | |
79 | Summary(pl.UTF-8): Graficzny interfejs użytkownika dla pylinta | |
80 | Group: Development/Languages/Python | |
81 | Requires: %{name}-python3 = %{version}-%{release} | |
82 | Requires: python3-tkinter | |
83 | ||
84 | %description python3-gui | |
85 | Tk based GUI for pylint. | |
86 | ||
87 | %description python3-gui -l pl.UTF-8 | |
88 | Oparty na bibliotece Tk graficzny interfejs użytkownika dla pylinta. | |
89 | ||
baeb5efa | 90 | %prep |
ad173d2e AM |
91 | %setup -q -c |
92 | cd logilab-pylint-* | |
8b70ac82 JK |
93 | %patch0 -p1 |
94 | ||
baeb5efa | 95 | %build |
ad173d2e | 96 | cd logilab-pylint-* |
f7cd7b16 JK |
97 | %if %{with python2} |
98 | %{__python} setup.py build | |
99 | %endif | |
100 | ||
101 | %if %{with python3} | |
102 | export NO_SETUPTOOLS=1 | |
103 | %{__python3} setup.py build --build-base=build3 | |
104 | unset NO_SETUPTOOLS | |
105 | %endif | |
baeb5efa | 106 | |
ad173d2e AM |
107 | %{__make} -C doc text |
108 | ||
baeb5efa | 109 | %install |
ad173d2e | 110 | cd logilab-pylint-* |
baeb5efa | 111 | rm -rf $RPM_BUILD_ROOT |
4ec6f79e | 112 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} |
baeb5efa | 113 | |
f7cd7b16 JK |
114 | %if %{with python3} |
115 | export NO_SETUPTOOLS=1 | |
116 | %{__python3} setup.py build --build-base=build3 install \ | |
2ae24f33 KK |
117 | --optimize=2 \ |
118 | --root=$RPM_BUILD_ROOT | |
4efaa76d | 119 | |
f7cd7b16 JK |
120 | unset NO_SETUPTOOLS |
121 | mv $RPM_BUILD_ROOT%{_bindir}/epylint $RPM_BUILD_ROOT%{_bindir}/epy3lint | |
122 | mv $RPM_BUILD_ROOT%{_bindir}/pylint $RPM_BUILD_ROOT%{_bindir}/py3lint | |
123 | mv $RPM_BUILD_ROOT%{_bindir}/pylint-gui $RPM_BUILD_ROOT%{_bindir}/py3lint-gui | |
124 | mv $RPM_BUILD_ROOT%{_bindir}/pyreverse $RPM_BUILD_ROOT%{_bindir}/py3reverse | |
125 | install man/epylint.1 $RPM_BUILD_ROOT%{_mandir}/man1/epy3lint.1 | |
126 | install man/pylint.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3lint.1 | |
127 | install man/pylint-gui.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3lint-gui.1 | |
128 | install man/pyreverse.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3reverse.1 | |
129 | %endif | |
4efaa76d | 130 | |
f7cd7b16 JK |
131 | %if %{with python2} |
132 | %{__python} setup.py install \ | |
133 | --optimize=2 \ | |
134 | --root=$RPM_BUILD_ROOT | |
7c199dbc | 135 | %py_postclean |
f7cd7b16 JK |
136 | install man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
137 | %endif | |
138 | ||
139 | install examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc | |
baeb5efa | 140 | |
141 | %clean | |
142 | rm -rf $RPM_BUILD_ROOT | |
143 | ||
f7cd7b16 | 144 | %if %{with python2} |
baeb5efa | 145 | %files |
146 | %defattr(644,root,root,755) | |
ad173d2e | 147 | %doc logilab-pylint-*/{ChangeLog,README,examples/*,doc/_build/text/*.txt} |
ebaa5e6b | 148 | %attr(755,root,root) %{_bindir}/epylint |
7c199dbc | 149 | %attr(755,root,root) %{_bindir}/pylint |
ebaa5e6b | 150 | %attr(755,root,root) %{_bindir}/pyreverse |
7c199dbc | 151 | %attr(755,root,root) %{_bindir}/symilar |
b4896848 | 152 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc |
6abb03ef JB |
153 | %{py_sitescriptdir}/pylint |
154 | %{py_sitescriptdir}/pylint-%{version}-py*.egg-info | |
155 | %{_mandir}/man1/epylint.1* | |
156 | %{_mandir}/man1/pylint.1* | |
157 | %{_mandir}/man1/pyreverse.1* | |
158 | %{_mandir}/man1/symilar.1* | |
7c199dbc KK |
159 | |
160 | %files gui | |
161 | %defattr(644,root,root,755) | |
162 | %attr(755,root,root) %{_bindir}/pylint-gui | |
6abb03ef | 163 | %{_mandir}/man1/pylint-gui.1* |
f7cd7b16 JK |
164 | %endif |
165 | ||
166 | %if %{with python3} | |
167 | %files python3 | |
168 | %defattr(644,root,root,755) | |
169 | %doc logilab-pylint-*/{ChangeLog,README,examples/*,doc/_build/text/*.txt} | |
170 | %attr(755,root,root) %{_bindir}/epy3lint | |
171 | %attr(755,root,root) %{_bindir}/py3lint | |
172 | %attr(755,root,root) %{_bindir}/py3reverse | |
173 | #%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc | |
174 | %{py3_sitescriptdir}/pylint | |
175 | %{py3_sitescriptdir}/pylint-%{version}-py*.egg-info | |
176 | %{_mandir}/man1/epy3lint.1* | |
177 | %{_mandir}/man1/py3lint.1* | |
178 | %{_mandir}/man1/py3reverse.1* | |
179 | ||
180 | %files python3-gui | |
181 | %defattr(644,root,root,755) | |
182 | %attr(755,root,root) %{_bindir}/py3lint-gui | |
183 | %{_mandir}/man1/py3lint-gui.1* | |
184 | %endif | |
185 |