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