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