]> git.pld-linux.org Git - packages/rpmlint.git/blame - rpmlint.spec
- release 3 (by relup.sh)
[packages/rpmlint.git] / rpmlint.spec
CommitLineData
f021bddd
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
67a59601 4%bcond_without 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
213a8fb0 10Release: 3
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
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
128rpmnv=$(rpm -q rpm --qf '%{N}-%{V}')
129gzip -dc "%{_docdir}/$rpmnv/groups.gz" | awk '/^[A-Z].*/ { print }' > GROUPS
130test -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
156rm -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
173cat <<'EOF' > $RPM_BUILD_ROOT%{_bindir}/rpmlint
174#!/bin/sh
175exec %{__python3} -tt -u -O %{py3_sitescriptdir}/%{name}/rpmlint.py "$@"
176EOF
177%else
178%{__mv} $RPM_BUILD_ROOT%{_bindir}/rpmlint $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/rpmlint.py
179cat <<'EOF' > $RPM_BUILD_ROOT%{_bindir}/rpmlint
180#!/bin/sh
181exec %{__python} -tt -u -O %{py_sitescriptdir}/%{name}/rpmlint.pyc "$@"
182EOF
183%endif
184
7eff95a4 185install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
545215d1 186cp -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
196rm -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
This page took 0.172965 seconds and 4 git commands to generate.