]> git.pld-linux.org Git - packages/rpmlint.git/blob - rpmlint.spec
5476b0c81788dc7169bd02716fc346b8d6d94016
[packages/rpmlint.git] / rpmlint.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4 %bcond_with     rpm4            # build for rpm4
5
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
8 Name:           rpmlint
9 Version:        1.11
10 Release:        0.6
11 License:        GPL v2
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
21 Patch4:         rpm5.patch
22 Patch5:         bash-completion.patch
23 Patch6:         revert-9f71923e.patch
24 Patch7:         rpm4.15.patch
25 Patch8:         python3.patch
26 URL:            https://github.com/rpm-software-management/rpmlint
27 %if %{with rpm4}
28 BuildRequires:  python3
29 BuildRequires:  python3-modules
30 %{?with_tests:BuildRequires:    python3-rpm >= 1:4.16}
31 %else
32 BuildRequires:  python >= 1:2.6
33 BuildRequires:  python-modules
34 %{?with_tests:BuildRequires:    python-rpm >= 5.4.10-12}
35 %endif
36 BuildRequires:  rpm-pythonprov
37 BuildRequires:  rpmbuild(macros) >= 1.673
38 # tests require rpmlint in installed packages database
39 %{?with_tests:BuildRequires:    rpmlint}
40 Requires:       /bin/bash
41 Requires:       /lib/cpp
42 Requires:       binutils
43 Requires:       bzip2
44 Requires:       cpio
45 Requires:       desktop-file-utils
46 Requires:       file
47 Requires:       findutils
48 Requires:       grep
49 Requires:       gzip
50 %if %{with rpm4}
51 Requires:       python3
52 Requires:       python3-magic
53 Requires:       python3-pyenchant
54 Requires:       python3-rpm >= 1:4.16
55 %else
56 Requires:       python >= 1.5.2
57 Requires:       python-magic
58 Requires:       python-pyenchant
59 Requires:       python-rpm >= 5.4.10-12
60 %endif
61 Requires:       xz
62 BuildArch:      noarch
63 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65 %description
66 Rpmlint is a tool to check common errors on rpm packages. Binary and
67 source packages can be checked.
68
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.
72
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
79
80 %description -n bash-completion-%{name}
81 bash-completion for rpmlint.
82
83 %description -n bash-completion-%{name} -l pl.UTF-8
84 Bashowe uzupełnianie parametrów dla polecenia rpmlint.
85
86 %prep
87 %setup -q -n %{name}-rpmlint-%{version}
88 %{!?with_rpm4:%patch0 -p1}
89 %patch1 -p1
90 %patch2 -p1
91 %patch3 -p1
92 %patch5 -p1
93 %if %{with rpm4}
94 %patch7 -p1
95 %patch8 -p1
96 %else
97 %patch4 -p1
98 %patch6 -p1
99 %endif
100
101 cp -p config config.example
102 cp -p %{SOURCE3} config
103
104 mv %{name} %{name}.py
105 %{__sed} -i -e 's,python ./rpmlint,./rpmlint.py,' test.sh
106
107 touch __init__.py
108
109 %if %{with rpm4}
110 %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' rpmdiff rpmlint.py
111 cat <<'EOF' > %{name}
112 #!/bin/sh
113 exec %{__python3} -tt -u -O %{py3_sitescriptdir}/%{name}/rpmlint.py "$@"
114 EOF
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
122
123 %build
124 %if %{without rpm4}
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
128 test -s GROUPS
129 %endif
130
131 %{__make} \
132         bash_compdir=%{bash_compdir} \
133 %if %{with rpm4}
134         PYTHON=%{__python3} \
135 %else
136         PYTHON=%{__python} \
137 %endif
138         COMPILE_PYC=1
139
140 %if %{with tests}
141 %{__make} check
142 %endif
143
144 %install
145 rm -rf $RPM_BUILD_ROOT
146 %{__make} install \
147         bash_compdir=%{bash_compdir} \
148 %if %{with rpm4}
149         PYTHON=%{__python3} \
150         LIBDIR=%{py3_sitescriptdir}/%{name} \
151 %else
152         PYTHON=%{__python} \
153         LIBDIR=%{py_sitescriptdir}/%{name} \
154 %endif
155         ETCDIR=%{_sysconfdir} \
156         MANDIR=%{_mandir} \
157         BINDIR=%{_bindir} \
158         DESTDIR=$RPM_BUILD_ROOT
159
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
164
165 %if %{without rpm4}
166 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
167 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
168 %py_postclean
169 %endif
170
171 %clean
172 rm -rf $RPM_BUILD_ROOT
173
174 %files
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
185 %if %{with rpm4}
186 %dir %{py3_sitescriptdir}/%{name}
187 %{py3_sitescriptdir}/%{name}/__pycache__
188 %{py3_sitescriptdir}/%{name}/*.py
189 %else
190 %dir %{py_sitescriptdir}/%{name}
191 %{py_sitescriptdir}/%{name}/*.py[co]
192 %{_datadir}/%{name}/GROUPS
193 %endif
194
195 %files -n bash-completion-%{name}
196 %defattr(644,root,root,755)
197 %{bash_compdir}/rpmlint
198 %{bash_compdir}/rpmdiff
This page took 0.0748180000000001 seconds and 2 git commands to generate.