]>
Commit | Line | Data |
---|---|---|
f021bddd ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
67a59601 | 4 | %bcond_without rpm4 # build for rpm4 |
f021bddd | 5 | |
a8e9a8e0 | 6 | Summary: Tool for checking common errors in RPM packages |
3f2e0c60 | 7 | Summary(pl.UTF-8): Narzędzie do sprawdzania pakietów RPM pod kątem częstych błędów |
c502a620 | 8 | Name: rpmlint |
f24c60bb | 9 | Version: 1.11 |
213a8fb0 | 10 | Release: 3 |
b0a00fa5 | 11 | License: GPL v2 |
c502a620 | 12 | Group: Development/Building |
7ea4c2ce | 13 | Source0: https://github.com/rpm-software-management/rpmlint/archive/%{name}-%{version}.tar.gz |
f24c60bb | 14 | # Source0-md5: 2642bb6f08f6e2a2f2c0fe9f07634d49 |
f021bddd ER |
15 | Source1: %{name}.config |
16 | Source3: %{name}-etc.config | |
cc5a0c30 | 17 | Patch0: %{name}-groups.patch |
18f9b171 | 18 | Patch1: pythonpath.patch |
0cb3fb55 | 19 | Patch2: %{name}-licenses.patch |
88c94542 JR |
20 | Patch3: postshell.patch |
21 | Patch4: rpm5.patch | |
1f50ca43 | 22 | Patch5: bash-completion.patch |
f5b2d519 | 23 | Patch6: revert-9f71923e.patch |
f24c60bb JR |
24 | Patch7: rpm4.15.patch |
25 | Patch8: python3.patch | |
5d9af7a7 JR |
26 | Patch9: libc-warnings.patch |
27 | Patch10: fix-tests.patch | |
7ea4c2ce | 28 | URL: https://github.com/rpm-software-management/rpmlint |
f24c60bb JR |
29 | %if %{with rpm4} |
30 | BuildRequires: python3 | |
31 | BuildRequires: python3-modules | |
5d9af7a7 JR |
32 | %if %{with tests} |
33 | BuildRequires: python3-pytest | |
34 | BuildRequires: python3-flake8 | |
35 | BuildRequires: python3-rpm >= 1:4.16 | |
36 | %endif | |
f24c60bb | 37 | %else |
21e8a795 | 38 | BuildRequires: python >= 1:2.6 |
f7da4619 | 39 | BuildRequires: python-modules |
5d9af7a7 JR |
40 | %if %{with tests} |
41 | BuildRequires: python-flake8 | |
42 | BuildRequires: python-pytest | |
43 | BuildRequires: python-rpm >= 5.4.10-12} | |
44 | %endif | |
f24c60bb | 45 | %endif |
f7da4619 | 46 | BuildRequires: rpm-pythonprov |
545215d1 | 47 | BuildRequires: rpmbuild(macros) >= 1.673 |
99ee1f6f JB |
48 | Requires: /bin/bash |
49 | Requires: /lib/cpp | |
50 | Requires: binutils | |
a8e9a8e0 | 51 | Requires: bzip2 |
99ee1f6f | 52 | Requires: cpio |
a8e9a8e0 | 53 | Requires: desktop-file-utils |
99ee1f6f JB |
54 | Requires: file |
55 | Requires: findutils | |
56 | Requires: grep | |
a8e9a8e0 | 57 | Requires: gzip |
f24c60bb JR |
58 | %if %{with rpm4} |
59 | Requires: python3 | |
60 | Requires: python3-magic | |
61 | Requires: python3-pyenchant | |
62 | Requires: python3-rpm >= 1:4.16 | |
63 | %else | |
9fef494b | 64 | Requires: python >= 1.5.2 |
a8e9a8e0 ER |
65 | Requires: python-magic |
66 | Requires: python-pyenchant | |
f1e83b32 | 67 | Requires: python-rpm >= 5.4.10-12 |
f24c60bb | 68 | %endif |
a8e9a8e0 | 69 | Requires: xz |
c502a620 | 70 | BuildArch: noarch |
99ee1f6f | 71 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
c502a620 | 72 | |
73 | %description | |
74 | Rpmlint is a tool to check common errors on rpm packages. Binary and | |
75 | source packages can be checked. | |
76 | ||
6cf0c67a JR |
77 | %description -l pl.UTF-8 |
78 | rpmlint to narzędzie do sprawdzania pakietów RPM pod kątem często | |
79 | występujących błędów. Można sprawdzać pakiety źródłowe i binarne. | |
99ee1f6f | 80 | |
a8e9a8e0 ER |
81 | %package -n bash-completion-%{name} |
82 | Summary: bash-completion for rpmlint | |
3f2e0c60 | 83 | Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia rpmlint |
a8e9a8e0 ER |
84 | Group: Applications/Shells |
85 | Requires: %{name} = %{version}-%{release} | |
545215d1 | 86 | Requires: bash-completion >= 2.0 |
a8e9a8e0 ER |
87 | |
88 | %description -n bash-completion-%{name} | |
89 | bash-completion for rpmlint. | |
90 | ||
3f2e0c60 JB |
91 | %description -n bash-completion-%{name} -l pl.UTF-8 |
92 | Bashowe uzupełnianie parametrów dla polecenia rpmlint. | |
93 | ||
c502a620 | 94 | %prep |
7ea4c2ce | 95 | %setup -q -n %{name}-rpmlint-%{version} |
f24c60bb | 96 | %{!?with_rpm4:%patch0 -p1} |
18f9b171 | 97 | %patch1 -p1 |
0cb3fb55 | 98 | %patch2 -p1 |
706415a2 | 99 | %patch3 -p1 |
4fafb4fa | 100 | %patch5 -p1 |
f24c60bb JR |
101 | %if %{with rpm4} |
102 | %patch7 -p1 | |
103 | %patch8 -p1 | |
104 | %else | |
105 | %patch4 -p1 | |
f5b2d519 | 106 | %patch6 -p1 |
f24c60bb | 107 | %endif |
5d9af7a7 JR |
108 | %patch9 -p1 |
109 | %patch10 -p1 | |
7eff95a4 | 110 | |
f021bddd ER |
111 | cp -p config config.example |
112 | cp -p %{SOURCE3} config | |
113 | ||
f24c60bb | 114 | touch __init__.py |
f24c60bb | 115 | %if %{with rpm4} |
5d9af7a7 | 116 | %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' rpmdiff rpmlint |
d64a4a47 JR |
117 | # this test fails on builders |
118 | %{__rm} test/test_sources.py | |
f24c60bb | 119 | %else |
5d9af7a7 | 120 | %{__sed} -i -e '1s,/usr/bin/python,%{__python},' rpmdiff rpmlint |
e90f5d3e | 121 | # this syntax is not supported by rpm5? |
a3f4405b | 122 | %{__rm} test/test.CheckInclude.py test/test_tags.py test/test_sources.py |
f24c60bb | 123 | %endif |
c502a620 | 124 | |
125 | %build | |
f24c60bb | 126 | %if %{without rpm4} |
a8e9a8e0 | 127 | # Create GROUPS for -groups.patch |
07c5699d ER |
128 | rpmnv=$(rpm -q rpm --qf '%{N}-%{V}') |
129 | gzip -dc "%{_docdir}/$rpmnv/groups.gz" | awk '/^[A-Z].*/ { print }' > GROUPS | |
130 | test -s GROUPS | |
f24c60bb | 131 | %endif |
a8e9a8e0 ER |
132 | |
133 | %{__make} \ | |
545215d1 | 134 | bash_compdir=%{bash_compdir} \ |
f24c60bb JR |
135 | %if %{with rpm4} |
136 | PYTHON=%{__python3} \ | |
137 | %else | |
138 | PYTHON=%{__python} \ | |
139 | %endif | |
a8e9a8e0 | 140 | COMPILE_PYC=1 |
c502a620 | 141 | |
f021bddd | 142 | %if %{with tests} |
5d9af7a7 JR |
143 | %{__make} check \ |
144 | %if %{with rpm4} | |
145 | PYTHON=%{__python3} \ | |
146 | PYTEST=py.test-3 \ | |
147 | FLAKE8=flake8-3 \ | |
148 | %else | |
149 | PYTHON=%{__python} \ | |
150 | PYTEST=py.test \ | |
e90f5d3e | 151 | FLAKE8=flake8-2 \ |
5d9af7a7 | 152 | %endif |
f021bddd ER |
153 | %endif |
154 | ||
c502a620 | 155 | %install |
156 | rm -rf $RPM_BUILD_ROOT | |
157 | %{__make} install \ | |
d51dcadb | 158 | bash_compdir=%{bash_compdir} \ |
f24c60bb JR |
159 | %if %{with rpm4} |
160 | PYTHON=%{__python3} \ | |
161 | LIBDIR=%{py3_sitescriptdir}/%{name} \ | |
162 | %else | |
163 | PYTHON=%{__python} \ | |
164 | LIBDIR=%{py_sitescriptdir}/%{name} \ | |
165 | %endif | |
a8e9a8e0 ER |
166 | ETCDIR=%{_sysconfdir} \ |
167 | MANDIR=%{_mandir} \ | |
a8e9a8e0 | 168 | BINDIR=%{_bindir} \ |
c502a620 | 169 | DESTDIR=$RPM_BUILD_ROOT |
170 | ||
5d9af7a7 JR |
171 | %if %{with rpm4} |
172 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/rpmlint $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{name}/rpmlint.py | |
173 | cat <<'EOF' > $RPM_BUILD_ROOT%{_bindir}/rpmlint | |
174 | #!/bin/sh | |
175 | exec %{__python3} -tt -u -O %{py3_sitescriptdir}/%{name}/rpmlint.py "$@" | |
176 | EOF | |
177 | %else | |
178 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/rpmlint $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/rpmlint.py | |
179 | cat <<'EOF' > $RPM_BUILD_ROOT%{_bindir}/rpmlint | |
180 | #!/bin/sh | |
181 | exec %{__python} -tt -u -O %{py_sitescriptdir}/%{name}/rpmlint.pyc "$@" | |
182 | EOF | |
183 | %endif | |
184 | ||
7eff95a4 | 185 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name} |
545215d1 | 186 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/config |
5d9af7a7 | 187 | %{!?with_rpm4:cp -p GROUPS $RPM_BUILD_ROOT%{_datadir}/%{name}} |
a8e9a8e0 | 188 | |
f24c60bb | 189 | %if %{without rpm4} |
7eff95a4 ER |
190 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} |
191 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
192 | %py_postclean | |
f24c60bb | 193 | %endif |
a8e9a8e0 | 194 | |
c502a620 | 195 | %clean |
196 | rm -rf $RPM_BUILD_ROOT | |
197 | ||
198 | %files | |
199 | %defattr(644,root,root,755) | |
7ea4c2ce | 200 | %doc README* config.example |
7eff95a4 ER |
201 | %dir %{_sysconfdir}/rpmlint |
202 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpmlint/config | |
a8e9a8e0 ER |
203 | %attr(755,root,root) %{_bindir}/rpmdiff |
204 | %attr(755,root,root) %{_bindir}/rpmlint | |
545215d1 | 205 | %{_mandir}/man1/rpmdiff.1* |
a8e9a8e0 | 206 | %{_mandir}/man1/rpmlint.1* |
f021bddd | 207 | %dir %{_datadir}/%{name} |
f021bddd | 208 | %{_datadir}/%{name}/config |
f24c60bb JR |
209 | %if %{with rpm4} |
210 | %dir %{py3_sitescriptdir}/%{name} | |
211 | %{py3_sitescriptdir}/%{name}/__pycache__ | |
212 | %{py3_sitescriptdir}/%{name}/*.py | |
213 | %else | |
f021bddd ER |
214 | %dir %{py_sitescriptdir}/%{name} |
215 | %{py_sitescriptdir}/%{name}/*.py[co] | |
f24c60bb JR |
216 | %{_datadir}/%{name}/GROUPS |
217 | %endif | |
a8e9a8e0 ER |
218 | |
219 | %files -n bash-completion-%{name} | |
220 | %defattr(644,root,root,755) | |
545215d1 ER |
221 | %{bash_compdir}/rpmlint |
222 | %{bash_compdir}/rpmdiff |