]>
Commit | Line | Data |
---|---|---|
f021bddd ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
f24c60bb | 4 | %bcond_with 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 JR |
9 | Version: 1.11 |
10 | Release: 0.6 | |
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 | |
7ea4c2ce | 26 | URL: https://github.com/rpm-software-management/rpmlint |
f24c60bb JR |
27 | %if %{with rpm4} |
28 | BuildRequires: python3 | |
29 | BuildRequires: python3-modules | |
30 | %{?with_tests:BuildRequires: python3-rpm >= 1:4.16} | |
31 | %else | |
21e8a795 | 32 | BuildRequires: python >= 1:2.6 |
f7da4619 | 33 | BuildRequires: python-modules |
47a5242e | 34 | %{?with_tests:BuildRequires: python-rpm >= 5.4.10-12} |
f24c60bb | 35 | %endif |
f7da4619 | 36 | BuildRequires: rpm-pythonprov |
545215d1 | 37 | BuildRequires: rpmbuild(macros) >= 1.673 |
3f2e0c60 JB |
38 | # tests require rpmlint in installed packages database |
39 | %{?with_tests:BuildRequires: rpmlint} | |
99ee1f6f JB |
40 | Requires: /bin/bash |
41 | Requires: /lib/cpp | |
42 | Requires: binutils | |
a8e9a8e0 | 43 | Requires: bzip2 |
99ee1f6f | 44 | Requires: cpio |
a8e9a8e0 | 45 | Requires: desktop-file-utils |
99ee1f6f JB |
46 | Requires: file |
47 | Requires: findutils | |
48 | Requires: grep | |
a8e9a8e0 | 49 | Requires: gzip |
f24c60bb JR |
50 | %if %{with rpm4} |
51 | Requires: python3 | |
52 | Requires: python3-magic | |
53 | Requires: python3-pyenchant | |
54 | Requires: python3-rpm >= 1:4.16 | |
55 | %else | |
9fef494b | 56 | Requires: python >= 1.5.2 |
a8e9a8e0 ER |
57 | Requires: python-magic |
58 | Requires: python-pyenchant | |
f1e83b32 | 59 | Requires: python-rpm >= 5.4.10-12 |
f24c60bb | 60 | %endif |
a8e9a8e0 | 61 | Requires: xz |
c502a620 | 62 | BuildArch: noarch |
99ee1f6f | 63 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
c502a620 | 64 | |
65 | %description | |
66 | Rpmlint is a tool to check common errors on rpm packages. Binary and | |
67 | source packages can be checked. | |
68 | ||
6cf0c67a JR |
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. | |
99ee1f6f | 72 | |
a8e9a8e0 ER |
73 | %package -n bash-completion-%{name} |
74 | Summary: bash-completion for rpmlint | |
3f2e0c60 | 75 | Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia rpmlint |
a8e9a8e0 ER |
76 | Group: Applications/Shells |
77 | Requires: %{name} = %{version}-%{release} | |
545215d1 | 78 | Requires: bash-completion >= 2.0 |
a8e9a8e0 ER |
79 | |
80 | %description -n bash-completion-%{name} | |
81 | bash-completion for rpmlint. | |
82 | ||
3f2e0c60 JB |
83 | %description -n bash-completion-%{name} -l pl.UTF-8 |
84 | Bashowe 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 |
101 | cp -p config config.example |
102 | cp -p %{SOURCE3} config | |
103 | ||
8f0b3aa9 ER |
104 | mv %{name} %{name}.py |
105 | %{__sed} -i -e 's,python ./rpmlint,./rpmlint.py,' test.sh | |
106 | ||
f24c60bb JR |
107 | touch __init__.py |
108 | ||
109 | %if %{with rpm4} | |
110 | %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' rpmdiff rpmlint.py | |
8f0b3aa9 | 111 | cat <<'EOF' > %{name} |
7eff95a4 | 112 | #!/bin/sh |
f24c60bb | 113 | exec %{__python3} -tt -u -O %{py3_sitescriptdir}/%{name}/rpmlint.py "$@" |
7eff95a4 | 114 | EOF |
f24c60bb JR |
115 | %else |
116 | %{__sed} -i -e '1s,/usr/bin/python,%{__python},' rpmdiff rpmlint.py | |
117 | cat <<'EOF' > %{name} | |
118 | #!/bin/sh | |
119 | exec %{__python} -tt -u -O %{py_sitescriptdir}/%{name}/rpmlint.pyc "$@" | |
120 | EOF | |
121 | %endif | |
c502a620 | 122 | |
123 | %build | |
f24c60bb | 124 | %if %{without rpm4} |
a8e9a8e0 | 125 | # Create GROUPS for -groups.patch |
07c5699d ER |
126 | rpmnv=$(rpm -q rpm --qf '%{N}-%{V}') |
127 | gzip -dc "%{_docdir}/$rpmnv/groups.gz" | awk '/^[A-Z].*/ { print }' > GROUPS | |
128 | test -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 |
145 | rm -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 | 161 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name} |
f24c60bb | 162 | %{!?with_rpm4:cp -p GROUPS $RPM_BUILD_ROOT%{_datadir}/%{name}} |
545215d1 | 163 | cp -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 |
172 | rm -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 |