]>
Commit | Line | Data |
---|---|---|
a4ae4119 ER |
1 | # |
2 | # Conditional build: | |
a329ee82 | 3 | %bcond_without tests # test target |
9fd6c09f AM |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
a4ae4119 | 6 | |
20c0205c | 7 | %define module pyflakes |
62420600 | 8 | Summary: Passive checker of Python programs |
dddde51f | 9 | Summary(pl.UTF-8): Pasywny program do sprawdzania programów w Pythonie |
20c0205c | 10 | Name: python-%{module} |
a329ee82 | 11 | Version: 1.1.0 |
af46fa0f | 12 | Release: 2 |
62420600 KK |
13 | License: MIT |
14 | Group: Development/Tools | |
a329ee82 JB |
15 | #Source0Download: https://pypi.python.org/simple/pyflakes/ |
16 | Source0: https://pypi.python.org/packages/source/p/pyflakes/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: e0bf854cd5abd4527e149692925b82eb | |
62420600 | 18 | URL: http://www.divmod.org/projects/pyflakes |
9fd6c09f | 19 | %if %{with python2} |
a329ee82 JB |
20 | BuildRequires: python-devel >= 1:2.5 |
21 | BuildRequires: python-modules >= 1:2.5 | |
9fd6c09f | 22 | %endif |
9fd6c09f | 23 | %if %{with python3} |
a329ee82 JB |
24 | BuildRequires: python3-devel >= 1:3.2 |
25 | BuildRequires: python3-modules >= 1:3.2 | |
9fd6c09f | 26 | %endif |
a329ee82 JB |
27 | BuildRequires: rpm-pythonprov |
28 | BuildRequires: rpmbuild(macros) >= 1.714 | |
29 | Requires: python-modules >= 1:2.5 | |
20c0205c ER |
30 | Provides: pyflakes = %{version}-%{release} |
31 | Obsoletes: pyflakes < 0.4.0-2 | |
62420600 KK |
32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | Pyflakes is a simple program which checks Python source files for | |
37 | errors. It is similar to PyChecker in scope, but differs in that it | |
38 | does not execute the modules to check them. This is both safer and | |
39 | faster, although it does not perform as many checks. Unlike PyLint, | |
40 | Pyflakes checks only for logical errors in programs; it does not | |
41 | perform any checks on style. | |
42 | ||
d3ebe99a JR |
43 | %description -l pl.UTF-8 |
44 | Pyflakes to prosty program sprawdzający pliki źródłowe Pythona pod | |
45 | kątem błędów. Jest podobny do PyCheckera jeśli chodzi o zakres | |
46 | działania, ale różni się tym, że nie wykonuje modułów przy sprawdzaniu | |
47 | ich. Jest to zarówno bardziej bezpieczne, jak i szybze, choć nie | |
20c0205c ER |
48 | sprawdza tak wielu rzeczy. W przeciwieństwie do PyLinta Pyflakes szuka |
49 | tylko błędów logicznych w programach; nie sprawdza stylu. | |
01fa6f59 | 50 | |
9fd6c09f AM |
51 | %package -n python3-%{module} |
52 | Summary: Passive checker of Python programs | |
53 | Summary(pl.UTF-8): Pasywny program do sprawdzania programów w Pythonie | |
54 | Group: Libraries/Python | |
a329ee82 | 55 | Requires: python3-modules >= 1:3.2 |
9fd6c09f AM |
56 | |
57 | %description -n python3-%{module} | |
58 | Pyflakes is a simple program which checks Python source files for | |
59 | errors. It is similar to PyChecker in scope, but differs in that it | |
60 | does not execute the modules to check them. This is both safer and | |
61 | faster, although it does not perform as many checks. Unlike PyLint, | |
62 | Pyflakes checks only for logical errors in programs; it does not | |
63 | perform any checks on style. | |
64 | ||
65 | %description -n python3-%{module} -l pl.UTF-8 | |
66 | Pyflakes to prosty program sprawdzający pliki źródłowe Pythona pod | |
67 | kątem błędów. Jest podobny do PyCheckera jeśli chodzi o zakres | |
68 | działania, ale różni się tym, że nie wykonuje modułów przy sprawdzaniu | |
69 | ich. Jest to zarówno bardziej bezpieczne, jak i szybze, choć nie | |
70 | sprawdza tak wielu rzeczy. W przeciwieństwie do PyLinta Pyflakes szuka | |
71 | tylko błędów logicznych w programach; nie sprawdza stylu. | |
72 | ||
62420600 | 73 | %prep |
20c0205c | 74 | %setup -q -n %{module}-%{version} |
62420600 | 75 | |
a4ae4119 | 76 | %build |
9fd6c09f | 77 | %if %{with python2} |
6cfbf5ca | 78 | %py_build %{?with_tests:test} |
9fd6c09f | 79 | %endif |
a4ae4119 | 80 | |
9fd6c09f | 81 | %if %{with python3} |
6cfbf5ca | 82 | %py3_build %{?with_tests:test} |
a4ae4119 ER |
83 | %endif |
84 | ||
62420600 KK |
85 | %install |
86 | rm -rf $RPM_BUILD_ROOT | |
9fd6c09f AM |
87 | |
88 | %if %{with python2} | |
6cfbf5ca | 89 | %py_install |
62420600 | 90 | |
a329ee82 JB |
91 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pyflakes{,-2} |
92 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pyflakes/test | |
62420600 | 93 | %py_postclean |
9fd6c09f AM |
94 | %endif |
95 | ||
96 | %if %{with python3} | |
6cfbf5ca | 97 | %py3_install |
a329ee82 JB |
98 | |
99 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pyflakes{,-3} | |
100 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pyflakes/test | |
9fd6c09f | 101 | %endif |
62420600 | 102 | |
a329ee82 JB |
103 | %if %{with python2} |
104 | ln -sf pyflakes-2 $RPM_BUILD_ROOT%{_bindir}/pyflakes | |
105 | %endif | |
20c0205c | 106 | |
62420600 KK |
107 | %clean |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
9fd6c09f | 110 | %if %{with python2} |
62420600 KK |
111 | %files |
112 | %defattr(644,root,root,755) | |
a329ee82 | 113 | %doc AUTHORS LICENSE NEWS.txt README.rst |
20c0205c | 114 | %attr(755,root,root) %{_bindir}/pyflakes |
a329ee82 | 115 | %attr(755,root,root) %{_bindir}/pyflakes-2 |
62420600 | 116 | %{py_sitescriptdir}/pyflakes |
20c0205c ER |
117 | %{py_sitescriptdir}/pyflakes-%{version}-*.egg-info |
118 | %endif | |
9fd6c09f AM |
119 | |
120 | %if %{with python3} | |
121 | %files -n python3-%{module} | |
122 | %defattr(644,root,root,755) | |
a329ee82 JB |
123 | %attr(755,root,root) %{_bindir}/pyflakes-3 |
124 | %{py3_sitescriptdir}/pyflakes | |
125 | %{py3_sitescriptdir}/pyflakes-%{version}-py*.egg-info | |
9fd6c09f | 126 | %endif |