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