]> git.pld-linux.org Git - packages/rpmlint.git/blame - rpmlint.spec
- up to 1.11
[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
JR
9Version: 1.11
10Release: 0.6
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
7ea4c2ce 26URL: https://github.com/rpm-software-management/rpmlint
f24c60bb
JR
27%if %{with rpm4}
28BuildRequires: python3
29BuildRequires: python3-modules
30%{?with_tests:BuildRequires: python3-rpm >= 1:4.16}
31%else
21e8a795 32BuildRequires: python >= 1:2.6
f7da4619 33BuildRequires: python-modules
47a5242e 34%{?with_tests:BuildRequires: python-rpm >= 5.4.10-12}
f24c60bb 35%endif
f7da4619 36BuildRequires: rpm-pythonprov
545215d1 37BuildRequires: rpmbuild(macros) >= 1.673
3f2e0c60
JB
38# tests require rpmlint in installed packages database
39%{?with_tests:BuildRequires: rpmlint}
99ee1f6f
JB
40Requires: /bin/bash
41Requires: /lib/cpp
42Requires: binutils
a8e9a8e0 43Requires: bzip2
99ee1f6f 44Requires: cpio
a8e9a8e0 45Requires: desktop-file-utils
99ee1f6f
JB
46Requires: file
47Requires: findutils
48Requires: grep
a8e9a8e0 49Requires: gzip
f24c60bb
JR
50%if %{with rpm4}
51Requires: python3
52Requires: python3-magic
53Requires: python3-pyenchant
54Requires: python3-rpm >= 1:4.16
55%else
9fef494b 56Requires: python >= 1.5.2
a8e9a8e0
ER
57Requires: python-magic
58Requires: python-pyenchant
f1e83b32 59Requires: python-rpm >= 5.4.10-12
f24c60bb 60%endif
a8e9a8e0 61Requires: xz
c502a620 62BuildArch: noarch
99ee1f6f 63BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
c502a620 64
65%description
66Rpmlint is a tool to check common errors on rpm packages. Binary and
67source packages can be checked.
68
6cf0c67a
JR
69%description -l pl.UTF-8
70rpmlint to narzędzie do sprawdzania pakietów RPM pod kątem często
71występujących błędów. Można sprawdzać pakiety źródłowe i binarne.
99ee1f6f 72
a8e9a8e0
ER
73%package -n bash-completion-%{name}
74Summary: bash-completion for rpmlint
3f2e0c60 75Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia rpmlint
a8e9a8e0
ER
76Group: Applications/Shells
77Requires: %{name} = %{version}-%{release}
545215d1 78Requires: bash-completion >= 2.0
a8e9a8e0
ER
79
80%description -n bash-completion-%{name}
81bash-completion for rpmlint.
82
3f2e0c60
JB
83%description -n bash-completion-%{name} -l pl.UTF-8
84Bashowe uzupełnianie parametrów dla polecenia rpmlint.
85
c502a620 86%prep
7ea4c2ce 87%setup -q -n %{name}-rpmlint-%{version}
f24c60bb 88%{!?with_rpm4:%patch0 -p1}
18f9b171 89%patch1 -p1
0cb3fb55 90%patch2 -p1
706415a2 91%patch3 -p1
4fafb4fa 92%patch5 -p1
f24c60bb
JR
93%if %{with rpm4}
94%patch7 -p1
95%patch8 -p1
96%else
97%patch4 -p1
f5b2d519 98%patch6 -p1
f24c60bb 99%endif
7eff95a4 100
f021bddd
ER
101cp -p config config.example
102cp -p %{SOURCE3} config
103
8f0b3aa9
ER
104mv %{name} %{name}.py
105%{__sed} -i -e 's,python ./rpmlint,./rpmlint.py,' test.sh
106
f24c60bb
JR
107touch __init__.py
108
109%if %{with rpm4}
110%{__sed} -i -e '1s,/usr/bin/python,%{__python3},' rpmdiff rpmlint.py
8f0b3aa9 111cat <<'EOF' > %{name}
7eff95a4 112#!/bin/sh
f24c60bb 113exec %{__python3} -tt -u -O %{py3_sitescriptdir}/%{name}/rpmlint.py "$@"
7eff95a4 114EOF
f24c60bb
JR
115%else
116%{__sed} -i -e '1s,/usr/bin/python,%{__python},' rpmdiff rpmlint.py
117cat <<'EOF' > %{name}
118#!/bin/sh
119exec %{__python} -tt -u -O %{py_sitescriptdir}/%{name}/rpmlint.pyc "$@"
120EOF
121%endif
c502a620 122
123%build
f24c60bb 124%if %{without rpm4}
a8e9a8e0 125# Create GROUPS for -groups.patch
07c5699d
ER
126rpmnv=$(rpm -q rpm --qf '%{N}-%{V}')
127gzip -dc "%{_docdir}/$rpmnv/groups.gz" | awk '/^[A-Z].*/ { print }' > GROUPS
128test -s GROUPS
f24c60bb 129%endif
a8e9a8e0
ER
130
131%{__make} \
545215d1 132 bash_compdir=%{bash_compdir} \
f24c60bb
JR
133%if %{with rpm4}
134 PYTHON=%{__python3} \
135%else
136 PYTHON=%{__python} \
137%endif
a8e9a8e0 138 COMPILE_PYC=1
c502a620 139
f021bddd
ER
140%if %{with tests}
141%{__make} check
142%endif
143
c502a620 144%install
145rm -rf $RPM_BUILD_ROOT
146%{__make} install \
d51dcadb 147 bash_compdir=%{bash_compdir} \
f24c60bb
JR
148%if %{with rpm4}
149 PYTHON=%{__python3} \
150 LIBDIR=%{py3_sitescriptdir}/%{name} \
151%else
152 PYTHON=%{__python} \
153 LIBDIR=%{py_sitescriptdir}/%{name} \
154%endif
a8e9a8e0
ER
155 ETCDIR=%{_sysconfdir} \
156 MANDIR=%{_mandir} \
a8e9a8e0 157 BINDIR=%{_bindir} \
c502a620 158 DESTDIR=$RPM_BUILD_ROOT
159
f24c60bb 160#install -p %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
7eff95a4 161install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
f24c60bb 162%{!?with_rpm4:cp -p GROUPS $RPM_BUILD_ROOT%{_datadir}/%{name}}
545215d1 163cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/config
a8e9a8e0 164
f24c60bb 165%if %{without rpm4}
7eff95a4
ER
166%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
167%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
168%py_postclean
f24c60bb 169%endif
a8e9a8e0 170
c502a620 171%clean
172rm -rf $RPM_BUILD_ROOT
173
174%files
175%defattr(644,root,root,755)
7ea4c2ce 176%doc README* config.example
7eff95a4
ER
177%dir %{_sysconfdir}/rpmlint
178%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpmlint/config
a8e9a8e0
ER
179%attr(755,root,root) %{_bindir}/rpmdiff
180%attr(755,root,root) %{_bindir}/rpmlint
545215d1 181%{_mandir}/man1/rpmdiff.1*
a8e9a8e0 182%{_mandir}/man1/rpmlint.1*
f021bddd 183%dir %{_datadir}/%{name}
f021bddd 184%{_datadir}/%{name}/config
f24c60bb
JR
185%if %{with rpm4}
186%dir %{py3_sitescriptdir}/%{name}
187%{py3_sitescriptdir}/%{name}/__pycache__
188%{py3_sitescriptdir}/%{name}/*.py
189%else
f021bddd
ER
190%dir %{py_sitescriptdir}/%{name}
191%{py_sitescriptdir}/%{name}/*.py[co]
f24c60bb
JR
192%{_datadir}/%{name}/GROUPS
193%endif
a8e9a8e0
ER
194
195%files -n bash-completion-%{name}
196%defattr(644,root,root,755)
545215d1
ER
197%{bash_compdir}/rpmlint
198%{bash_compdir}/rpmdiff
This page took 0.10121 seconds and 4 git commands to generate.