3 %bcond_without tests # build without tests
4 %bcond_with rpm4 # build for rpm4
6 Summary: Tool for checking common errors in RPM packages
7 Summary(pl.UTF-8): Narzędzie do sprawdzania pakietów RPM pod kątem częstych błędów
12 Group: Development/Building
13 Source0: https://github.com/rpm-software-management/rpmlint/archive/%{name}-%{version}.tar.gz
14 # Source0-md5: 2642bb6f08f6e2a2f2c0fe9f07634d49
15 Source1: %{name}.config
16 Source3: %{name}-etc.config
17 Patch0: %{name}-groups.patch
18 Patch1: pythonpath.patch
19 Patch2: %{name}-licenses.patch
20 Patch3: postshell.patch
22 Patch5: bash-completion.patch
23 Patch6: revert-9f71923e.patch
26 URL: https://github.com/rpm-software-management/rpmlint
28 BuildRequires: python3
29 BuildRequires: python3-modules
30 %{?with_tests:BuildRequires: python3-rpm >= 1:4.16}
32 BuildRequires: python >= 1:2.6
33 BuildRequires: python-modules
34 %{?with_tests:BuildRequires: python-rpm >= 5.4.10-12}
36 BuildRequires: rpm-pythonprov
37 BuildRequires: rpmbuild(macros) >= 1.673
38 # tests require rpmlint in installed packages database
39 %{?with_tests:BuildRequires: rpmlint}
45 Requires: desktop-file-utils
52 Requires: python3-magic
53 Requires: python3-pyenchant
54 Requires: python3-rpm >= 1:4.16
56 Requires: python >= 1.5.2
57 Requires: python-magic
58 Requires: python-pyenchant
59 Requires: python-rpm >= 5.4.10-12
63 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 Rpmlint is a tool to check common errors on rpm packages. Binary and
67 source packages can be checked.
69 %description -l pl.UTF-8
70 rpmlint to narzędzie do sprawdzania pakietów RPM pod kątem często
71 występujących błędów. Można sprawdzać pakiety źródłowe i binarne.
73 %package -n bash-completion-%{name}
74 Summary: bash-completion for rpmlint
75 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia rpmlint
76 Group: Applications/Shells
77 Requires: %{name} = %{version}-%{release}
78 Requires: bash-completion >= 2.0
80 %description -n bash-completion-%{name}
81 bash-completion for rpmlint.
83 %description -n bash-completion-%{name} -l pl.UTF-8
84 Bashowe uzupełnianie parametrów dla polecenia rpmlint.
87 %setup -q -n %{name}-rpmlint-%{version}
88 %{!?with_rpm4:%patch0 -p1}
101 cp -p config config.example
102 cp -p %{SOURCE3} config
104 mv %{name} %{name}.py
105 %{__sed} -i -e 's,python ./rpmlint,./rpmlint.py,' test.sh
110 %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' rpmdiff rpmlint.py
111 cat <<'EOF' > %{name}
113 exec %{__python3} -tt -u -O %{py3_sitescriptdir}/%{name}/rpmlint.py "$@"
116 %{__sed} -i -e '1s,/usr/bin/python,%{__python},' rpmdiff rpmlint.py
117 cat <<'EOF' > %{name}
119 exec %{__python} -tt -u -O %{py_sitescriptdir}/%{name}/rpmlint.pyc "$@"
125 # Create GROUPS for -groups.patch
126 rpmnv=$(rpm -q rpm --qf '%{N}-%{V}')
127 gzip -dc "%{_docdir}/$rpmnv/groups.gz" | awk '/^[A-Z].*/ { print }' > GROUPS
132 bash_compdir=%{bash_compdir} \
134 PYTHON=%{__python3} \
145 rm -rf $RPM_BUILD_ROOT
147 bash_compdir=%{bash_compdir} \
149 PYTHON=%{__python3} \
150 LIBDIR=%{py3_sitescriptdir}/%{name} \
153 LIBDIR=%{py_sitescriptdir}/%{name} \
155 ETCDIR=%{_sysconfdir} \
158 DESTDIR=$RPM_BUILD_ROOT
160 #install -p %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
161 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
162 %{!?with_rpm4:cp -p GROUPS $RPM_BUILD_ROOT%{_datadir}/%{name}}
163 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/config
166 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
167 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
172 rm -rf $RPM_BUILD_ROOT
175 %defattr(644,root,root,755)
176 %doc README* config.example
177 %dir %{_sysconfdir}/rpmlint
178 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpmlint/config
179 %attr(755,root,root) %{_bindir}/rpmdiff
180 %attr(755,root,root) %{_bindir}/rpmlint
181 %{_mandir}/man1/rpmdiff.1*
182 %{_mandir}/man1/rpmlint.1*
183 %dir %{_datadir}/%{name}
184 %{_datadir}/%{name}/config
186 %dir %{py3_sitescriptdir}/%{name}
187 %{py3_sitescriptdir}/%{name}/__pycache__
188 %{py3_sitescriptdir}/%{name}/*.py
190 %dir %{py_sitescriptdir}/%{name}
191 %{py_sitescriptdir}/%{name}/*.py[co]
192 %{_datadir}/%{name}/GROUPS
195 %files -n bash-completion-%{name}
196 %defattr(644,root,root,755)
197 %{bash_compdir}/rpmlint
198 %{bash_compdir}/rpmdiff