]> git.pld-linux.org Git - packages/pylint.git/blob - pylint.spec
- updated astroid version; needs six now
[packages/pylint.git] / pylint.spec
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.4.0
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:  c164738f90213981db5d3297a60b4138
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 >= 1.3.2
33 Requires:       python-logilab-common >= 0.53.0
34 Requires:       python-modules
35 Requires:       python-six
36 Suggests:       python-devel-src
37 BuildArch:      noarch
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 # /etc/pylintrc is deliberately packaged to both packages with same name
41 %define         _duplicate_files_terminate_build        0
42
43 %description
44 Python tool that checks if a module satisfy a coding standard.
45
46 %description -l pl.UTF-8
47 Narzędzie sprawdzające zgodność modułów napisanych w języku Python z
48 regułami tworzenia kodu źródłowego.
49
50 %package gui
51 Summary:        GUI for pylint
52 Summary(pl.UTF-8):      Graficzny interfejs użytkownika dla pylinta
53 Group:          Development/Languages/Python
54 Requires:       %{name} = %{version}-%{release}
55 Requires:       python-tkinter
56
57 %description gui
58 Tk based GUI for pylint.
59
60 %description gui -l pl.UTF-8
61 Oparty na bibliotece Tk graficzny interfejs użytkownika dla pylinta.
62
63 %package -n py3lint
64 Summary:        Python tool that checks if a module satisfy a coding standard
65 Summary(pl.UTF-8):      Pythonowe narzędzie sprawdzające zgodność modułu ze standardem kodowania
66 Group:          Development/Languages/Python
67 Requires:       python3-astroid >= 1.3.2
68 Requires:       python3-logilab-common >= 0.53.0
69 Requires:       python3-six
70 Obsoletes:      pylint-python3 < 1.0.0-2
71
72 %description -n py3lint
73 Python tool that checks if a module satisfy a coding standard.
74
75 Python 3.x version, available via the 'py3lint' command.
76
77 %description -n py3lint -l pl.UTF-8
78 Narzędzie sprawdzające zgodność modułów napisanych w języku Python z
79 regułami tworzenia kodu źródłowego.
80
81 Wersja dla Pythona 3.x, dostępna przez polecenie 'py3lint'.
82
83 %package -n py3lint-gui
84 Summary:        GUI for pylint
85 Summary(pl.UTF-8):      Graficzny interfejs użytkownika dla pylinta
86 Group:          Development/Languages/Python
87 Requires:       py3lint = %{version}-%{release}
88 Requires:       python3-tkinter
89 Obsoletes:      pylint-python3-gui < 1.0.0-2
90
91 %description -n py3lint-gui
92 Tk based GUI for pylint.
93
94 %description -n py3lint-gui -l pl.UTF-8
95 Oparty na bibliotece Tk graficzny interfejs użytkownika dla pylinta.
96
97 %prep
98 %setup -q
99 %patch0 -p1
100
101 %build
102 %if %{with python2}
103 %{__python} setup.py build
104 %else
105 # for sphinx
106 install -d build/lib
107 ln -sf ../.. build/lib/pylint
108 %endif
109
110 %if %{with python3}
111 export NO_SETUPTOOLS=1
112 %{__python3} setup.py build --build-base=build3
113 unset NO_SETUPTOOLS
114 %endif
115
116 export PYTHONPATH=$PWD/build/lib
117 %{__make} -C doc text
118
119 %install
120 rm -rf $RPM_BUILD_ROOT
121 rm -rf $RPM_BUILD_ROOT
122 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1}
123
124 %if %{with python3}
125 export NO_SETUPTOOLS=1
126 %{__python3} setup.py build --build-base=build3 install \
127         --optimize=2 \
128         --root=$RPM_BUILD_ROOT
129
130 unset NO_SETUPTOOLS
131 mv $RPM_BUILD_ROOT%{_bindir}/epylint $RPM_BUILD_ROOT%{_bindir}/epy3lint
132 mv $RPM_BUILD_ROOT%{_bindir}/pylint $RPM_BUILD_ROOT%{_bindir}/py3lint
133 mv $RPM_BUILD_ROOT%{_bindir}/pylint-gui $RPM_BUILD_ROOT%{_bindir}/py3lint-gui
134 mv $RPM_BUILD_ROOT%{_bindir}/pyreverse $RPM_BUILD_ROOT%{_bindir}/py3reverse
135 cp -p man/epylint.1 $RPM_BUILD_ROOT%{_mandir}/man1/epy3lint.1
136 cp -p man/pylint.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3lint.1
137 cp -p man/pylint-gui.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3lint-gui.1
138 cp -p man/pyreverse.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3reverse.1
139 %endif
140
141 %if %{with python2}
142 %{__python} setup.py install \
143         --optimize=2 \
144         --root=$RPM_BUILD_ROOT
145 %py_postclean
146 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
147 %endif
148
149 cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc
150
151 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %if %{with python2}
155 %files
156 %defattr(644,root,root,755)
157 %doc ChangeLog README examples/* doc/_build/text/*.txt
158 %attr(755,root,root) %{_bindir}/epylint
159 %attr(755,root,root) %{_bindir}/pylint
160 %attr(755,root,root) %{_bindir}/pyreverse
161 %attr(755,root,root) %{_bindir}/symilar
162 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc
163 %{py_sitescriptdir}/pylint
164 %{py_sitescriptdir}/pylint-%{version}-py*.egg-info
165 %{_mandir}/man1/epylint.1*
166 %{_mandir}/man1/pylint.1*
167 %{_mandir}/man1/pyreverse.1*
168 %{_mandir}/man1/symilar.1*
169
170 %files gui
171 %defattr(644,root,root,755)
172 %attr(755,root,root) %{_bindir}/pylint-gui
173 %{_mandir}/man1/pylint-gui.1*
174 %endif
175
176 %if %{with python3}
177 %files -n py3lint
178 %defattr(644,root,root,755)
179 %doc ChangeLog README examples/* doc/_build/text/*.txt
180 %attr(755,root,root) %{_bindir}/epy3lint
181 %attr(755,root,root) %{_bindir}/py3lint
182 %attr(755,root,root) %{_bindir}/py3reverse
183 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc
184 %{py3_sitescriptdir}/pylint
185 %{py3_sitescriptdir}/pylint-%{version}-py*.egg-info
186 %{_mandir}/man1/epy3lint.1*
187 %{_mandir}/man1/py3lint.1*
188 %{_mandir}/man1/py3reverse.1*
189
190 %files -n py3lint-gui
191 %defattr(644,root,root,755)
192 %attr(755,root,root) %{_bindir}/py3lint-gui
193 %{_mandir}/man1/py3lint-gui.1*
194 %endif
This page took 0.087255 seconds and 3 git commands to generate.