]>
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 | 11 | Version: 1.0.0 |
439af2ef | 12 | Release: 4 |
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} | |
e7910477 | 24 | BuildRequires: python-2to3 |
f7cd7b16 JK |
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 |
439af2ef | 32 | Requires: python-astroid >= 0.24.3 |
87946be2 | 33 | Requires: python-logilab-common >= 0.53.0 |
704b7472 | 34 | Requires: python-modules |
93850ade | 35 | Suggests: python-devel-src |
baeb5efa | 36 | BuildArch: noarch |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
1ee582a8 ER |
39 | # /etc/pylintrc is deliberately packaged to both packages with same name |
40 | %define _duplicate_files_terminate_build 0 | |
41 | ||
baeb5efa | 42 | %description |
43 | Python tool that checks if a module satisfy a coding standard. | |
44 | ||
65b81fbb | 45 | %description -l pl.UTF-8 |
704b7472 ER |
46 | Narzędzie sprawdzające zgodność modułów napisanych w języku Python z |
47 | regułami tworzenia kodu źródłowego. | |
c85c0a5a | 48 | |
7c199dbc KK |
49 | %package gui |
50 | Summary: GUI for pylint | |
24b2f055 | 51 | Summary(pl.UTF-8): Graficzny interfejs użytkownika dla pylinta |
7c199dbc KK |
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 | ||
65b81fbb JR |
59 | %description gui -l pl.UTF-8 |
60 | Oparty na bibliotece Tk graficzny interfejs użytkownika dla pylinta. | |
7c199dbc | 61 | |
704b7472 | 62 | %package -n py3lint |
f7cd7b16 JK |
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 | |
439af2ef | 66 | Requires: python3-astroid >= 0.24.3 |
f7cd7b16 | 67 | Requires: python3-logilab-common >= 0.53.0 |
704b7472 | 68 | Obsoletes: pylint-python3 < 1.0.0-2 |
f7cd7b16 | 69 | |
704b7472 | 70 | %description -n py3lint |
f7cd7b16 JK |
71 | Python tool that checks if a module satisfy a coding standard. |
72 | ||
73 | Python 3.x version, available via the 'py3lint' command. | |
74 | ||
704b7472 ER |
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. | |
f7cd7b16 JK |
78 | |
79 | Wersja dla Pythona 3.x, dostępna przez polecenie 'py3lint'. | |
80 | ||
704b7472 | 81 | %package -n py3lint-gui |
f7cd7b16 JK |
82 | Summary: GUI for pylint |
83 | Summary(pl.UTF-8): Graficzny interfejs użytkownika dla pylinta | |
84 | Group: Development/Languages/Python | |
704b7472 | 85 | Requires: py3lint = %{version}-%{release} |
f7cd7b16 | 86 | Requires: python3-tkinter |
704b7472 | 87 | Obsoletes: pylint-python3-gui < 1.0.0-2 |
f7cd7b16 | 88 | |
704b7472 | 89 | %description -n py3lint-gui |
f7cd7b16 JK |
90 | Tk based GUI for pylint. |
91 | ||
704b7472 | 92 | %description -n py3lint-gui -l pl.UTF-8 |
f7cd7b16 JK |
93 | Oparty na bibliotece Tk graficzny interfejs użytkownika dla pylinta. |
94 | ||
baeb5efa | 95 | %prep |
704b7472 ER |
96 | %setup -qc |
97 | mv logilab-pylint-*/* . | |
8b70ac82 JK |
98 | %patch0 -p1 |
99 | ||
baeb5efa | 100 | %build |
f7cd7b16 JK |
101 | %if %{with python2} |
102 | %{__python} setup.py build | |
103 | %endif | |
104 | ||
105 | %if %{with python3} | |
106 | export NO_SETUPTOOLS=1 | |
107 | %{__python3} setup.py build --build-base=build3 | |
108 | unset NO_SETUPTOOLS | |
109 | %endif | |
baeb5efa | 110 | |
ad173d2e AM |
111 | %{__make} -C doc text |
112 | ||
baeb5efa | 113 | %install |
704b7472 | 114 | rm -rf $RPM_BUILD_ROOT |
baeb5efa | 115 | rm -rf $RPM_BUILD_ROOT |
4ec6f79e | 116 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} |
baeb5efa | 117 | |
f7cd7b16 JK |
118 | %if %{with python3} |
119 | export NO_SETUPTOOLS=1 | |
120 | %{__python3} setup.py build --build-base=build3 install \ | |
2ae24f33 KK |
121 | --optimize=2 \ |
122 | --root=$RPM_BUILD_ROOT | |
4efaa76d | 123 | |
f7cd7b16 JK |
124 | unset NO_SETUPTOOLS |
125 | mv $RPM_BUILD_ROOT%{_bindir}/epylint $RPM_BUILD_ROOT%{_bindir}/epy3lint | |
126 | mv $RPM_BUILD_ROOT%{_bindir}/pylint $RPM_BUILD_ROOT%{_bindir}/py3lint | |
127 | mv $RPM_BUILD_ROOT%{_bindir}/pylint-gui $RPM_BUILD_ROOT%{_bindir}/py3lint-gui | |
128 | mv $RPM_BUILD_ROOT%{_bindir}/pyreverse $RPM_BUILD_ROOT%{_bindir}/py3reverse | |
704b7472 ER |
129 | cp -p man/epylint.1 $RPM_BUILD_ROOT%{_mandir}/man1/epy3lint.1 |
130 | cp -p man/pylint.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3lint.1 | |
131 | cp -p man/pylint-gui.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3lint-gui.1 | |
132 | cp -p man/pyreverse.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3reverse.1 | |
f7cd7b16 | 133 | %endif |
4efaa76d | 134 | |
f7cd7b16 JK |
135 | %if %{with python2} |
136 | %{__python} setup.py install \ | |
137 | --optimize=2 \ | |
138 | --root=$RPM_BUILD_ROOT | |
7c199dbc | 139 | %py_postclean |
704b7472 | 140 | cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
f7cd7b16 JK |
141 | %endif |
142 | ||
704b7472 | 143 | cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc |
baeb5efa | 144 | |
145 | %clean | |
146 | rm -rf $RPM_BUILD_ROOT | |
147 | ||
f7cd7b16 | 148 | %if %{with python2} |
baeb5efa | 149 | %files |
150 | %defattr(644,root,root,755) | |
abbf502b | 151 | %doc ChangeLog README examples/* doc/_build/text/*.txt |
ebaa5e6b | 152 | %attr(755,root,root) %{_bindir}/epylint |
7c199dbc | 153 | %attr(755,root,root) %{_bindir}/pylint |
ebaa5e6b | 154 | %attr(755,root,root) %{_bindir}/pyreverse |
7c199dbc | 155 | %attr(755,root,root) %{_bindir}/symilar |
b4896848 | 156 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc |
6abb03ef JB |
157 | %{py_sitescriptdir}/pylint |
158 | %{py_sitescriptdir}/pylint-%{version}-py*.egg-info | |
159 | %{_mandir}/man1/epylint.1* | |
160 | %{_mandir}/man1/pylint.1* | |
161 | %{_mandir}/man1/pyreverse.1* | |
162 | %{_mandir}/man1/symilar.1* | |
7c199dbc KK |
163 | |
164 | %files gui | |
165 | %defattr(644,root,root,755) | |
166 | %attr(755,root,root) %{_bindir}/pylint-gui | |
6abb03ef | 167 | %{_mandir}/man1/pylint-gui.1* |
f7cd7b16 JK |
168 | %endif |
169 | ||
170 | %if %{with python3} | |
704b7472 | 171 | %files -n py3lint |
f7cd7b16 | 172 | %defattr(644,root,root,755) |
abbf502b | 173 | %doc ChangeLog README examples/* doc/_build/text/*.txt |
f7cd7b16 JK |
174 | %attr(755,root,root) %{_bindir}/epy3lint |
175 | %attr(755,root,root) %{_bindir}/py3lint | |
176 | %attr(755,root,root) %{_bindir}/py3reverse | |
704b7472 | 177 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc |
f7cd7b16 JK |
178 | %{py3_sitescriptdir}/pylint |
179 | %{py3_sitescriptdir}/pylint-%{version}-py*.egg-info | |
180 | %{_mandir}/man1/epy3lint.1* | |
181 | %{_mandir}/man1/py3lint.1* | |
182 | %{_mandir}/man1/py3reverse.1* | |
183 | ||
704b7472 | 184 | %files -n py3lint-gui |
f7cd7b16 JK |
185 | %defattr(644,root,root,755) |
186 | %attr(755,root,root) %{_bindir}/py3lint-gui | |
187 | %{_mandir}/man1/py3lint-gui.1* | |
188 | %endif |