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