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