]>
Commit | Line | Data |
---|---|---|
a24e9a34 ER |
1 | # |
2 | # Conditional build: | |
37b9d23d JB |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
a24e9a34 ER |
5 | %bcond_without tests # do not perform "make test" |
6 | ||
abcf879e | 7 | Summary: The modular source code checker: pep8, pyflakes and co |
37b9d23d | 8 | Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pep8, pyflakes itp. |
abcf879e | 9 | Name: flake8 |
37b9d23d | 10 | Version: 2.5.4 |
3643ee8e | 11 | Release: 2 |
abcf879e AM |
12 | License: MIT |
13 | Group: Development/Tools | |
37b9d23d | 14 | #Source0Download: https://pypi.python.org/simple/flake8/ |
abcf879e | 15 | Source0: https://pypi.python.org/packages/source/f/flake8/%{name}-%{version}.tar.gz |
37b9d23d | 16 | # Source0-md5: a4585b3569b95c3f66acb8294a7f06ef |
19c415b3 | 17 | Patch0: %{name}-dependencies.patch |
abcf879e | 18 | URL: https://pypi.python.org/pypi/flake8 |
37b9d23d | 19 | BuildRequires: rpmbuild(macros) >= 1.714 |
abcf879e | 20 | BuildRequires: rpm-pythonprov |
37b9d23d JB |
21 | %if %{with python2} |
22 | BuildRequires: python-modules >= 1:2.5 | |
23 | BuildRequires: python-setuptools | |
24 | %if %{with tests} | |
25 | BuildRequires: python-mccabe >= 0.2.1 | |
26 | BuildRequires: python-mock | |
27 | BuildRequires: python-nose | |
28 | BuildRequires: python-pep8 >= 1.5.7 | |
29 | BuildRequires: python-pyflakes >= 0.8.1 | |
30 | %endif | |
31 | %endif | |
32 | %if %{with python3} | |
33 | BuildRequires: python3-modules >= 1:3.2 | |
34 | BuildRequires: python3-setuptools | |
a24e9a34 ER |
35 | %if %{with tests} |
36 | BuildRequires: python3-mccabe >= 0.2.1 | |
15a03bbe | 37 | BuildRequires: python3-nose |
a24e9a34 ER |
38 | BuildRequires: python3-pep8 >= 1.5.7 |
39 | BuildRequires: python3-pyflakes >= 0.8.1 | |
40 | %endif | |
37b9d23d JB |
41 | %endif |
42 | %if %{with python3} | |
43 | Requires: python3-flake8 = %{version}-%{release} | |
44 | %else | |
45 | Requires: python-flake8 = %{version}-%{release} | |
46 | %endif | |
abcf879e AM |
47 | BuildArch: noarch |
48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
49 | ||
50 | %description | |
51 | The modular source code checker. It is a wrapper around these tools: | |
52 | - PyFlakes | |
53 | - pep8 | |
54 | - Ned Batchelder's McCabe script | |
55 | ||
37b9d23d JB |
56 | %description -l pl.UTF-8 |
57 | Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie | |
58 | dla narzędzi: | |
59 | - PyFlakes | |
60 | - pep8 | |
61 | - skrypt McCabe autorstwa Neda Batcheldera | |
62 | ||
63 | %package -n python-flake8 | |
64 | Summary: The modular source code checker: pep8, pyflakes and co | |
65 | Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pep8, pyflakes itp. | |
66 | Group: Libraries/Python | |
67 | Requires: python-modules | |
68 | ||
69 | %description -n python-flake8 | |
70 | The modular source code checker. It is a wrapper around these tools: | |
71 | - PyFlakes | |
72 | - pep8 | |
73 | - Ned Batchelder's McCabe script | |
74 | ||
75 | %description -n python-flake8 -l pl.UTF-8 | |
76 | Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie | |
77 | dla narzędzi: | |
78 | - PyFlakes | |
79 | - pep8 | |
80 | - skrypt McCabe autorstwa Neda Batcheldera | |
81 | ||
82 | %package -n python3-flake8 | |
83 | Summary: The modular source code checker: pep8, pyflakes and co | |
84 | Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pep8, pyflakes itp. | |
85 | Group: Libraries/Python | |
86 | Requires: python3-modules | |
87 | ||
88 | %description -n python3-flake8 | |
89 | The modular source code checker. It is a wrapper around these tools: | |
90 | - PyFlakes | |
91 | - pep8 | |
92 | - Ned Batchelder's McCabe script | |
93 | ||
94 | %description -n python3-flake8 -l pl.UTF-8 | |
95 | Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie | |
96 | dla narzędzi: | |
97 | - PyFlakes | |
98 | - pep8 | |
99 | - skrypt McCabe autorstwa Neda Batcheldera | |
100 | ||
abcf879e AM |
101 | %prep |
102 | %setup -q | |
19c415b3 | 103 | %patch0 -p1 |
abcf879e AM |
104 | |
105 | %build | |
37b9d23d JB |
106 | %if %{with python2} |
107 | %py_build %{?with_tests:test} | |
108 | %endif | |
109 | ||
110 | %if %{with python3} | |
33643bb9 | 111 | %py3_build %{?with_tests:test} |
37b9d23d | 112 | %endif |
abcf879e AM |
113 | |
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
37b9d23d JB |
116 | |
117 | %if %{with python2} | |
118 | %py_install | |
8b0b6706 | 119 | mv $RPM_BUILD_ROOT%{_bindir}/flake8{,-2} |
37b9d23d JB |
120 | %py_postclean |
121 | %endif | |
122 | ||
123 | %if %{with python3} | |
33643bb9 | 124 | %py3_install |
8b0b6706 | 125 | mv $RPM_BUILD_ROOT%{_bindir}/flake8{,-3} |
37b9d23d | 126 | %endif |
abcf879e | 127 | |
8b0b6706 ER |
128 | ln -s flake-%{!?with_python3:2}%{?with_python3:3} $RPM_BUILD_ROOT%{_bindir}/flake8 |
129 | ||
abcf879e AM |
130 | %clean |
131 | rm -rf $RPM_BUILD_ROOT | |
132 | ||
133 | %files | |
134 | %defattr(644,root,root,755) | |
37b9d23d | 135 | %doc CHANGES.rst CONTRIBUTORS.txt LICENSE README.rst |
abcf879e | 136 | %attr(755,root,root) %{_bindir}/flake8 |
37b9d23d JB |
137 | |
138 | %if %{with python2} | |
139 | %files -n python-flake8 | |
140 | %defattr(644,root,root,755) | |
141 | %attr(755,root,root) %{_bindir}/flake8-2 | |
142 | %{py_sitescriptdir}/flake8 | |
143 | %{py_sitescriptdir}/flake8-%{version}-py*.egg-info | |
144 | %endif | |
145 | ||
146 | %if %{with python3} | |
147 | %files -n python3-flake8 | |
148 | %defattr(644,root,root,755) | |
149 | %attr(755,root,root) %{_bindir}/flake8-3 | |
150 | %{py3_sitescriptdir}/flake8 | |
151 | %{py3_sitescriptdir}/flake8-%{version}-py*.egg-info | |
152 | %endif |